JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q38334F
  • License MIT

Generate SHACL shapes and vocabularies from Mermaid class diagrams.

Package Exports

  • merweb
  • merweb/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (merweb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🕸 Merweb

Merweb (Mermaid meets Semantic Web) is library and command line interface to generate SHACL shapes and vocabularies from Mermaid class diagrams.

Usage

  • Install via npm i -g merweb.
  • Execute tool via merweb -f path/to/diagram -s path/to/jsonld. You can try
merweb -f examples/diagram.txt \
  -s shapes.jsonld \
  -b "sc=https://w3id.org/idlab/ns/supply-chain/#" \
  -v "sc=https://w3id.org/idlab/ns/supply-chain/#" \
  -c vocab.jsonld

Examples

You can find example diagrams in the folder examples.

Annotations

Memweb reuses one existing Mermaid annotation and uses five new annotations to generate the correct shapes and vocabularies from the class diagrams. Below you can find a table of these annotations.

Annotation Description Shape Vocabulary Existing or new annotation
@type The type of as class Object of sh:targetNode A rdfs:Class New
@extraTypes The extra types of as class Object of sh:property with rdf:type as sh:path A rdfs:Class New
@label The label of a class or property N/A Object of rdfs:label New
@comment The comment of a class or property N/A Object of rdfs:comment New
Cardinality on a class attribute The cardinality of datatype property Objects of sh:minCount and sh:maxCount N/A New
Cardinality on a relationship between two classes The cardinality of object property Objects of sh:minCount and sh:maxCount N/A Existing

Remove annotations from diagrams

You can remove the annotations starting with @ from diagrams via the -r, --remove-annotations option. The changed diagram is outputted to the terminal.

merweb -f examples/diagram.txt -r

License

This code is copyrighted by Ghent University – imec and released under the MIT license.