java.lang.Object
org.apache.jena.sparql.expr.ExprNode
- All Implemented Interfaces:
Expr
- Direct Known Subclasses:
ExprAggregator
,ExprFunction
,ExprNone
,ExprTripleTerm
,ExprVar
,NodeValue
-
Field Summary
Fields inherited from interface org.apache.jena.sparql.expr.Expr
CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL, NONE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Expr
applyNodeTransform
(NodeTransform transform) Rewrite, applying a node->node transformationasVar()
Convert to a Var variable.abstract Expr
copySubstitute
(Binding binding) Deep copy with substitutionfinal Expr
deepCopy()
Deep copyfinal boolean
abstract boolean
General equality operation - consider this to be 'protected'final boolean
equalsBySyntax
(Expr other) abstract NodeValue
eval
(Binding binding, FunctionEnv env) Evaluate this expression against the bindingNodeValue constant (returns null if not a constant)final Expr
getExpr()
Variable (or null)Get the function (returns null if not a function)Variable name (returns null if not a variable)Variables used by this expression.abstract int
hashCode()
Expr
are used in both syntax and algebra.boolean
Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantboolean
isExpr()
boolean
Answer whether this is a function.boolean
boolean
isSatisfied
(Binding binding, FunctionEnv funcEnv) Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.boolean
Answer whether this is a variable.toString()
-
Constructor Details
-
ExprNode
public ExprNode()
-
-
Method Details
-
isSatisfied
Description copied from interface:Expr
Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.- Specified by:
isSatisfied
in interfaceExpr
- Parameters:
binding
- The bindingsfuncEnv
- FunctionEnv- Returns:
- true or false
-
isExpr
public boolean isExpr() -
getExpr
-
eval
Description copied from interface:Expr
Evaluate this expression against the binding -
getVarsMentioned
Description copied from interface:Expr
Variables used by this expression.- Specified by:
getVarsMentioned
in interfaceExpr
- See Also:
-
hashCode
public abstract int hashCode()Description copied from interface:Expr
Expr
are used in both syntax and algebra. There is no syntax to algebra translation step because the parser uses operator precedence to build the right evaluation structure directly.The exceptions to this are the
NOT EXISTS
andEXISTS
expressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.Two
Expr
are considered equal if they are equal as algebra expressions.hashCode
andequals
must implement that.There is also
equalsBySyntax
. Because two different syntax forms can yield the same algebra, but two different algebra forms must be different syntax,equalsBySyntax
impliesequals
(by algebra).Hence, different
hashCode
=> notequalsBySyntax
. -
equals
-
equalsBySyntax
- Specified by:
equalsBySyntax
in interfaceExpr
-
equals
Description copied from interface:Expr
General equality operation - consider this to be 'protected' -
deepCopy
Description copied from interface:Expr
Deep copy -
copySubstitute
Description copied from interface:Expr
Deep copy with substitution- Specified by:
copySubstitute
in interfaceExpr
-
applyNodeTransform
Description copied from interface:Expr
Rewrite, applying a node->node transformation- Specified by:
applyNodeTransform
in interfaceExpr
-
isVariable
public boolean isVariable()Description copied from interface:Expr
Answer whether this is a variable.- Specified by:
isVariable
in interfaceExpr
-
getVarName
Description copied from interface:Expr
Variable name (returns null if not a variable)- Specified by:
getVarName
in interfaceExpr
-
getExprVar
Description copied from interface:Expr
Variable (or null)- Specified by:
getExprVar
in interfaceExpr
-
asVar
Description copied from interface:Expr
Convert to a Var variable. -
isConstant
public boolean isConstant()Description copied from interface:Expr
Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant- Specified by:
isConstant
in interfaceExpr
-
getConstant
Description copied from interface:Expr
NodeValue constant (returns null if not a constant)- Specified by:
getConstant
in interfaceExpr
-
isFunction
public boolean isFunction()Description copied from interface:Expr
Answer whether this is a function.- Specified by:
isFunction
in interfaceExpr
-
getFunction
Description copied from interface:Expr
Get the function (returns null if not a function)- Specified by:
getFunction
in interfaceExpr
-
isGraphPattern
public boolean isGraphPattern() -
getGraphPattern
-
toString
-