SHACL
This page is a quick introduction of using Shapes Constraint Language (SHACL) with OpenStreetMap data. Uses RDF 1.1 Turtle as an example, but could be expressed in other serializations, such as JSON-LD 1.0.
Introduction
The Shapes Constraint Language (SHACL) is a World Wide Web Consortium (W3C) standard language for describing Resource Description Framework (RDF) graphs. It does have documented SHACL Use Cases and Requirements. Among others, it includes features to express conditions that constrain the number of values that a property may have, the type of such values, numeric ranges, string matching patterns, and logical combinations of such constraints. SHACL also includes an extension mechanism to express more complex conditions in languages such as SPARQL and JavaScript in the SHACL Advanced Features.
Implementations
Check also GitHub projects by tag shacl: https://github.com/topics/shacl
OpenStreetMap implementations
No know OpenStreetMap focused tools exist able to work directly with SHACL.
Generic implementations
For content already encoded in RDF, generic implementations of SHACL can be used.
Online tools
SHACL command line tools
- Java - Apache Jena - shacl
- https://jena.apache.org/documentation/shacl/index.html
- Support: It implements SHACL Core and SHACL SPARQL Constraints 2022-12-23
- Python - pySHACL - pyshacl
- https://github.com/RDFLib/pySHACL
- Support: from FEATURES.md SHACL Core(*); SPARQL Constraints(*); SHACL-JS; SHACL Advanced Features(*)' 2022-12-23
SHACL Libraries
- Java - Apache Jena
- Python - pySHACL
See also
- Main Wiki page for RDF related pages: RDF