Package org.apache.jena.sparql.expr
Class ExprFunction
- 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
public abstract class ExprFunction extends ExprNode
A function in the expression hierarchy. Everything that is evaluable (i.e. not NodeValue, NodeVar) is a function). It is useful to distinguish between values, vars and functions. 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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Expr other, boolean bySyntax)General equality operation - consider this to be 'protected'abstract ExprgetArg(int i)java.util.List<Expr>getArgs()ExprFunctiongetFunction()Get the function (returns null if not a function)java.lang.StringgetFunctionIRI()URI for this function, whether custom or specification defined URI (these are keywords in the language)java.lang.StringgetFunctionName(SerializationContext cxt)Name used in a functional form (i.e.java.lang.StringgetFunctionPrintName(SerializationContext cxt)Name used for output in SPARQL format needing functional form (no specific keyword).FunctionLabelgetFunctionSymbol()Used to get a unique name for the function, which is intern'ed.java.lang.StringgetOpName()Get the symbol name (+, ! etc) for this function -- maybe null for noneinthashCode()Exprare used in both syntax and algebra.booleanisFunction()Answer 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 Detail
-
getArg
public abstract Expr getArg(int i)
-
numArgs
public abstract int numArgs()
-
getArgs
public java.util.List<Expr> getArgs()
-
isFunction
public boolean isFunction()
Description copied from interface:ExprAnswer whether this is a function.- Specified by:
isFunctionin interfaceExpr- Overrides:
isFunctionin classExprNode
-
getFunction
public ExprFunction 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 alegbra).Hence, different
hashCode=> notequalsBySyntax.
-
equals
public boolean equals(Expr other, boolean bySyntax)
Description copied from interface:ExprGeneral equality operation - consider this to be 'protected'
-
getFunctionPrintName
public java.lang.String getFunctionPrintName(SerializationContext cxt)
Name used for output in SPARQL format needing functional form (no specific keyword). e.g. regexp(), custom functions, ...
-
getFunctionName
public java.lang.String getFunctionName(SerializationContext cxt)
Name used in a functional form (i.e. SPARQL algebra). getOpName() is used in preference as a short, symbol name.
-
getFunctionSymbol
public FunctionLabel getFunctionSymbol()
Used to get a unique name for the function, which is intern'ed. Used in hashCode()
-
getFunctionIRI
public java.lang.String getFunctionIRI()
URI for this function, whether custom or specification defined URI (these are keywords in the language)
-
getOpName
public java.lang.String getOpName()
Get the symbol name (+, ! etc) for this function -- maybe null for none
-
-