Class IRIProvider3986.IRIx3986

java.lang.Object
org.apache.jena.irix.IRIx
org.apache.jena.iri3986.provider.IRIProvider3986.IRIx3986
Enclosing class:
IRIProvider3986

public static class IRIProvider3986.IRIx3986 extends IRIx
  • Method Details

    • isAbsolute

      public boolean isAbsolute()
      Description copied from class: IRIx
      An absolute URI is one with a URI scheme and without a fragment. The other components, host (authority), path, and query, are optional.

      absolute-URI = scheme ":" hier-part [ "?" query ]

      Beware of the meaning : http:abc is an absolute URI - it has only a schema and a path without a root.

      Note that a URI can be both "not absolute" and "not relative", e.g. http://example/path#fragment.

      Beware that RFC 2396 section 3.1 has a different definition, where the scheme is required but a fragment may be present.

      See IRIx.isReference() for testing whether a URI is suitable for use in RDF.

      Specified by:
      isAbsolute in class IRIx
    • isRelative

      public boolean isRelative()
      Description copied from class: IRIx
      A relative URI is one without a scheme, and maybe without some of the other parts.

      Often it is just the path part.

      See IRIx.isReference() for testing whether a URI is suitable for use in RDF.

      Note that a URI can be both "not absolute" and "not relative", e.g. http://example/path#fragment.

      Specified by:
      isRelative in class IRIx
    • isReference

      public boolean isReference()
      Description copied from class: IRIx
      An RDF Reference IRI, defined in RDF 1.2 Concepts section 3.3.1 RDF Reference IRIs, is an URI (IRI) that is suitable for use as a resource identifier.

      The terminology is not defined in RFC 3986 and it is not the same as "absolute URI".

      In RDF data, it must be legal syntax and should follow the rules of the IRI scheme.

      Examples:

      • http://www.w3.org/
      • http://www.w3.org/1999/02/22-rdf-syntax-ns#type
      • urn:abc:def
      • urn:abc:def#frag
      but not
      • http:abc -- no host authority; HTTP is a hierarchical URI scheme
      • http:// -- the http(s) URI scheme requires the host to be not empty if there is an authority component.

      In practical terms:

      • It has a scheme name.
      • It does not have user info ("user:password@")
      • It can have a fragment.
      • If it is an HTTP URI:
        • It has a host authority, that is, a "//" section
        • It should have a path (starting "/" after the host authority) but this is not required.
      • If it is a URN (RFC8141), which is a "rootless URI" with no "//" part:

      The operation isReference reflects common usage in data published on the web. It only checks for basic schema errors. It is not a complete analysis of RDF Reference IRI. See IRIx.handleViolations(java.util.function.BiConsumer<java.lang.Boolean, java.lang.String>) for more detailed information of scheme errors and warnings.

      Specified by:
      isReference in class IRIx
    • hasScheme

      public boolean hasScheme(String scheme)
      Description copied from class: IRIx
      Test whether the IRI has the given scheme name.

      The scheme name should be lowercase.

      Specified by:
      hasScheme in class IRIx
    • scheme

      public String scheme()
      Description copied from class: IRIx
      Return the IRI scheme, if known.

      Returns null for "no scheme" (relative IRI).

      Specified by:
      scheme in class IRIx
    • resolve

      public IRIx resolve(String other)
      Description copied from class: IRIx
      Try to resolve a string against this IRI as base. This call is "base.resolver(possibleRelativeIRI)". Throw IRIException if the string does not conform to the IRI grammar.
      Specified by:
      resolve in class IRIx
    • resolve

      public IRIx resolve(IRIx other)
      Description copied from class: IRIx
      Try to resolve a string against this IRI as base. Throw IRIException if the string does not conform to the IRI grammar. Return the original IRIx if there is no change.
      Specified by:
      resolve in class IRIx
    • normalize

      public IRIx normalize()
      Description copied from class: IRIx
      Specified by:
      normalize in class IRIx
    • relativize

      public IRIx relativize(IRIx other)
      Description copied from class: IRIx
      Return (if possible), an IRI that is relative to the base argument. If this IRI is a relative path, this is returned unchanged.

      The base ("this" object) must have a scheme, have no fragment and no query string. Only the path name is made relative.

      If no relative IRI can be found, return null.

      Specified by:
      relativize in class IRIx
    • getImpl

      public org.apache.jena.rfc3986.IRI3986 getImpl()
      Description copied from class: IRIx
      Return the implementation object of the provider. The class of the object depends on the provider.
      Specified by:
      getImpl in class IRIx
    • hasViolations

      public boolean hasViolations()
      Return true if there are no "ignore items".
      Specified by:
      hasViolations in class IRIx
    • handleViolations

      public void handleViolations(BiConsumer<Boolean,String> handler)
      Description copied from class: IRIx
      Handle violations by sending a boolean, indicating whether this is an error (true) or a warning (false), and string message to a handler.
      Specified by:
      handleViolations in class IRIx
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class IRIx
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in class IRIx