SHACL

From OpenStreetMap Wiki
Jump to navigation Jump to search

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.

information sign

This list of generic implementations is incomplete

Online tools

SHACL command line tools

SHACL Libraries

  • Java - Apache Jena
  • Python - pySHACL

See also

  • Main Wiki page for RDF related pages: RDF