public class BBRuleContext extends Object implements RuleContext
| Constructor and Description |
|---|
BBRuleContext(BackwardRuleInfGraphI graph)
Construct an empty context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Triple t)
Assert a new triple in the deduction graph, triggering any consequent processing as appropriate.
|
boolean |
contains(Node s,
Node p,
Node o)
Return true if the triple pattern is already in either the graph or the stack.
|
boolean |
contains(Triple t)
Return true if the triple is already in either the graph or the stack.
|
ClosableIterator<Triple> |
find(Node s,
Node p,
Node o)
In some formulations the context includes deductions that are not yet
visible to the underlying graph but need to be checked for.
|
BindingEnvironment |
getEnv()
Returns the current variable binding environment for the current rule.
|
InfGraph |
getGraph()
Returns the parent inference graph.
|
Rule |
getRule()
Returns the rule.
|
Node |
getTemp(Node instance,
Node prop,
Node pclass)
Retrieve or create a bNode representing an inferred property value.
|
void |
remove(Triple t)
Remove a triple from the deduction graph (and the original graph if relevant).
|
void |
setEnv(BindingEnvironment env)
Set the binding environment for the this context
|
void |
setRule(Rule rule)
Sets the rule.
|
void |
silentAdd(Triple t)
Assert a new triple in the deduction graph, bypassing any processing machinery.
|
public BBRuleContext(BackwardRuleInfGraphI graph)
public boolean contains(Node s, Node p, Node o)
RuleContextcontains in interface RuleContextRuleContext.contains(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)public boolean contains(Triple t)
RuleContextcontains in interface RuleContextRuleContext.contains(org.apache.jena.graph.Triple)public ClosableIterator<Triple> find(Node s, Node p, Node o)
RuleContextfind in interface RuleContextRuleContext.find(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)public BindingEnvironment getEnv()
RuleContextgetEnv in interface RuleContextRuleContext.getEnv()public void setEnv(BindingEnvironment env)
public InfGraph getGraph()
RuleContextgetGraph in interface RuleContextRuleContext.getGraph()public Rule getRule()
RuleContextgetRule in interface RuleContextRuleContext.getRule()public void setRule(Rule rule)
RuleContextsetRule in interface RuleContextrule - The rule to setRuleContext.setRule(org.apache.jena.reasoner.rulesys.Rule)public void silentAdd(Triple t)
silentAdd in interface RuleContextpublic void add(Triple t)
add in interface RuleContextpublic void remove(Triple t)
remove in interface RuleContextpublic Node getTemp(Node instance, Node prop, Node pclass)
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.Licenced under the Apache License, Version 2.0