Skip to main content

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
PropertyTypeDefaultDescription
typesString or ArrayrequiredType(s) to expand
contextStringDefault contextContext to be parsed
Return

An array of types