Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

merweb

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merweb

Generate SHACL shapes and vocabularies from Mermaid class diagrams.

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

🕸 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/#" \
  -p "swrl=http://www.w3.org/2003/11/swrl#;owl=http://www.w3.org/2002/07/owl#" \
  -c vocab.jsonld

or

merweb -f examples/diagram_with_supertypes.txt \
  -s shapes.jsonld \
  -b "ex=https://example.org/examples#" \
  -v "ex=https://example.org/examples#" \
  -p "swrl=http://www.w3.org/2003/11/swrl#;owl=http://www.w3.org/2002/07/owl#" \
  -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.

AnnotationDescriptionShapeVocabularyExisting or new annotation
@typeThe type of a classObject of sh:targetNodeA rdfs:ClassNew
@superTypesThe super-types of a classN/AObject(s) of rdfs:subClassOfNew
@extraTypesThe extra types of a classObject of sh:property with rdf:type as sh:pathA rdfs:ClassNew
@labelThe label of a class or propertyN/AObject of rdfs:labelNew
@commentThe comment of a class or propertyN/AObject of rdfs:commentNew
Cardinality on a class attributeThe cardinality of datatype propertyObjects of sh:minCount and sh:maxCountN/ANew
Cardinality on a relationship between two classesThe cardinality of object propertyObjects of sh:minCount and sh:maxCountN/AExisting

Please note that the annotations @type, @superTypes, and @extraTypes assume a strict ordering: @type should always be declared before @superTypes and @extraTypes are declared. The internal ordering of the latter two can be arbitrary.

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.

Keywords

FAQs

Package last updated on 12 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc