ShapeVOWL: RDF Constraints Visualization based on VOWL

Unofficial Draft

Editors:
(Ghent University — IDLab — imec)
Anastasia Dimou (Ghent University — IDLab — imec)
Author:
(Ghent University — IDLab — imec)

Abstract

This document defines ShapeVOWL, a visual notation for RDF constraints. It specifies the visualization primitives to represent constraints to users.

Status of This Document

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).

1. Introduction

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.

RDF follows a graph model which intuitively can be represented using nodes and edges. The Visual Notation for OWL Ontologies [VOWL] leverages this graph model to visualize ontologies, the vocabulary of terms of Knowledge Graphs. Besides this, VOWL-based visual notations were also used for the RDF Query Language SPARQL [QueryVOWL], used to query RDF data, and for the RDF Mapping Language (RML) [MapVOWL], used to transform structured data to RDF. ShapeVOWL is an attempt to leverage the broadly used visual notation VOWL for RDF constraints.

2. Terminology

Throughout the document, the following terminology is used.

2.1 General

(anonymous) entity
An entity is something that exists as a distinct, independent, or self-contained unit. Examples are people, companies, buildings and so on. If you want to uniquely address an entity then it needs to have a unique name. Therefore, entities use HTTP URIs. However, when a entity does not have a URI we call it an anonymous entity [MapVOWL].
attribute
More information is provided about an entity by adding attribute to it. Examples are the name of a person, the VAT number of a company and so on [MapVOWL].
relationship
An entity and its attributes are connected with each other using relationships. A relationship describes how a attribute relates to its entity [MapVOWL].
constraints
A constraint is a condition on data which should be satisfied. Several types of constraints exist, e.g. a datatype constraint on a property restricts the value of that property to be of a specific datatype and a cardinality constraint on a property restricts the number of that property [SHACL-core-constraints].
data shape
A data shape is a set of conditions on RDF data. It provides context for constraints, i.e. a datatype constraint can be used in different data shapes which corresponds to different contexts [SHACL-abstract].
node shape
A node shape is a specific data shape which represents conditions on nodes, i.e. subjects and objects of triples [SHACL].
property shape
A property shape is a specific data shape which represents conditions on properties and their values, i.e. predicates and related objects of triples [SHACL].
closed data shape
A closed data shape may only have values for the properties explicitly enumerated via property shapes [SHACL].
severity
Each data shape has a severity which qualifies the violation of the stated conditions, i.e. it categorizes validation results [SHACL]. By default a data shape has the severity "violation" but other severities can be defined, i.e. the SHACL core specifies the three severities "violation", "warning" and "information".

2.2 Visualization

node
A node is a visual representation of either an entity or an attribute [MapVOWL].
edge
An edge is a line connecting two nodes. It represents the relationship between two entities or one entity and one attribute [MapVOWL].
graph
A graph is a collection of nodes and edges [MapVOWL].

3. Graphical Primitives

Name Primitive Description
circle
  • node shape
  • value of a property shape
rectangle
  • relationship label
  • literal
solid line
  • relationship between a node and a property shape
dashed line
  • relationship between nodes and data shapes or property shapes and node shapes (not between node shapes and property shapes)
  • border of deactivated data shapes
arrowhead relationship direction
text text labels, constraints and other textual information

4. Colors

4.1 General

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 We reuse the color 'general' of VOWL. standard fill color of data shapes
datatype color #ffcc33 yellow We reuse the color 'datatype' of VOWL. standard fill color of literals
deactivated see next table We reuse the color 'deprecated' of VOWL. fill color for deactivated data shapes
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. This is alternative to the base color. fill color of the data shape based on its severity; default severity is violation

4.2 Color Schemas

Color Schema Name Base Color Highlight
base color #aaccff #1155cc
deactivated #cccccc #999999
severity violation #e06666 #b7b7b7
severity warning (light yellow different from datatype color) #ffd966 #bf9000
severity information #93c47d #b7b7b7

5. Constraints

First, we provide a mapping from constraint-specific terminology to labels for the visual notation. Next, we elaborate on how constraints and data shapes are visualized. Then we explain the splitting rules with respect to the visualization of property shapes. Finally, we provide a complete visual example.

5.1 Labels

Labels in the visual notations may differ from the terminology of RDF constraints. In the following we list the mappinng between terminology and visual notation labels.
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(x) Specifies on which data a data shape applies by default
SHACL targetClass appliesOnClass(x) Specifies on which data a data shape applies by default
SHACL targetSubjectsOf appliesOnSubjectsOf(x) Specifies on which data a data shape applies by default
SHACL targetObjectsOf appliesOnObjectsOf(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

5.2 Visualization

Visualization Description
A node shape which has constraints attached in a note-element.
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.

5.3 Splitting rules

Node shapes can be reused by a directed dashed connection, however we recommend splitting rules for the visualization of reused property shapes as trade-off for the graph rendering. Different splittings for property shapes are possible; in the following we describe three possible splitting rules for property shapes. Depending on the level of detail, applications may choose one of the splitting rules.

Property shapes consist of two parts: a solid directed edge with the property path as label in a rectangle and a value the directed edge points too which is either a node or a literal.

5.3.1 Duplicate poperty shape

A reused property shape is visualized for each reuse, i.e. a property shape which is used n times will be visualized n times.

5.3.2 Duplicate property path

The value of a reused property shape is visualized only once but the directed edge and label are visualized for each reuse. I.e. a property shape which is used n times will be visualized by one value and n directed solid edges with label.

5.3.3 No duplication

A reused property shape is visualized only once, i.e. a property shape which is used n times will be visualized exactly one time and will have n ingoing solid edges to the rectangle containing the property path.

6. Example

Below you can find an example for constraints expressed with ShapeVOWL.

Figure 1 A person should not be an anonymous entity, also it should either have at least one schema:givenName property and at least one schema:familyName property, or exactly one ex:fullName property; all names of datatype xsd:string. Additionally, a person should have at least one and maximum two addresses, from which at least one address must comply with the linked existing data shapes.

A. References

A.1 Informative references

[MapVOWL]
MapVOWL. rml.io. URL: https://rml.io/specs/mapvowl/
[QueryVOWL]
QueryVOWL. URL: http://vowl.visualdataweb.org/queryvowl/index.html
[RDF]
RDF 1.1 Concepts and Abstract Syntax. W3C. URL: https://www.w3.org/TR/rdf11-concepts/
[SHACL]
Shapes Constraint Langauge (SHACL). W3C. URL: https://www.w3.org/TR/shacl/
[SHACL-abstract]
Shapes Constraint Langauge (SHACL) - Abstract. W3C. URL: https://www.w3.org/TR/shacl/#abstract
[SHACL-core-constraints]
Shapes Constraint Langauge (SHACL) - Constraint Types. W3C. URL: https://www.w3.org/TR/shacl/#core-components
[VOWL]
Visual Notation for OWL Ontologies (VOWL). URL: http://vowl.visualdataweb.org/v2/