Class NodeID

java.lang.Object
org.semanticweb.owlapi.model.NodeID
All Implemented Interfaces:
Serializable, Comparable<NodeID>

public final class NodeID extends Object implements Comparable<NodeID>, Serializable
Represents the Node ID for anonymous individuals.
Since:
3.0.0
Author:
Matthew Horridge, The University of Manchester, Information Management Group
See Also:
  • Method Details

    • nodeString

      public static String nodeString(int id)
      Parameters:
      id - the node id
      Returns:
      string version of id
    • nodeId

      public static IRI nodeId(Integer id)
      Parameters:
      id - id
      Returns:
      IRI with full node id
    • getIRIFromNodeID

      public static String getIRIFromNodeID(String nodeID)
      Returns an absolute IRI from a nodeID attribute.
      Parameters:
      nodeID - the node id
      Returns:
      absolute IRI
    • nextAnonymousIRI

      public static String nextAnonymousIRI()
      Generates next anonymous IRI.
      Returns:
      absolute IRI
    • nextFreshNodeId

      public static IRI nextFreshNodeId()
      Returns:
      IRI with fresh node id
    • isAnonymousNodeIRI

      public static boolean isAnonymousNodeIRI(@Nullable String iri)
      Tests whether supplied IRI was generated by this parser in order to label an anonymous node.
      Parameters:
      iri - the IRI
      Returns:
      true if the IRI was generated by this parser to label an anonymous node
    • isAnonymousNodeIRI

      public static boolean isAnonymousNodeIRI(@Nullable IRI iri)
      Tests whether supplied IRI was generated by this parser in order to label an anonymous node.
      Parameters:
      iri - the IRI
      Returns:
      true if the IRI was generated by this parser to label an anonymous node
    • isAnonymousNodeID

      public static boolean isAnonymousNodeID(@Nullable String iri)
      Parameters:
      iri - the iri or node id
      Returns:
      true if the iri is an anonymous label
    • getNodeID

      public static NodeID getNodeID(@Nullable String id)
      Gets a NodeID with a specific identifier string.
      Parameters:
      id - The String that identifies the node. If the String doesn't start with "_:" then this will be concatenated to the front of the specified id String; if the string is empty or null, an autogenerated id will be used.
      Returns:
      A NodeID
    • getNodeID

      public static NodeID getNodeID()
      Returns:
      get a new node id with an autogenerated, sequential id
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(@Nullable NodeID o)
      Specified by:
      compareTo in interface Comparable<NodeID>
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getID

      public String getID()
      Gets the string representation of the node ID. This will begin with _:
      Returns:
      The string representation of the node ID.
    • stripArtifacts

      public static String stripArtifacts(CharSequence resource)
      Parameters:
      resource - nodeid IRI to strip of prefixes
      Returns:
      id string compatible with RDF/XML