JSON-LD context vs. prefixes in Jena

The JSON-LD spec has an example showing a @context node being used to define the @type of a value.

In Jena, it seems a @context may be derived from a PrefixMap or specified by a JsonLDWriteContext (which has overloaded setters for a Java Object and a JSON string).

Can this example be achieved in Jena using the map approach or does it require the context object? Is there a Java Object that can be passed to create the JsonLDWriteContext in this example, or does a JSON string need to be parsed?

In other words, does Jena have any mechanism of deriving such a context without having the JSON explicitly provided?

{
  "@context":
  {
    "modified":
    {
      "@id": "http://purl.org/dc/terms/modified",
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
    }
  },
...
  "@id": "http://example.com/docs/1",
  "modified": "2010-05-29T14:17:39+02:00",
...
}

1 answer