Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
JSON-LD API.
Only minimum functions to communicate with JSON-LD are implemented, i.e. context processing, expansion, deserialization and serialization.
Use of JSON-LD should be avoided when possible.
val init_ctx : Iri.t -> Expand.ctx
Initialize an expansion context from the given base IRI.
val ctx_of_options : T.options -> Iri.t -> Expand.ctx Lwt.t
expansion options context json base
expands the given json
value in context
, with base
IRI, honouring options
. Optional argument frame_expansion
is supposed to work as specified here (default is false).
val to_rdf : T.options -> J.json -> Rdf.Graph.graph -> Rdf.Ds.dataset Lwt.t
to_rdf options json graph
builds a context from options
, expands the json
value (using graph
name as base IRI), then applies the node map generation and JSON-LD to RDF algorithms to build the returned dataset. The provided graph
is the default graph of the returned dataset.
val from_rdf : T.options -> Rdf.Ds.dataset -> J.json
from_rdf options dataset
serializes the given dataset
to a JSON-LD value, honouring options
. Beware that the specified RDF to JSON-LD algorithm is not implemented, but a simpler version returning some flat (but correct) JSON-LD.