JSON.LD.Compaction (JSON-LD.ex v1.0.0)
View SourceImplementation of the JSON-LD 1.1 Compaction Algorithms.
Summary
Functions
@spec compact_iri( any(), JSON.LD.Context.t(), JSON.LD.Options.t(), any() | nil, boolean(), boolean() ) :: any() | nil
IRI Compaction
@spec compact_value(any(), JSON.LD.Context.t(), String.t(), JSON.LD.Options.t()) :: any()
Value Compaction
Details at https://www.w3.org/TR/json-ld-api/#value-compaction
@spec select_term(JSON.LD.Context.t(), String.t(), [String.t()], String.t(), [ String.t() ]) :: String.t() | nil
Term Selection
Note: Other than specified in W3C spec we assume here that the inverse context is already created, since we don't want to return an updated context. Effectively an inverse context is never needed in the only place where this function is used.