SHACL Playground
A constraint validator for the Shapes Constraint Language, written in JavaScript. See also Zazuko SHACL Playground for a newer implementation
Shapes Graph
        Always included: shacl.ttl dash.ttl
 
Data Graph
   
 
Show function call sequence
Shapes Graph Structure
Validation Report
About SHACL

SHACL has been defined by a W3C Working Group and has become a widely used standard for describing structural constraints on data graphs and validate RDF instance data against those.

In a nutshell, a SHACL processor takes a shapes graph and a data graph as input. Both can be entered here using data formats such as Turtle or JSON-LD. The shapes graph defines so-called shapes which are a collection of constraints. A shape also tells the engine for which nodes in the data graph it applies to (using targets). Constraints are of a type, called constraint components.

This Implementation

This service has been implemented in JavaScript by Holger Knublauch. Copyright © TopQuadrant, Inc. All rights reserved. The service is free to use from this web site and a version of the source code can be found at SHACL-JS GitHub project. Last updated: 2017-05-01 and no longer actively maintained.

The design follows the SHACL-JS extension mechanism for SHACL. Each constraint component (such as sh:minCount) is backed by a JavaScript function. The linkage from constraint components to these JavaScript functions is entirely declarative via RDF triples in the shapes graph. The built-in SHACL Core components are implemented in the same way as any user-defined extension. As a result, SHACL is extensible for any kind of constraint that can be expressed in JavaScript, while the shape and constraint definitions can be distributed using linked data standards.

The parsing services and in-memory triple store used by this service are provided, with many thanks, by rdflib.js.

Known Issues