Class IdentifierUtils

java.lang.Object
cz.cvut.kbss.ontodriver.util.IdentifierUtils

public class IdentifierUtils extends Object
Utility for working with resource identifiers.
  • Field Details

    • IDENTIFIER_TYPES

      public static final Set<Class<?>> IDENTIFIER_TYPES
  • Method Details

    • generateIdentifier

      public static URI generateIdentifier(URI classUri)
      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

      public static boolean isResourceIdentifierType(Class<?> cls)
      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: