This document is licensed under a Creative Commons Attribution 4.0 License.
This document defines ShapeUML, a visual notation for RDF constraints. It specifies the visualization primitives to represent constraints to users.
This document is the result of ongoing research.
Knowledge Graphs defined with the Resource Description Framework [RDF] consist of vocabulary terms and instance data both described using the graph model of RDF. Several constraint languages exist to define conditions on such RDF graphs, one such language is the W3C recommended Shapes Constraint Language [SHACL] which itself is represented using RDF. Users rely on different types of constraints offered by constraint languages to define conditions on RDF graphs.
With respect to visual notations, the Unified Modeling Language [UML] is widely used in many disciplines. A specific UML-profile for RDF [ODM] states how RDF classes and properties are mapped to UML classes. ShapeUML follows this profile but also adapt graphical symbols to the needs for RDF constraints.
Throughout the document, the following terminology is used.
Name | Primitive | Description |
---|---|---|
rectangle | data shape | |
solid line |
|
|
dashed line |
|
|
arrowhead | relationship direction | |
text | text | labels, constraints and other textual information |
Abstract Color Name | Concrete Color Recommendation | Description | Application | |
---|---|---|---|---|
canvas | #ffffff | white | Bright color with a good contrast to all other colors. | canvas where are all other graph elements are shown on |
foreground | #000000 | black | Very dark color with a good contrast to all other colors. | border of elements and edges |
base color | Color is not material to UML; we recommend no specific color, i.e. the same as the canvas color. | standard fill color of elements |
First, we provide a mapping from semantic constructs of RDF constraint languages to visual elements of ShapeUML (see figures). Next, we explain splitting rules with respect to the visualization of property shapes. Finally, we provide a complete visual example.
The SHACL specification [SHACL] contains core constraints and other concepts relevant for data validation. We provide a mapping of semantic constructs to visual representations with ShapeUML, i.e. in the first figure we provide the mapping from SHACL core constraints and in the second figure we provide the mapping from other relevant SHACL concepts.
Node shapes can be reused by a directed dashed connectioni and property shapes can be reused by directed solid connections.
Property shapes are visualized only once, however, ingoing solid connections with a property path as label and cardinalities on the arrow head are splitted.
I.e. a property shape which is reused n
times will be visualized only once
but will have n
ingoing solid edges with the property path as label
and cardinalities on the arrow head.
Below you can find an example for constraints expressed with ShapeUML.