Class IRIs

java.lang.Object
org.apache.jena.irix.IRIs

public class IRIs extends Object
Operations in support of IRIx.
  • Constructor Details

    • IRIs

      public IRIs()
  • Method Details

    • reference

      public static IRIx reference(String iriStr)
      Operation to take a string and make an IRIx. This operation does not resolve the string against a base.

      Use this function if the application has been given an URI and wants to be sure it is valid for use in RDF.

      Use resolve(java.lang.String) to resolve a potentially relative URI against the current system base.

    • check

      public static boolean check(String iriStr)
      Check a string is valid syntax for an IRI (absolute or relative)
    • checkEx

      public static String checkEx(String iriStr)
      Check a string is valid syntax for an IRI, is an absolute IRI (resolve if necessary) and normalize (e.g. remove "./.." and "/../").
    • getSystemBase

      public static IRIx getSystemBase()
      The system base IRIx.
    • getBaseStr

      public static String getBaseStr()
      The system base IRI as a string.
    • toBase

      public static String toBase(String uriForBase)
      Given a candidate baseURI string, which may be a filename, turn it into a IRI suitable as a base IRI. This includes encoding characters in a filename (e.g. spaces).
    • stdResolver

      public static IRIxResolver stdResolver()
      Return a general purpose resolver, with the current system base as its base IRI.
    • resolver

      public static IRIxResolver resolver(String base)
      Return a general purpose resolver, with the current system base as its base IRI.
    • resolver

      public static IRIxResolver resolver(IRIx base)
      Return a general purpose resolver, with the supplied IRI its base.
    • absoluteResolver

      public static IRIxResolver absoluteResolver()
      Return a resolver that does not resolve, and have a base and does not allow relative URIs.
    • relativeResolver

      public static IRIxResolver relativeResolver()
      Return a resolver that does not resolve relative URIs, with the current system base as its base IRI
    • resolve

      public static String resolve(String iriStr)
      Resolve a URI against the system base.
    • resolveIRI

      public static IRIx resolveIRI(String iriStr)
      Resolve a URI against the system base.
    • resolve

      public static String resolve(IRIx base, String iriStr)
      Resolve a URI against a base.
    • resolve

      public static String resolve(IRIx base, IRIx iri)
      Resolve a URI against a base.
    • resolve

      public static String resolve(String baseStr, String iriStr)
      Resolve a URI against a base. The base must be an absolute IRI.
    • scheme

      public static String scheme(String str)
      Get the URI scheme at the start of the string. This is the substring up to, and excluding, the first ":" if it conforms to the syntax requirements. Return null if it does not look like a scheme.

      The RFC 3986 URI grammar defines scheme as:

       URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
       scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
       ...