Skip to main content

Crate shacl

Crate shacl 

Source
Expand description

§SHACL

SHACL implementation in Rust.

This project started as a re-implementation in Rust of SHACL-s.

§Validation modes

The crate exposes two engines selected via ShaclValidationMode:

  • Native — designed for in-memory graphs. Constraints are evaluated with Rust logic. When the sparql Cargo feature is enabled, inline sh:sparql (SHACL-SPARQL) constraints are routed to the SPARQL execution path so that in-memory validation validates them as well. This is the recommended mode whenever the data already lives in the process.

  • Sparql — designed for validating against a remote SPARQL endpoint. Every constraint is translated to SPARQL queries (SELECT/ASK). Use this mode when the data graph cannot be loaded in-memory; pick Native otherwise. This is only available with the shacl Rust feature.

§Configuration for tests

The tests depend on the shacl-testsuite which is available as a git submodule. In order to run tests it is necessary to run in the root folder of rudof:

 git submodule update --init --recursive 

Modules§

ast
SHACL AST Represents SHACL Abstract Syntax Tree. This project started as a re-implementation in Rust of SHACL-s.
error
ir
SHACL IR (Internal Representation) Represents SHACL Internal representation which is used for validation
rdf
SHACL RDF Contains the code that converts SHACL AST / IR to and from RDF
types
validator
SHACL validation This module contains the code for SHACL validation