Class IdentifierUtil

java.lang.Object
cz.cvut.kbss.jsonld.common.IdentifierUtil

public class IdentifierUtil extends Object
Allows to generate blank nodes for identifier-less instances.

Although objects in JSON-LD are not required to have id, some tools may have issues processing such data. In addition, multiple references to the same instance cannot be created when serializing the JSON-LD, as there is no identifier to reference.

  • Field Details

  • Constructor Details

    • IdentifierUtil

      public IdentifierUtil()
  • Method Details

    • generateBlankNodeId

      public static String generateBlankNodeId()
      Generates a (pseudo)random blank node identifier.
      Returns:
      Blank node identifier
    • isCompactIri

      public static boolean isCompactIri(String value)
      Checks whether the specified value is a compact IRI, as defined by the JSON-LD specification par. 4.1.5.
      Parameters:
      value - The value to examine
      Returns:
      true if the specified value is a compact IRI, false otherwise