Class 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.
    • 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: Expr
        Answer whether this is a function.
        Specified by:
        isFunction in interface Expr
        Overrides:
        isFunction in class ExprNode
      • 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 and EXISTS 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 and equals 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 implies equals (by alegbra).

        Hence, different hashCode => not equalsBySyntax.

        Specified by:
        hashCode in interface Expr
        Specified by:
        hashCode in class ExprNode
      • equals

        public boolean equals​(Expr other,
                              boolean bySyntax)
        Description copied from interface: Expr
        General equality operation - consider this to be 'protected'
        Specified by:
        equals in interface Expr
        Specified by:
        equals in class ExprNode
      • 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