java.lang.Object
org.apache.jena.sparql.expr.ExprNode
org.apache.jena.sparql.expr.ExprFunction
- All Implemented Interfaces:
Expr
- Direct Known Subclasses:
ExprFunction0
,ExprFunction1
,ExprFunction2
,ExprFunction3
,ExprFunctionN
,ExprFunctionOp
A function in the expression hierarchy.
Everything that can be evaluated (i.e. not NodeValue, NodeVar) is a function.
This includes functional forms (e.g. BOUND) and also custom functions (called by URI).
The exists operations (which take a op, not arguments) are functions of zero arguments.
-
Field Summary
Fields inherited from interface org.apache.jena.sparql.expr.Expr
CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL, NONE
-
Method Summary
Modifier and TypeMethodDescriptionboolean
General equality operation - consider this to be 'protected'abstract Expr
getArg
(int i) getArgs()
Get the function (returns null if not a function)URI for this function, whether custom or specification defined URI (these are keywords in the language)Name used in a functional form (i.e.Name used for output in SPARQL format needing functional form (no specific keyword).Used to get a unique name for the function, which is intern'ed.Get the symbol name (+, !int
hashCode()
Expr
are used in both syntax and algebra.boolean
Answer whether this is a function.abstract int
numArgs()
Methods inherited from class org.apache.jena.sparql.expr.ExprNode
applyNodeTransform, asVar, copySubstitute, deepCopy, equals, equalsBySyntax, eval, getConstant, getExpr, getExprVar, getGraphPattern, getVarName, getVarsMentioned, isConstant, isExpr, isGraphPattern, isSatisfied, isVariable, toString
-
Method Details
-
getArg
-
numArgs
public abstract int numArgs() -
getArgs
-
isFunction
public boolean isFunction()Description copied from interface:Expr
Answer whether this is a function.- Specified by:
isFunction
in interfaceExpr
- Overrides:
isFunction
in classExprNode
-
getFunction
Description copied from interface:Expr
Get the function (returns null if not a function)- Specified by:
getFunction
in interfaceExpr
- Overrides:
getFunction
in classExprNode
-
hashCode
public 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
Description copied from interface:Expr
General equality operation - consider this to be 'protected' -
getFunctionPrintName
Name used for output in SPARQL format needing functional form (no specific keyword). e.g. regexp(), custom functions, ... -
getFunctionName
Name used in a functional form (i.e. SPARQL algebra). getOpName() is used in preference as a short, symbol name. -
getFunctionSymbol
Used to get a unique name for the function, which is intern'ed. Used in hashCode() -
getFunctionIRI
URI for this function, whether custom or specification defined URI (these are keywords in the language) -
getOpName
Get the symbol name (+, ! etc) for this function -- maybe null for none
-