umlSHaclEX is a library that transforms ShEx and SHACL shapes to UML.

umlSHaclEX can be used as: - An independent comman line tool - A JAR library that can be invoked from other Scala or Java programs - Integrated in a Web application (see rdfshape)

Building

This project has been implemented in Scala using sbt.

Command line usage

Generate a SVG diagram

sbr run --schema examples/shex/paper.shex --schemaFormat "SHEXC" -o examples/shex/paper.svg -f svg

Example diagram

Given the following ShEx code.

prefix schema: <http://schema.org/>
prefix xsd:   <http://www.w3.org/2001/XMLSchema#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix it:    <http://data.europeana.eu/item/>
prefix foaf:  <http://xmlns.com/foaf/0.1/>
prefix :      <http://example.org/>

:User IRI {
 a                    [ foaf:Person ];
 schema:birthDate     xsd:date?  ;
 foaf:knows           @:User* ;
 foaf:topic_interest  @:Topic {0,10}
}

:Topic {
  dcterms:title   xsd:string ;
  dcterms:creator IRI ;
}

:Item {
  dcterms:title [@en @fr @es] ;
  dcterms:subject @:Topic
}

The library generates a diagram like:

paper

ScalaDoc