java.lang.Object
org.odpi.openmetadata.frameworks.integration.dcat.jsonld.JsonLdReader

public class JsonLdReader extends Object
JsonLdReader reads a JSON-LD document into a graph of nodes whose types and properties are identified by full IRIs. It covers the parts of JSON-LD that are used to describe data catalogs: embedded contexts (prefixes, term definitions, keyword aliases, default vocabulary, base IRI and default language), nested node objects, value objects, language maps, lists, sets, graphs and reverse properties.

The reader is deliberately lenient and never retrieves anything from the network. If a document refers to a context by its location, the reader carries on using the standard prefixes and term names of the DCAT vocabulary, and the common "id" and "type" aliases, so that documents that rely on a published DCAT context can still be understood.

  • Method Details

    • read

      public static JsonLdGraph read(String document) throws IOException
      Read a JSON-LD document.
      Parameters:
      document - JSON-LD document
      Returns:
      graph of the nodes described in the document
      Throws:
      IOException - the document is not valid JSON or is not a JSON object or array