Class E_IRI2

All Implemented Interfaces:
Direct Known Subclasses:

public class E_IRI2 extends ExprFunction2
IRI(base, expr). Two argument SPARQL extension. The function URI(base, expr) is the same, but under a different name as a subclass.

As an ARQ extension, IRI(base, relative) resolves the relative URI (string or IRI) against the result of the "base" expression, which in turn is resolved as per the one-argument form.

  • Constructor Details

    • E_IRI2

      public E_IRI2(Expr baseExpr, String parserBaseURI, Expr relExpr)
  • Method Details

    • eval

      public NodeValue eval(NodeValue v1, NodeValue v2, FunctionEnv env)
      eval in class ExprFunction2
    • copy

      public Expr copy(Expr expr1, Expr expr2)
      Specified by:
      copy in class ExprFunction2
    • eval

      public NodeValue eval(NodeValue v1, NodeValue v2)
      Specified by:
      eval in class ExprFunction2
    • getFunctionPrintName

      public String getFunctionPrintName(SerializationContext cxt)
      Description copied from class: ExprFunction
      Name used for output in SPARQL format needing functional form (no specific keyword). e.g. regexp(), custom functions, ...
      getFunctionPrintName in class ExprFunction
    • getParserBase

      public String getParserBase()
      Get the parser base - the base URI a a string at the point in parsing when this object was created. If there is an explicit base expression (2 argument form), the parse base is used to make the base expression absolute.

      This may be null - the object may not have been created by the parser.

    • getRelExpr

      public Expr getRelExpr()
      Expression for the relative URI. This is the argument to the one-argument form or the second argument for the two-argument form.
    • getBaseExpr

      public Expr getBaseExpr()
    • 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 algebra).

      Hence, different hashCode => not equalsBySyntax.

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

      public boolean equals(Expr obj, boolean bySyntax)
      Description copied from interface: Expr
      General equality operation - consider this to be 'protected'
      Specified by:
      equals in interface Expr
      equals in class ExprFunction