--- id: pyshacl version: "0.40.1" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pyshacl — Python SHACL Validator License: permissive · Maintenance: active · Downloads: 1.1M/mo ## What it is and what it does pySHACL is a pure Python validator that checks whether RDF graphs conform to constraints defined in SHACL (Shapes Constraint Language) shape graphs. It uses rdflib for RDF handling and integrates owlrl for optional OWL2 RL Profile inference on data before validation. The validator can run standalone via command-line or be imported as a Python module; it supports multiple output formats (human-readable, table, Turtle, XML, JSON-LD, N-Triples, N3) and offers advanced features like meta-SHACL validation, SHACL Rules iteration, and optional Oxigraph backend support. Typical workflows involve loading a data graph and a shapes graph, optionally applying inference rules, and then validating the data against the constraints. The package returns a conformance boolean, a results graph in RDF, and human-readable validation text. It adheres to the W3C SHACL Recommendation and is designed for semantic web and linked data applications where schema validation and data quality checks are critical. Use it for: - Validate RDF datasets against organizational data quality rules before ingestion into a knowledge graph. - Enforce schema constraints on linked data published as part of a semantic web application. - Perform automated compliance checks on RDF exports from databases or ontology repositories. - Integrate SHACL validation into data pipelines to catch malformed triples early. - Test SHACL shape definitions themselves using meta-SHACL before deploying them in production. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Validates RDF graphs against SHACL shape definitions, using rdflib and OWL-RL for semantic constraint checking and optional OWL2 RL Profile inference. Yes. pySHACL is actively maintained, has low install friction, carries a permissive Apache 2.0 license, and is the standard Python implementation of the W3C SHACL specification. Install it if you work with RDF graphs and need constraint validation; it is production-stable and suitable for both command-line and programmatic use. ## Install pip install pyshacl uv add pyshacl poetry add pyshacl ## Installing pyshacl Before you install: Low install friction with a pure Python wheel distribution. Active maintenance with a release 17 days ago and recent commits; supports Python 3.9 through 3.13. License in practice: Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions—only requiring license and copyright notice preservation. Quickstart: from pyshacl import validate data_graph = "data.ttl" shacl_graph = "shapes.ttl" conforms, results_graph, results_text = validate( data_graph, shacl_graph=shacl_graph, inference='rdfs' ) Requires RDF data and SHACL shape files in a supported format (Turtle, XML, JSON-LD, N-Triples, or N3); rdflib and owlrl must be available. Verify before relying: - Performance characteristics when validating large RDF graphs or deeply nested shape hierarchies. - Completeness of SHACL Advanced Features and SHACL-JS support relative to the W3C specification. - Behavior and error handling when validating against malformed or incomplete SHACL shapes. ## Package facts - License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags RDF graph validation, SHACL validator, semantic web constraints, shape validation, linked data validation, RDF schema validation, graph constraint checking, semantic-web, rdf-validation, linked-data [View on SkillFed](https://skillfed.io/packages/pyshacl) · [View on PyPI](https://pypi.org/project/pyshacl/)