Class NodeFunctions

java.lang.Object
org.apache.jena.sparql.expr.nodevalue.NodeFunctions

public class NodeFunctions extends Object
Implementation of node-centric functions.
  • Constructor Details

    • NodeFunctions

      public NodeFunctions()
  • Method Details

    • checkAndGetStringLiteral

      public static Node checkAndGetStringLiteral(String label, NodeValue nv)
      check and get a string (may be a simple literal, literal with language tag or an XSD string).
    • checkTwoArgumentStringLiterals

      public static void checkTwoArgumentStringLiterals(String label, NodeValue arg1, NodeValue arg2)
      Check for string operations with primary first arg and second arg (e.g. CONTAINS). The arguments are not used in the same way and the check operation is not symmetric.
    • "abc"@en is compatible with "abc"
    • "abc" is NOT compatible with "abc"@en
    • sameTerm

      public static NodeValue sameTerm(NodeValue nv1, NodeValue nv2)
    • sameTerm

      public static boolean sameTerm(Node node1, Node node2)
      sameTerm(x,y)
    • rdfTermEquals

      public static boolean rdfTermEquals(Node n1, Node n2)
    • str

      public static NodeValue str(NodeValue nv)
    • str

      public static String str(Node node)
    • sortKey

      public static NodeValue sortKey(NodeValue nv, String collation)
    • datatype

      public static NodeValue datatype(NodeValue nv)
    • datatype

      public static Node datatype(Node node)
    • lang

      public static NodeValue lang(NodeValue nv)
    • lang

      public static String lang(Node node)
    • langMatches

      public static NodeValue langMatches(NodeValue nv, NodeValue nvPattern)
      LANGMATCHES
      Parameters:
      nv - The language string
      nvPattern - The pattern to match against
      Returns:
      Boolean nodeValue
    • langMatches

      public static NodeValue langMatches(NodeValue nv, String langPattern)
      LANGMATCHES
      Parameters:
      nv - The language string
      langPattern - The pattern to match against
      Returns:
      Boolean nodeValue
    • langMatches

      public static boolean langMatches(String langStr, String langPattern)
      The algorithm for the SPARQL function "LANGMATCHES". Matching in SPARQL is defined to be the language tag matching of RFC 4647, part of BCP 47.

      SPARQL uses basic matching which is single "*" or a prefix of subtags.

      This code does not implement extended matching correctly.

      Parameters:
      langStr - The language string
      langPattern - The pattern to match against
      Returns:
      Whether there is a match.
    • isIRI

      public static NodeValue isIRI(NodeValue nv)
    • isIRI

      public static boolean isIRI(Node node)
    • isURI

      public static NodeValue isURI(NodeValue nv)
    • isURI

      public static boolean isURI(Node node)
    • isBlank

      public static NodeValue isBlank(NodeValue nv)
    • isBlank

      public static boolean isBlank(Node node)
    • isLiteral

      public static NodeValue isLiteral(NodeValue nv)
    • isLiteral

      public static boolean isLiteral(Node node)
    • iri

      public static NodeValue iri(NodeValue nv, String baseIRI)
      NodeValue to NodeValue, skolemizing, and converting strings to URIs.
    • iri

      public static Node iri(Node n, String baseIRI)
      Node to Node, skolemizing, and converting strings to URIs.
    • struuid

      public static NodeValue struuid()
    • uuid

      public static NodeValue uuid()
    • strDatatype

      public static NodeValue strDatatype(NodeValue v1, NodeValue v2)
    • strLang

      public static NodeValue strLang(NodeValue v1, NodeValue v2)
    • duration

      public static Duration duration(int seconds)
      A duration, tided