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.NodeasNode()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 Idcreate()Create a freshId, based on a UUID.booleanstatic IdfromBytes(byte[] bytes) Create aId, according to byte.static IdfromNode(org.apache.jena.graph.Node node) Convert aNodeto anId.static IdfromString(String str) static IdfromStringOrNull(String str) static IdinthashCode()booleanisNil()static intLength in chars of a UUID string, without any scheme infostatic booleanQuick test of whether a string looks like an UUID or notstatic IdnullId()static IdCreate an Id from a UUID string, return a default if the UUID string does not parse correctly.static UUIDParse a UUID string, return a default if it does not parse correctlystatic StringshortUUIDstr(UUID uuid) static Stringstr(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. eg "ds:abcdef"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 aNodeto anId. TheNodecan be a URI or a string literal. The preferred form is a<uuid:...>.An argument of
nullreturnsnull.- 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
-