This utility generates a JSON-LD context document from a SHACL specification. Detailed documentation is available below.
The algorithm follow these steps to generate the JSON-LD context:
id
, type
and graph
to @id
, @type
and @graph
respectively.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 :
@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.)
@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