java.lang.Object
org.apache.jena.graph.Node
org.apache.jena.graph.Node_Fluid
org.apache.jena.graph.Node_Variable
org.apache.jena.reasoner.rulesys.Node_RuleVariable
- All Implemented Interfaces:
Serializable
A variation on the normal Node_Variable which support for value bindings.
Currently the forward rule system stores the values externally but requires
variables to have an offset index in the rule environment vector. The
variables can also support prolog-like reference chains and trails but these
are not yet used.
Note that this should not be used in a real Triple, in particular it should not end up in a Graph. It is only needed for the rule systems.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jena.graph.Node_Variable
Node_Variable.VariableName
Nested classes/interfaces inherited from class org.apache.jena.graph.Node
Node.NotLiteral
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Node_RuleVariable
A static wildcard - like Node.ANY but tests equal to other Node_RuleVariables -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClone the rule variable to allow multiple rule instaces to be active at the same time.deref()
Dereference a variable by following the reference chain.boolean
Nodes only equal other Nodes that have equal labels.int
getIndex()
Returns the variable's index in a binding vector.Return the raw value to which this variable is bound (via LP binding) with no dereferencing.int
hashCode()
boolean
Test if the variable is unbound (in the brule sense).static boolean
sameNodeAs
(Node n, Node m) Compare two nodes, taking into account variable indices.boolean
Test that two nodes are semantically equivalent.void
setIndex
(int index) Changes the variable's index.void
simpleBind
(Node node) Binds a value to the brule version of the variable.toString()
printable formvoid
unbind()
Set the variable to be unbound (in the brule sense)Methods inherited from class org.apache.jena.graph.Node_Variable
getName, isVariable, variable, visitWith
Methods inherited from class org.apache.jena.graph.Node_Fluid
isConcrete
Methods inherited from class org.apache.jena.graph.Node
getBlankNodeId, getBlankNodeLabel, getGraph, getIndexingValue, getLiteral, getLiteralDatatype, getLiteralDatatypeURI, getLiteralIsXML, getLiteralLanguage, getLiteralLexicalForm, getLiteralValue, getLocalName, getNameSpace, getTriple, getURI, hasURI, isBlank, isExt, isLiteral, isNodeGraph, isNodeTriple, isURI, matches, toString, toString, toString
-
Field Details
-
WILD
A static wildcard - like Node.ANY but tests equal to other Node_RuleVariables
-
-
Constructor Details
-
Node_RuleVariable
Constructor- Parameters:
label
- the text label for the variableindex
- the calculated index of this variable in the rule
-
-
Method Details
-
getIndex
public int getIndex()Returns the variable's index in a binding vector.- Returns:
- int
-
setIndex
public void setIndex(int index) Changes the variable's index. This is used in LP rules which classify the variables into different sequences. -
simpleBind
Binds a value to the brule version of the variable. Does not follow any reference trail, assues we have already been derefenced.- Parameters:
node
- a concrete Node value or another Node_RuleVariable to alias to
-
deref
Dereference a variable by following the reference chain.- Returns:
- either a concrete node value or the last variable in the reference chain.
-
getRawBoundValue
Return the raw value to which this variable is bound (via LP binding) with no dereferencing. -
unbind
public void unbind()Set the variable to be unbound (in the brule sense) -
isUnbound
public boolean isUnbound()Test if the variable is unbound (in the brule sense). -
cloneNode
Clone the rule variable to allow multiple rule instaces to be active at the same time. -
toString
printable form- Overrides:
toString
in classNode_Variable
-
equals
Description copied from class:Node
Nodes only equal other Nodes that have equal labels.- Overrides:
equals
in classNode_Variable
-
hashCode
public int hashCode() -
sameValueAs
Test that two nodes are semantically equivalent.- Overrides:
sameValueAs
in classNode
-
sameNodeAs
Compare two nodes, taking into account variable indices.
-