Update: See this tutorial for new developments on SHACL.

The Shapes Constraint Language (SHACL) is an evolving specification produced by the W3C RDF Data Shapes Working Group. TopQuadrant is actively supporting the development of SHACL in the W3C Working Group towards its becoming an official Standard Recommendation alongside RDF, OWL and SPARQL. The latest release of TopBraid Composer 5.0 includes experimental SHACL support to help early adopters, and to collect feedback for the specification itself. TopQuadrant’s serious commitment to SHACL is also highlighted by the TopBraid SHACL API, which is hosted as an open source Java project on GitHub. SHACL can be regarded as the more ambitious next generation of TopQuadrant’s SPIN technology, which has been in successful use for many years.

So what is SHACL? First and foremost SHACL is based on RDF and covers similar ground like RDF Schema and the Web Ontology Language (OWL). SHACL can be used to describe the structure of data – be it stored in RDF or JSON or similar formats. SHACL provides an RDF vocabulary for classes, properties and almost arbitrary integrity constraints that instances need to fulfil. SHACL is not limited to classes and instances, but also includes a more generic concept called “Shape” that can be overlaid on any existing data. Schemas created with SHACL can be shared on the web to communicate the intended structure of your data to other people or tools. SHACL tools can improve Data Quality.

The following TopBraid Composer screenshot may give you an idea of how a SHACL class definition looks like:

TBC-Gender-Form

How is SHACL different from RDF Schema and OWL? RDFS and OWL were designed for an “Open World” in which data may be assembled from many places on the Semantic Web. This design goal has caused a lot of frustration over the years, because it made it impossible to check even the most obvious integrity constraints, such as whether a property has a certain number of values. In contrast, SHACL assumes a “Closed World”, aligning with the expectations of typical business users. Furthermore, OWL has been optimized for a certain type of classification problems, yet it could not be used to do routine operations necessary for data validation such as mathematical computations or text operations. SHACL is much more expressive. Further it seamlessly integrates with SPARQL to express almost arbitrary conditions. BTW it is perfectly fine to incrementally extend an RDFS or OWL model with SHACL statements, supporting both worlds.

How does SHACL relate to XML Schema? XML is about tree structures / hierarchies. RDF is about graphs, where any node can link to any other node. SHACL is designed for graphs and object models. SHACL is also far more expressive than XML Schema, allowing richer conditions to be validated.

What makes SHACL special? SHACL is not only very expressive but also highly extensible. The SHACL vocabulary is not only defined in itself, but the same macro mechanisms can be used by anyone to define new high-level language elements and publish them on the web. This means that SHACL will not only lead to the reuse of data schemas but also to domain-specific constraint languages. Furthermore, SHACL can be used in conjunction with a variety of languages beside SPARQL, including JavaScript. You can express complex validation constraints in JavaScript so that they can be evaluated client-side. Overall, SHACL is a future-proof schema language designed for the Web of Data.

What are the next steps with SHACL? The standard is not a done deal yet. The design of certain aspects may still change, yet the major design decisions have been made and most of the syntax can be considered stable. The WG plans to publish an official First Public Working Draft “soon”. More feedback from the community can be expected then. TopQuadrant will track the progress of the language with its upcoming product releases. If things go as expected, SHACL will be an official standard in 2016.

How can I get started with SHACL? If you would like to get an overview of the language or even get your hands dirty, you may find the SHACL Tutorial useful. The official specifications can be found on the W3C Site.