Package org.apache.jena.sparql.expr
Class ExprNode
- java.lang.Object
-
- org.apache.jena.sparql.expr.ExprNode
-
- All Implemented Interfaces:
Expr
- Direct Known Subclasses:
ExprAggregator,ExprFunction,ExprNone,ExprTripleTerm,ExprVar,NodeValue
public abstract class ExprNode extends java.lang.Object implements Expr
-
-
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
Constructors Constructor Description ExprNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ExprapplyNodeTransform(NodeTransform transform)Rewrite, applying a node->node transformationVarasVar()Convert to a Var variable.abstract ExprcopySubstitute(Binding binding)Deep copy with substitutionExprdeepCopy()Deep copybooleanequals(java.lang.Object other)abstract booleanequals(Expr other, boolean bySyntax)General equality operation - consider this to be 'protected'booleanequalsBySyntax(Expr other)abstract NodeValueeval(Binding binding, FunctionEnv env)Evaluate this expression against the bindingNodeValuegetConstant()NodeValue constant (returns null if not a constant)ExprgetExpr()ExprVargetExprVar()Variable (or null)ExprFunctiongetFunction()Get the function (returns null if not a function)OpgetGraphPattern()java.lang.StringgetVarName()Variable name (returns null if not a variable)java.util.Set<Var>getVarsMentioned()Variables used by this expression.abstract inthashCode()Exprare used in both syntax and algebra.booleanisConstant()Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantbooleanisExpr()booleanisFunction()Answer whether this is a function.booleanisGraphPattern()booleanisSatisfied(Binding binding, FunctionEnv funcEnv)Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.booleanisVariable()Answer whether this is a variable.java.lang.StringtoString()
-
-
-
Method Detail
-
isSatisfied
public boolean isSatisfied(Binding binding, FunctionEnv funcEnv)
Description copied from interface:ExprTest whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.- Specified by:
isSatisfiedin interfaceExpr- Parameters:
binding- The bindingsfuncEnv- FunctionEnv- Returns:
- true or false
-
isExpr
public boolean isExpr()
-
getExpr
public final Expr getExpr()
-
eval
public abstract NodeValue eval(Binding binding, FunctionEnv env)
Description copied from interface:ExprEvaluate this expression against the binding
-
getVarsMentioned
public final java.util.Set<Var> getVarsMentioned()
Description copied from interface:ExprVariables used by this expression.- Specified by:
getVarsMentionedin interfaceExpr- See Also:
ExprVars.getVarNamesMentioned(org.apache.jena.sparql.expr.Expr),ExprVars.getNonOpVarNamesMentioned(org.apache.jena.sparql.expr.Expr)
-
hashCode
public abstract int hashCode()
Description copied from interface:ExprExprare 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 EXISTSandEXISTSexpressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.Two
Exprare considered equal if they are equal as algebra expressions.hashCodeandequalsmust 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,equalsBySyntaximpliesequals(by alegbra).Hence, different
hashCode=> notequalsBySyntax.
-
equals
public final boolean equals(java.lang.Object other)
-
equalsBySyntax
public final boolean equalsBySyntax(Expr other)
- Specified by:
equalsBySyntaxin interfaceExpr
-
equals
public abstract boolean equals(Expr other, boolean bySyntax)
Description copied from interface:ExprGeneral equality operation - consider this to be 'protected'
-
copySubstitute
public abstract Expr copySubstitute(Binding binding)
Description copied from interface:ExprDeep copy with substitution- Specified by:
copySubstitutein interfaceExpr
-
applyNodeTransform
public abstract Expr applyNodeTransform(NodeTransform transform)
Description copied from interface:ExprRewrite, applying a node->node transformation- Specified by:
applyNodeTransformin interfaceExpr
-
isVariable
public boolean isVariable()
Description copied from interface:ExprAnswer whether this is a variable.- Specified by:
isVariablein interfaceExpr
-
getVarName
public java.lang.String getVarName()
Description copied from interface:ExprVariable name (returns null if not a variable)- Specified by:
getVarNamein interfaceExpr
-
getExprVar
public ExprVar getExprVar()
Description copied from interface:ExprVariable (or null)- Specified by:
getExprVarin interfaceExpr
-
isConstant
public boolean isConstant()
Description copied from interface:ExprAnswer 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:
isConstantin interfaceExpr
-
getConstant
public NodeValue getConstant()
Description copied from interface:ExprNodeValue constant (returns null if not a constant)- Specified by:
getConstantin interfaceExpr
-
isFunction
public boolean isFunction()
Description copied from interface:ExprAnswer whether this is a function.- Specified by:
isFunctionin interfaceExpr
-
getFunction
public ExprFunction getFunction()
Description copied from interface:ExprGet the function (returns null if not a function)- Specified by:
getFunctionin interfaceExpr
-
isGraphPattern
public boolean isGraphPattern()
-
getGraphPattern
public Op getGraphPattern()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-