This document is licensed under a Creative Commons Attribution 4.0 License.
This document defines ShapeUML, a visual notation for RDF constraints which is based on the Unified Modeling Language [UML]. It specifies the visualization primitives to represent constraints to users.
This document is draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization.
This document is the result of research and the accompanying paper is currently under submission at the 22nd International Conference on Knowledge Engineering and Knowledge Management (EKAW 2020).
This section is non-normative.
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.
| 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 | see next table | Color is not material to UML; we recommend no specific color, i.e. the same as the canvas color. | standard fill color of elements | |
| highlight | see next table | For each data shape the highlight color is a darker shade of the base color of that element. | fill color of the graph elements when selected | |
| severity | see next table | Every severity has its own color. | fill color of the data shape based on its severity; default severity is violation | |
| Color Schema Name | Base Color | Highlight |
|---|---|---|
| Data shape | #ffffff | #981c1c |
| severity violation | #e06666 | #b7b7b7 |
| severity warning | #ffd966 | #bf9000 |
| severity information | #93c47d | #b7b7b7 |
| Term source | Term | Label | Description |
|---|---|---|---|
| SHACL | Node Shape | Node Conditions | The type of a data shape |
| SHACL | Property Shape | Property Conditions | The type of a data shape |
| SHACL | IRI | IRI | The unique identifier of a data shape |
| SHACL | targetNode | appliesOn instance(x) | Specifies on which data a data shape applies by default |
| SHACL | targetClass | appliesOn class(x) | Specifies on which data a data shape applies by default |
| SHACL | targetSubjectsOf | appliesOn subjectsOf(x) | Specifies on which data a data shape applies by default |
| SHACL | targetObjectsOf | appliesOn objectsOf(x) | Specifies on which data a data shape applies by default |
| SHACL | minCount | 1..* | The inclusive min count is the left number. In case only maximum but no minimum is specified, the minimum is 0 |
| SHACL | maxCount | 0..1 | The inclusive max count is the right number. In case only minimum but no maximum is specified, the maximum is '*' |
| SHACL | pattern, flags | /pattern/flags | The constraint type 'pattern', a regular expression separated with a dash from possible flags |
| SHACL | Xone | OneOf | The logical relationship representing exclusive or |
| SHACL | node | compliesWith | The constraint type expressing that one data shape should comply with another data shape |
| SHACL | property | - | Not used, instead the property path of the property shape is displayed as label |
| SHACL | qualifiedValueShape, qualifiedMinCount, qualifiedMaxCount | compliesWith, 1..2 | The constraint type expressing that the specified number of a data shape should comply with another data shape |
| SHACL | ignoredProperties | otherAllowedProperties | Specifies which properties of a node are allowed even in a closed data shape |
| SHACL | in | valueIn | This constraint type specifies that a value needs to be member of a provided list |
| SHACL | sequence path | property1/property2 | A property path following the SPARQL 1.1 specification |
| SHACL | alternative path | property1 | property2 | An alternative property path following the SPARQL 1.1 specification |
| SHACL | inverse path | ^property1 | An inverse property path following the SPARQL 1.1 specification |
| SHACL | zero-or-more path | property1/property2* | Zero or more property path following the SPARQL 1.1 specification |
| SHACL | One-or-more path | property1/property2+ | One or more property path following the SPARQL 1.1 specification |
| SHACL | Zero-or-more path | property1/property2? | Zero or more property path following the SPARQL 1.1 specification |
| Visualization | Description |
|---|---|
A node shape which by default contains three compartments:
|
|
| A relationship between a node shape and a property shape: conditions of the property shape in combination with the conditions of the node shape. | |
| A one-to-many relationship using logical operators | |
| A property shape refering to a node shape indicated by a dashed connection. |
Node shapes can be reused by a directed dashed connection 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 visualilzed 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.