java.lang.Object
org.apache.jena.rdf.model.impl.Util

public class Util extends Object
Some utility functions.
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • splitNamespaceXML

      public static int splitNamespaceXML(String uri)
      Given an absolute URI, determine the split point between the namespace part and the localname part. See SplitIRI.splitXML(java.lang.String) for details.
    • substituteStandardEntities

      public static String substituteStandardEntities(String s)
    • substituteEntitiesInEntityValue

      public static String substituteEntitiesInEntityValue(String s)
    • substituteEntitiesInElementContent

      public static String substituteEntitiesInElementContent(String s)
      Answer s modified to replace <, >, and & by their corresponding entity references.

      Implementation note: as a (possibly misguided) performance hack, the obvious cascade of replaceAll calls is replaced by an explicit loop that looks for all three special characters at once.

    • replace

      public static String replace(String s, String oldString, String newString)
    • isSimpleString

      public static boolean isSimpleString(Node n)
      A Node is a simple string if:
      • (RDF 1.0) No datatype and no language tag.
      • (RDF 1.1) xsd:string
    • isLangString

      public static boolean isLangString(Node n)
      A Node is a well-formed language string if it has a language tag and it does not have an initial text direction. This excludes "abc"^^rdf:langString which is not well-formed.
    • isDirLangString

      public static boolean isDirLangString(Node n)
      A Node is a well-formed directional language string if it has a language tag and it has an initial text direction.
    • hasLang

      public static boolean hasLang(Node n)
      Test whether this node has a language (rdf:langString or rdf:dirLangString)
    • hasDirection

      public static boolean hasDirection(Node n)
      Test whether this node has an initial text language (rdf:dirLangString)
    • isSimpleString

      public static boolean isSimpleString(Literal lit)
      Return true if the literal is a simple string.

      RDF 1.0 => it is a plain literal, with no language tag

      RDF 1.1 => it has datatype xsd:string

    • isLangString

      public static boolean isLangString(Literal lit)
      Return true if the literal has a language tag.
    • isDirLangString

      public static boolean isDirLangString(Literal lit)
      Return true if the literal is well-formed, has a language tag and a text direction.