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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert a new triple in the deduction graph, triggering any consequent processing as appropriate.booleanReturn true if the triple pattern is already in either the graph or the stack.booleanReturn 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.voidRemove a triple from the deduction graph (and the original graph if relevant).voidsetEnv(BindingEnvironment env) Set the binding environment for the this contextvoidSets the rule.voidAssert 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:RuleContextReturn true if the triple pattern is already in either the graph or the stack. I.e. it has already been deduced.- Specified by:
containsin interfaceRuleContext- See Also:
-
contains
Description copied from interface:RuleContextReturn true if the triple is already in either the graph or the stack. I.e. it has already been deduced.- Specified by:
containsin interfaceRuleContext- See Also:
-
find
Description copied from interface:RuleContextIn some formulations the context includes deductions that are not yet visible to the underlying graph but need to be checked for.- Specified by:
findin interfaceRuleContext- See Also:
-
getEnv
Description copied from interface:RuleContextReturns the current variable binding environment for the current rule.- Specified by:
getEnvin interfaceRuleContext- Returns:
- BindingEnvironment
- See Also:
-
setEnv
Set the binding environment for the this context -
getGraph
Description copied from interface:RuleContextReturns the parent inference graph.- Specified by:
getGraphin interfaceRuleContext- Returns:
- InfGraph
- See Also:
-
getRule
Description copied from interface:RuleContextReturns the rule.- Specified by:
getRulein interfaceRuleContext- Returns:
- Rule
- See Also:
-
setRule
Description copied from interface:RuleContextSets the rule.- Specified by:
setRulein interfaceRuleContext- Parameters:
rule- The rule to set- See Also:
-
silentAdd
Assert a new triple in the deduction graph, bypassing any processing machinery.- Specified by:
silentAddin 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:
addin interfaceRuleContext
-
remove
Remove a triple from the deduction graph (and the original graph if relevant).- Specified by:
removein 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
-