Package cz.cvut.kbss.ontodriver.util
Class IdentifierUtils
java.lang.Object
cz.cvut.kbss.ontodriver.util.IdentifierUtils
Utility for working with resource identifiers.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic URI
generateIdentifier
(URI classUri) Generates a (pseudo) random identifier based on the specified class URI.static boolean
isResourceIdentifierType
(Class<?> cls) Checks if the specified class represents a resource identifier.static int
Generates a (pseudo) random integer.
-
Field Details
-
IDENTIFIER_TYPES
-
-
Method Details
-
generateIdentifier
Generates a (pseudo) random identifier based on the specified class URI.The identifier consists of the class URI and then contains the string 'instance' and a random integer to ensure uniqueness. The 'instance' part is appended after a slash or a _, if the class URI contains a hash fragment.
- Parameters:
classUri
- Class URI used as identifier base- Returns:
- Generated identifier
-
randomInt
public static int randomInt()Generates a (pseudo) random integer.- Returns:
- Generated integer
-
isResourceIdentifierType
Checks if the specified class represents a resource identifier.- Parameters:
cls
- Class to check- Returns:
true
if instances of the specified class represent resource identifiers,false
otherwise- See Also:
-