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)
RuleContext
contains
in interface RuleContext
RuleContext.contains(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)
public boolean contains(Triple t)
RuleContext
contains
in interface RuleContext
RuleContext.contains(org.apache.jena.graph.Triple)
public ClosableIterator<Triple> find(Node s, Node p, Node o)
RuleContext
find
in interface RuleContext
RuleContext.find(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node)
public BindingEnvironment getEnv()
RuleContext
getEnv
in interface RuleContext
RuleContext.getEnv()
public void setEnv(BindingEnvironment env)
public InfGraph getGraph()
RuleContext
getGraph
in interface RuleContext
RuleContext.getGraph()
public Rule getRule()
RuleContext
getRule
in interface RuleContext
RuleContext.getRule()
public void setRule(Rule rule)
RuleContext
setRule
in interface RuleContext
rule
- The rule to setRuleContext.setRule(org.apache.jena.reasoner.rulesys.Rule)
public void silentAdd(Triple t)
silentAdd
in interface RuleContext
public void add(Triple t)
add
in interface RuleContext
public void remove(Triple t)
remove
in interface RuleContext
public 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