After two and half years of collaboration and discussions, the W3C Data Shapes Working Group has produced a collection of specifications that define the features of the Shapes Constraint Language (SHACL):
- SHACL (Official W3C Standard Recommendation) is the main document, defining the features of SHACL Core and its extension mechanism called SHACL-SPARQL. SHACL Core defines the basic syntax and structure of shapes, constraints, the built-in kinds of constraints, and how to link shapes to data nodes. SHACL-SPARQL defines how to express constraints that are not covered by the built-in constraint kinds.
- SHACL Advanced Features (WG Note) includes useful features that were originally part of the main document but were split off due to limited time. This includes extensions of SHACL-SPARQL such as user-defined functions but also SHACL Rules, a very powerful feature inspired by SPIN rules, useful to define data transformations, inferences and mappings based on data shapes.
- A SHACL Compact Syntax exists as a draft that will be finished by the upcoming SHACL Community Group.
Here is a little diagram that gives an overview of how these features plug together:
Taken together, these features define an extremely powerful stack of declarative, web-friendly languages that can be used for data modeling, ontology design, constraint validation, inferencing and data transformation. The design of SHACL is heavily inspired by SPIN (which originated from TopQuadrant) and IBM’s Resource Shapes and therefore inherits a wealth of practical experience, solving real-world problems and “getting the job done”.