Class SimpleIRI

java.lang.Object
org.eclipse.rdf4j.model.base.AbstractIRI
org.eclipse.rdf4j.model.impl.SimpleIRI
All Implemented Interfaces:
Serializable, IRI, Resource, Value
Direct Known Subclasses:
LmdbIRI, NativeIRI

public class SimpleIRI extends AbstractIRI
The default implementation of the IRI interface.
See Also:
  • Constructor Details

    • SimpleIRI

      protected SimpleIRI()
      Creates a new, un-initialized IRI. This IRI's string value needs to be set before the normal methods can be used.
    • SimpleIRI

      protected SimpleIRI(String iriString)
      Creates a new IRI from the supplied string.

      Note that creating SimpleIRI objects directly via this constructor is not the recommended approach. Instead, use a ValueFactory (obtained from your repository or by using SimpleValueFactory.getInstance()) to create new IRI objects.

      Parameters:
      iriString - A String representing a valid, absolute IRI. May not be null.
      Throws:
      IllegalArgumentException - If the supplied IRI is not a valid (absolute) IRI.
      See Also:
    • SimpleIRI

      protected SimpleIRI(String namespace, String localname)
  • Method Details

    • setIRIString

      protected void setIRIString(String namespace, String localname)
    • setIRIString

      protected void setIRIString(String iriString)
    • stringValue

      public String stringValue()
      Description copied from interface: Value
      Returns the String-value of a Value object. This returns either a Literal's label, a IRI's URI or a BNode's ID.
      Specified by:
      stringValue in interface Value
      Overrides:
      stringValue in class AbstractIRI
    • getNamespace

      public String getNamespace()
      Description copied from interface: IRI
      Gets the namespace part of this IRI.

      The namespace is defined as per the algorithm described in the class documentation.

      Returns:
      the namespace of this IRI
    • getLocalName

      public String getLocalName()
      Description copied from interface: IRI
      Gets the local name part of this IRI.

      The local name is defined as per the algorithm described in the class documentation.

      Returns:
      the local name of this IRI