org.eclipse.rdf4j.model

## Interface IRI

- All Superinterfaces:
    Resource, Serializable, URI, Value
  All Known Implementing Classes:
    MemIRI, NativeIRI, SimpleIRI, URIImpl

      public interface IRI
      extends URI, Resource

  An Internationalized Resource Identifier (IRI). IRIs are an extension of the existing `URI`: while URIs are limited to a subset of the ASCII character set, IRIs may contain characters from the Universal Character Set (Unicode/ISO 10646), including Chinese or Japanese kanji, Korean, Cyrillic characters, and so forth. It is defined by RFC 3987.

  An IRI can be split into a namespace part and a local name part, which are derived from an IRI string by splitting it in two using the following algorithm:

  - Split after the first occurrence of the '#' character,
  - If this fails, split after the last occurrence of the '/' character,
  - If this fails, split after the last occurrence of the ':' character.
  The last step should never fail as every legal (full) IRI contains at least one ':' character to seperate the scheme from the rest of the IRI. The implementation should check this upon object creation.
  Author:
    Jeen Broekstra
  See Also:
    RFC 3987

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Compares a IRI object to another object.
    `String` | `getLocalName()` Gets the local name part of this IRI.
    `String` | `getNamespace()` Gets the namespace part of this IRI.
    `int` | `hashCode()` The hash code of an IRI is defined as the hash code of its String-representation: `toString().hashCode`.
    `String` | `toString()` Returns the String-representation of this IRI.

    - ### Methods inherited from interface org.eclipse.rdf4j.model.Value

      `stringValue`

- - ### Method Detail

    - #### toString

          String toString()

      Returns the String-representation of this IRI.
      Specified by:
        `toString` in interface `URI`
      Overrides:
        `toString` in class `Object`
      Returns:
        The String-representation of this IRI.

    - #### getNamespace

          String getNamespace()

      Gets the namespace part of this IRI. The namespace is defined as per the algorithm described in the class documentation.
      Specified by:
        `getNamespace` in interface `URI`
      Returns:
        The IRI's namespace.

    - #### getLocalName

          String getLocalName()

      Gets the local name part of this IRI. The local name is defined as per the algorithm described in the class documentation.
      Specified by:
        `getLocalName` in interface `URI`
      Returns:
        The IRI's local name.

    - #### equals

          boolean equals(Object o)

      Compares a IRI object to another object.
      Specified by:
        `equals` in interface `URI`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - The object to compare this IRI to.
      Returns:
        `true` if the other object is an instance of `IRI` and their String-representations are equal, `false` otherwise.

    - #### hashCode

          int hashCode()

      The hash code of an IRI is defined as the hash code of its String-representation: `toString().hashCode`.
      Specified by:
        `hashCode` in interface `URI`
      Overrides:
        `hashCode` in class `Object`
      Returns:
        A hash code for the IRI.

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.