Générer un JSON-LD

This utility generates a JSON-LD context document from a SHACL specification. Detailed documentation is available below.


Remove Select file Change
You can select multiple files. Supported extensions : .rdf, .ttl, .n3, .trig. Other extensions will be treated as RDF/XML
URL of an RDF file. Same extensions as file upload are supported.
Supported syntaxes : Turtle, RDF/XML, JSON-LD, TriG, TriX, N-Quads. We recommend Turtle.


JSON-LD context document generation algorithm

The algorithm follow these steps to generate the JSON-LD context:

  1. Always add a mapping from id, type and graph to @id, @type and @graph respectively.
  2. Add prefix mappings for each known prefixes in the SHACL file.
  3. Add mappings with the URI of NodeShapes in the SHACL, using the local part of the URI as JSON key.
  4. Add mappings with the URI of properties referred to in sh:path in the SHACL. SHACL property paths are not supported. By default, the local part of the property URI is used as key, but a different JSON key can be specified by annotating the property shape with the property https://shacl-play.sparna.fr/ontology#shortname (if the same property is referred to by multiple property shapes annotated with different shortname, the first one is used). Then :
    1. Determine the @type from datatypes : read the sh:datatype on property shapes referring to the property. If there is one, use it as the value of @type (if the same property is referred to by multiple property shapes with different sh:datatype, the first one is used.)
    2. Determine the @type from URI reference : if there are sh:class, sh:node, or if sh:nodeKind = sh:IRI or sh:BlankNodeOrIRI, set the @type to @id