Class AlgRelativizeIRI

java.lang.Object
org.apache.jena.rfc3986.AlgRelativizeIRI

public class AlgRelativizeIRI extends Object
More algorithms on IRI3986's. The various forms of relativizing IRIs.
  • Constructor Details

    • AlgRelativizeIRI

      public AlgRelativizeIRI()
  • Method Details

    • relativeScheme

      public static IRI3986 relativeScheme(IRI base, IRI target)
      Calculate a "same scheme" relative URI, if possible.

      The IRIs have the same scheme.
      The relative URI is the "//" part onwards of the target.

    • relativeResource

      public static IRI3986 relativeResource(IRI base, IRI target)
      Calculate a relative URI as a same-place (scheme, authority) resource, if possible.

      The IRIs have the same scheme and authority.
      The base does not have a query string.
      The relative URI is the path, query and fragment of the target.

    • relativeAbsolutePath

      public static IRI3986 relativeAbsolutePath(IRI base, IRI target)
      Calculate a relative URI as a absolute path, if possible.

      That is, the IRIs have the same scheme and authority. The base does not have a query string. The relative URI is the path, query and fragment of the target.

    • relativeSameDocument

      public static IRI3986 relativeSameDocument(IRI base, IRI target)
      Calculate a "same document" relative URI, if possible.

      That is, the IRIs refer to the same document (same scheme, authority, path and query string) and the relative URI is the fragment of the target if it has one.

      The base must have a scheme and not have a query string.

      Return null if the target does not have a fragment.

    • relativePath

      public static IRI3986 relativePath(IRI base, IRI target)
      Calculate a relative URI as a relative child path of the base.

      The base must have scheme.
      The IRIs have the same scheme and authority.
      The base has a path which is a prefix of the target.
      The relative URI is the remainder of the path, query and fragment of the target.
      The relative path may be "" leading to "?query#frag" or "#frag" The relative path does go up: it does not start with "..". See relativeParentPath(IRI, IRI).

    • relativeParentPath

      public static IRI3986 relativeParentPath(IRI base, IRI target)