Introduction to SHACL

Shapes Constraint Language

Kathrin Dentler (kathrin.dentler@triply.cc)

Overview

  • SHACL Core and SHACL-SPARQL
  • SHACL Advanced Features
  • ShEx and DASH
  • Tools and RATT

SHACL

  • W3C Recommendation 20 July 2017
  • Validate data against a set of conditions - the shapes
  • Data-graph against shapes-graph
  • Shapes can also be viewed as a description of data
  • SHACL-Core and additionally SHACL-SPARQL

Use Cases

  • Validation
  • User Interface Building: display, edit and validate
  • Data Generation
  • Code Generation
  • Data Integration

Shapes and Constraints

Validation and Graphs

  • A processor validates the data and produces a validation report
  • SHACL defines an RDF Validation Report Vocabulary
  • Let's go play at the https://shacl.org/playground/

SHACL-SPARQL

SHACL Advanced Features

ShEx

DASH

  • http://datashapes.org/forms.html
  • Unofficial Draft 15 September 2020
  • Holger Knublauch (TopQuadrant, Inc.)
  • Shapes to drive user interfaces: display and edit
  • Layouts mirror the definitions in shapes
  • Extensions: Editors, e.g. dash:DatePickerEditor and
    Viewers, e.g. dash:ImageViewer

Tools and libraries

(only some examples)

rdf-validate-shacl

  • Used by RATT
  • Implements SHACL Core only
  • SHACL-SPARQL not implemented
  • Passes all official test cases except 4:
    "2 because of w3c/data-shapes#124, and
    2 because the library doesn't support non-numerical datatype comparisons (#23)".

SHACL Validation is a new feature in RATT!

Ticket "Add SHACL validation to RATT" recently resolved.
To test, follow these steps:


            git clone ssh://git@git.triply.cc:10072/triply/etl-collections.git
            cd etl-collections
            git checkout shacl-test
            cd StolperSteiner-ETL
            yarn
            yarn build
            yarn start