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 TypeMethodDescriptionbooleanGeneral equality operation - consider this to be 'protected'abstract ExprgetArg(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 the SPARQL algebra.Name used for output in SPARQL format needing functional syntax: name(arg1, arg2, ...)Used to get a unique name for the function, which is intern'ed.Get the operator symbol name (+, !inthashCode()Exprare used in both syntax and algebra.booleanAnswer whether this is a function.abstract intnumArgs()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:ExprAnswer whether this is a function.- Specified by:
isFunctionin interfaceExpr- Overrides:
isFunctionin classExprNode
-
getFunction
Description copied from interface:ExprGet the function (returns null if not a function)- Specified by:
getFunctionin interfaceExpr- Overrides:
getFunctionin classExprNode
-
hashCode
public 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 algebra).Hence, different
hashCode=> notequalsBySyntax. -
equals
Description copied from interface:ExprGeneral equality operation - consider this to be 'protected' -
getFunctionPrintName
Name used for output in SPARQL format needing functional syntax: name(arg1, arg2, ...) e.g. regexp(), custom functions, ... -
getFunctionName
Name used in the SPARQL algebra. See alsogetOpName()for an operator form. -
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 operator symbol name (+, ! etc) for this function -- maybe null for none
-