java.lang.Object
org.apache.jena.rdfpatch.system.Id
An identifier. When encoded, the
Id
can be a URI or string literal.
The preferred form is a <uuid:...>
.
<uuid:...>
<urn:uuid:...>
"id:..."
"..."
...
is a UUID as a string.
If anything else is encountered, the lexical form or URI string is used.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
asBytes()
Encode as bytes (network order, 16 byte number).org.apache.jena.graph.Node
asNode()
Convert to a Node, as a URI or as a plain string.asParam()
Suitable for putting into an HTTP request query string.Without any adornmentasString()
With "schema"static Id
create()
Create a freshId
, based on a UUID.boolean
static Id
fromBytes
(byte[] bytes) Create aId
, according to byte.static Id
fromNode
(org.apache.jena.graph.Node node) Convert aNode
to anId
.static Id
fromString
(String str) static Id
fromStringOrNull
(String str) static Id
int
hashCode()
boolean
isNil()
static int
Length in chars of a UUID string, without any scheme infostatic boolean
Quick test of whether a string looks like an UUID or notstatic Id
nullId()
static Id
Create an Id from a UUID string, return a default if the UUID string does not parse correctly.static UUID
Parse a UUID string, return a default if it does not parse correctlystatic String
shortUUIDstr
(UUID uuid) 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.toSchemeString
(String scheme) For labelling with the type of thing id'ed.toString()
-
Method Details
-
lenStrUUID
public static int lenStrUUID()Length in chars of a UUID string, without any scheme info -
maybeUUID
Quick test of whether a string looks like an UUID or not -
nullId
-
create
Create a freshId
, based on a UUID. -
fromBytes
Create aId
, according to byte.- See Also:
-
str
Convenience operation to make a displayable string from a Node, that has been used for an Id. -
fromNode
Convert aNode
to anId
. TheNode
can be a URI or a string literal. The preferred form is a<uuid:...>
.An argument of
null
returnsnull
.- Parameters:
node
-- Returns:
- Id
-
fromUUID
-
fromStringOrNull
-
fromString
-
parseUUID
Parse a UUID string, return a default if it does not parse correctly -
parseId
Create an Id from a UUID string, return a default if the UUID string does not parse correctly. -
isNil
public boolean isNil() -
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
Without any adornment -
asString
With "schema" -
asNode
public org.apache.jena.graph.Node asNode()Convert to a Node, as a URI or as a plain string. -
toString
-
toSchemeString
For labelling with the type of thing id'ed. eg "ds:abcdef" -
shortUUIDstr
-
hashCode
public int hashCode() -
equals
-