java.lang.Object
org.apache.jena.rdfpatch.system.Id

public final class Id extends Object
An identifier. When encoded, the Id can be a URI or string literal. The preferred form is a <uuid:...>.
  • <uuid:...>
  • <urn:uuid:...>
  • "id:..."
  • "..."
where ... is a UUID as a string.

If anything else is encountered, the lexical form or URI string is used.

  • Method Details

    • lenStrUUID

      public static int lenStrUUID()
      Length in chars of a UUID string, without any scheme info
    • maybeUUID

      public static boolean maybeUUID(String str)
      Quick test of whether a string looks like an UUID or not
    • nullId

      public static Id nullId()
    • create

      public static Id create()
      Create a fresh Id, based on a UUID.
    • fromBytes

      public static Id fromBytes(byte[] bytes)
      Create a Id, according to byte.
      See Also:
    • str

      public static String str(org.apache.jena.graph.Node node)
      Convenience operation to make a displayable string from a Node, that has been used for an Id.
    • fromNode

      public static Id fromNode(org.apache.jena.graph.Node node)
      Convert a Node to an Id. The Node can be a URI or a string literal. The preferred form is a <uuid:...>.

      An argument of null returns null.

      Parameters:
      node -
      Returns:
      Id
    • fromUUID

      public static Id fromUUID(UUID uuid)
    • fromStringOrNull

      public static Id fromStringOrNull(String str)
    • fromString

      public static Id fromString(String str)
    • parseUUID

      public static UUID parseUUID(String patchStr, UUID dft)
      Parse a UUID string, return a default if it does not parse correctly
    • parseId

      public static Id parseId(String uuidStr, Id dft)
      Create an Id from a UUID string, return a default if the UUID string does not parse correctly.
    • isNil

      public boolean isNil()
    • asParam

      public String asParam()
      Suitable for putting into an HTTP request query string.
    • asBytes

      public byte[] asBytes()
      Encode as bytes (network order, 16 byte number).
      See Also:
    • asPlainString

      public String asPlainString()
      Without any adornment
    • asString

      public String asString()
      With "schema"
    • asNode

      public org.apache.jena.graph.Node asNode()
      Convert to a Node, as a URI or as a plain string.
    • toString

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

      public String toSchemeString(String scheme)
      For labelling with the type of thing id'ed. eg "ds:abcdef"
    • shortUUIDstr

      public static String shortUUIDstr(UUID uuid)
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object