Class LPBindingEnvironment
- java.lang.Object
-
- org.apache.jena.reasoner.rulesys.impl.LPBindingEnvironment
-
- All Implemented Interfaces:
BindingEnvironment
public class LPBindingEnvironment extends java.lang.Object implements BindingEnvironment
Implementation of the binding environment interface for use in LP backward rules.
-
-
Constructor Summary
Constructors Constructor Description LPBindingEnvironment(LPInterpreter interpeter)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bind(Node var, Node value)
Bind a variable in the current environment to the given value.Node
getGroundVersion(Node node)
Return the most ground version of the node.Triple
instantiate(TriplePattern pattern)
Instantiate a triple pattern against the current environment.
-
-
-
Constructor Detail
-
LPBindingEnvironment
public LPBindingEnvironment(LPInterpreter interpeter)
Constructor.
-
-
Method Detail
-
getGroundVersion
public Node getGroundVersion(Node node)
Return the most ground version of the node. If the node is not a variable just return it, if it is a variable bound in this environment return the binding, if it is an unbound variable return the variable.- Specified by:
getGroundVersion
in interfaceBindingEnvironment
-
bind
public boolean bind(Node var, Node value)
Bind a variable in the current environment to the given value. Checks that the new binding is compatible with any current binding.- Specified by:
bind
in interfaceBindingEnvironment
- Parameters:
var
- a Node_RuleVariable defining the variable to bindvalue
- the value to bind- Returns:
- false if the binding fails
-
instantiate
public Triple instantiate(TriplePattern pattern)
Instantiate a triple pattern against the current environment. This version handles unbound variables by turning them into bNodes.- Specified by:
instantiate
in interfaceBindingEnvironment
- Parameters:
pattern
- the triple pattern to match- Returns:
- a new, instantiated triple
-
-