JsonLdParserService
This service allows you to do operations (compact, frame...) on JSON-LD files. It heavily relies on the jsonld.js NPM package. Its particularity is that it keeps in cache the context files, to avoid refetching them at every operation.
Actions
All the methods of the jsonld.js NPM package are available as actions:
compact
expand
flatten
frame
normalize
fromRDF
toRDF
See the examples to see how to use them.
toQuads
Same as toRDF
but returns quads formatted according to the RDF.JS data model
expandTypes
Return the expanded types based on a given context.
Parameters
Property | Type | Default | Description |
---|---|---|---|
types | String or Array | required | Type(s) to expand |
context | String | Default context | Context to be parsed |
Return
An array of types