Skip to main content

shacl-rust (Python)

Python bindings for shacl-rust, a SHACL validator for RDF graphs written in Rust. Passes all 120 applicable tests of the W3C SHACL test suite.

pip install shacl-rust
import shacl_rust

shapes = """
@prefix ex: <http://example.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:PersonShape a sh:NodeShape ;
    sh:targetClass ex:Person ;
    sh:property [ sh:path ex:age ; sh:minInclusive 0 ; ] .
"""

data = """
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:alice a ex:Person ; ex:age "-3"^^xsd:integer .
"""

report = shacl_rust.validate(data, shapes)
print(report["conforms"])          # False
print(report["results"][0])        # violation details

# Fast path for large graphs (experimental interned index):
shacl_rust.conforms(data, shapes, experimental_index=True)

Large graphs can be streamed from disk or any binary file-like object, so the serialized text is never fully held in memory:

report = shacl_rust.validate_file("data.ttl", "shapes.ttl")

import gzip
with gzip.open("data.ttl.gz", "rb") as f:
    ok = shacl_rust.conforms_file(f, "shapes.ttl", data_format="turtle",
                                  experimental_index=True)

Formats: turtle/ttl (default), nt, nq, rdf, jsonld, trig via the data_format= / shapes_format= keyword arguments (inferred from path extensions for validate_file/conforms_file).

Diagnostics

Pass diagnostics=True to validate/validate_file to get rustc-style diagnostics (shape lints, then violation diagnostics) alongside the report:

report = shacl_rust.validate(data, shapes, diagnostics=True)
print(report["conforms"])       # False
print(report["diagnostics"][0]["code"])      # e.g. "V0007"
print(report["diagnostics"][0]["severity"])  # "error", "warning", or "info"
print(report["diagnostics"][0]["title"])     # e.g. "value violates sh:minInclusive"

Each entry in report["diagnostics"] is a dict with code, severity, title, constraint_component, snippets, expected, actual, notes, help, focus_node, source_shape, path, and verdict. When diagnostics is False or omitted (the default), the "diagnostics" key is absent from the result dict entirely.

Metadata

Release files for shacl-rust 0.2.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shacl-rust 0.2.12
File Size Uploaded Provenance Actions
shacl_rust-0.2.12.tar.gz 180.1 kB With provenance Details for shacl_rust-0.2.12.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for shacl-rust 0.2.12
File Actions
shacl_rust-0.2.12-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for shacl_rust-0.2.12-cp39-abi3-win_amd64.whl
shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
shacl_rust-0.2.12-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) Details for shacl_rust-0.2.12-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Total release size: 12.2 MB

Release files / shacl_rust-0.2.12.tar.gz

Download URL shacl_rust-0.2.12.tar.gz
Size 180.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d2d570f6bd1a6b28bd3e342707fed22498f8c695a558726908e1bcc9892361d4
BLAKE2b-256 checksum
How to use checksums
a2ea176b8758f81469be5432e8528ae4b1ad227ae4aad1cbf31581abf9cb4382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / shacl_rust-0.2.12-cp39-abi3-win_amd64.whl

Download URL shacl_rust-0.2.12-cp39-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d56d8eb66d860d234bd3b1a454eac6bcfff0d80a54e9239dfffc7b7f24e56f4e
BLAKE2b-256 checksum
How to use checksums
8a9ee385bae2087de726de5bf05237e2470993a83ce76adb7964556ef31b45be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
755c96d27b0562ad2f5a1e1c62d8adceb235fb09deaedb7072dc879be3a92307
BLAKE2b-256 checksum
How to use checksums
f0367a8cd758daa047aa351ae8d53c539e20ba501db83f82c8581c0fe2f4af68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL shacl_rust-0.2.12-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
aee8fd589bc0714659590dedff8cefc20a047833f77db94f3cee03bf1b8796b3
BLAKE2b-256 checksum
How to use checksums
0755f16390a69e03d7c638c1ed8c2e393c8f39f2e9037bd78e35491f23cf8df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / shacl_rust-0.2.12-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL shacl_rust-0.2.12-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 4.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
df1b76ddad718834f82c3b7bd0f205c5629db14860859d3d89ab5c286f088a78
BLAKE2b-256 checksum
How to use checksums
e82534c15d14423f6bff143909a8fba0066f7d4438d77cd5403facae057aea56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for shacl-rust 0.2.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for shacl_rust-0.2.12.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.12 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page