java.lang.Object
org.apache.jena.reasoner.rulesys.impl.BBRuleContext
- All Implemented Interfaces:
RuleContext
Implementation of RuleContext for use in the backward chaining
interpreter. The RuleContext allows builtin predicates to
interpret variable bindings to access the static triple data.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Assert a new triple in the deduction graph, triggering any consequent processing as appropriate.boolean
Return true if the triple pattern is already in either the graph or the stack.boolean
Return true if the triple is already in either the graph or the stack.In some formulations the context includes deductions that are not yet visible to the underlying graph but need to be checked for.getEnv()
Returns the current variable binding environment for the current rule.getGraph()
Returns the parent inference graph.getRule()
Returns the rule.Retrieve or create a bNode representing an inferred property value.void
Remove a triple from the deduction graph (and the original graph if relevant).void
setEnv
(BindingEnvironment env) Set the binding environment for the this contextvoid
Sets the rule.void
Assert a new triple in the deduction graph, bypassing any processing machinery.
-
Constructor Details
-
BBRuleContext
Construct an empty context. It can't be used until the rule and environment have been set.
-
-
Method Details
-
contains
Description copied from interface:RuleContext
Return true if the triple pattern is already in either the graph or the stack. I.e. it has already been deduced.- Specified by:
contains
in interfaceRuleContext
- See Also:
-
contains
Description copied from interface:RuleContext
Return true if the triple is already in either the graph or the stack. I.e. it has already been deduced.- Specified by:
contains
in interfaceRuleContext
- See Also:
-
find
Description copied from interface:RuleContext
In some formulations the context includes deductions that are not yet visible to the underlying graph but need to be checked for.- Specified by:
find
in interfaceRuleContext
- See Also:
-
getEnv
Description copied from interface:RuleContext
Returns the current variable binding environment for the current rule.- Specified by:
getEnv
in interfaceRuleContext
- Returns:
- BindingEnvironment
- See Also:
-
setEnv
Set the binding environment for the this context -
getGraph
Description copied from interface:RuleContext
Returns the parent inference graph.- Specified by:
getGraph
in interfaceRuleContext
- Returns:
- InfGraph
- See Also:
-
getRule
Description copied from interface:RuleContext
Returns the rule.- Specified by:
getRule
in interfaceRuleContext
- Returns:
- Rule
- See Also:
-
setRule
Description copied from interface:RuleContext
Sets the rule.- Specified by:
setRule
in interfaceRuleContext
- Parameters:
rule
- The rule to set- See Also:
-
silentAdd
Assert a new triple in the deduction graph, bypassing any processing machinery.- Specified by:
silentAdd
in interfaceRuleContext
-
add
Assert a new triple in the deduction graph, triggering any consequent processing as appropriate. In the backward case there no immediate consequences so this is equivalent to a silentAdd.- Specified by:
add
in interfaceRuleContext
-
remove
Remove a triple from the deduction graph (and the original graph if relevant).- Specified by:
remove
in interfaceRuleContext
-
getTemp
Retrieve or create a bNode representing an inferred property value. This is currently only available on backward contexts and not part of the normal RuleContext interface.- Parameters:
instance
- the base instance node to which the property appliesprop
- the property node whose value is being inferredpclass
- the (optional, can be null) class for the inferred value.- Returns:
- the bNode representing the property value
-