NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3400 most downloaded on PyPI
Python SHACL Validator
Last release 2 months ago
28 Jul 2026
Release timing varies
gaps range from 8 days to 10 months
Most releases are documented
notes for 51 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
80 releases · first in 2018
Logic in sh:intersection list in SHACL Expressions
ConjunctiveGraph has been deprecatd in RDFLib for a long time, it will be gone in RDFLib 8. Removing it now from PySHACL to prevent compatibility issu…
pyoxigraph.Store instance.DataGraph graph abstraction layer that wraps RDFLib Graph/Dataset and, when installed, pyoxigraph.Store.pip install pyshacl[oxigraph].pyoxigraph.Store directly to validate() or shacl_rules().pyduktape2 dependency is now version-split for Python 3.13+.rdflib.ConjunctiveGraph support throughout the codebase. Breaking
rdflib.Dataset; bare rdflib.Graph remain supported for single-graph use.default_context has been replaced with default_graph, and contexts() replaced with graphs().
rdflib[html]>=7.3.0,<8.0owlrl>=7.6.1,<8validate_each() now returns a dict keyed by input index (int) instead of by source identifier.DataGraph wrapper rather than raw RDFLib graph objects.Dataset now reads sh:declare blocks from the default graph.Dataset.graphs() instead of the deprecated contexts() API.owl:imports over HTTP no longer leaves closed HTTPResponse objects that trigger finalizer errors during garbage collection.
rdflib.ConjunctiveGraph as a data graph, shapes graph, or ontology graph input type. BreakingOne column per quarter.
Support for validating multiple target data graphs.
--validate-each flag.validate_each() entrypoint for per-graph validation in library code.VALUES in property paths or predicate names.
use_shapes filtering no longer fails when omitted PropertyShapes are referenced by included shapes.
Fixed a bug in SHACL Shape Targeting feature, BNode shapes that are referenced by a shape in sh:or, sh:and or sh:xone were not getting selected.
sh:or, sh:and or sh:xone were not getting selected.
Finalize the decoupling of base_uri from graph identifier.
base_uri from graph identifier.
publicID in RDFLib for that confusion.load_from_source will now correctly detect and use the BaseURI of files passed in, for relative URIs.
file: IRIs in line with the RDF spec, and allow (base-less, or root-less) relative file: IRIs (as per the RDF spec).
Two new basic examples in the Examples folder.
identifier would become "None" (string) in the load_from_source function.When validating a Dataset instead of a bare Graph, PySHACL will now expand RDFS and OWL-RL inferences into a separate named graph, to avoid polluting
PySHACL no longer overwrites the Python root logger and removes all its handlers. How Rude.
root logger and removes all its handlers. How Rude.owl:imports now works with bnode values, where it contains the following:
load_from_source function now supports identifier that is akin to the publicID of the file being
loaded, and that is passed to RDFLib parser to correctly do relative URIs, etc.defaultUnion=True and
now validates the entire Dataset at once.A new alternative Run Mode for PySHACL
validator_conformance.py module.
validate function.Added ability to specify a custom max-evaluation-depth. If you find yourself with a legitimate use case, and you are certain you need to increase this
--max-depth i argument on the commandline where i is an integer 1 to 999.max_validation_depth=i in the validator arguments if using PySHACL as a library.main() no longer returns and int, it now emits sys.exit(code) and never returns.sh:not when more than one sh:not is used on a constraint.Note, for compatibility with RDFLib 7.0, we specify a minimum Python version of v3.8.1
Nothing published for this version
Nothing published for this version
Added Python 3.11 support (use it, internal benchmarking shows its 25-30% faster than Python 3.8)
sh:node NodeConstraint now includes details of its child validation results, that were normally not included in the validation report.
sh:detail property on the NodeConstraint validation reportInoculating the datagraph using an extra ontology graph now copies over any missing namespace prefixes from the ontology graph to the datagraph.
QualifiedValueShape default message was using wrong stringification operation.Clone full contents of an OWL:NamedIndividual from the ontology graph to the datagraph, during the inoculation procedure.
OWL:NamedIndividual from the ontology graph to the datagraph, during the inoculation procedure.
QualifiedValueShape constraint component. It never had one before.Big change to how ontology mix-in mechanism works
run PySHACL as a persistent service, exposing an OpenAPI3.0-compatible REST interface
Ill-typed/Ill-formed literals now fail the DataType test, as expected
datatype-ill-formed_ttl.ttl)sh:datatype constraint validation.docker pull docker.io/ashleysommer/pyshacl:latestThis _may_ been seen as a breaking change, if your workflow relied on this incorrect behaviour.
inplace validator option.schema.ttl file to newer version that doesn't have UTF-8 encoding issuesdocker pull docker.io/ashleysommer/pyshacl:latestFixed a long-standing oversight where ShapeLoadErrors and ConstraintLoadErrors were not reported correctly when running PySHACL in CLI mode.
$PATH in a sh:sparql query on a PropertyShape would not work correctly.
sh:pattern could not be applied to a Literal that was not an xsd:string or URI.
sh:path value gets an unknown path type.
--allow-infos option in CLI mode and Python Module mode.
--allow-warnings except it only allows violations with severity of sh:Info.--allow-warnings continues to allow both sh:Warning and sh:Info as it used to.)--allow-infos and --allow-warnings can now also be enabled with --allow-info and --allow-warning respectively.Added the ability to pipe in SHACL file or ONT file via stdin on Linux or MacOS
Added Python 3.10 support (when using RDFLib v6.1.1 or greater)
sh:prefixs works with sh:declare on the given named ontology.Don't crash when a SHACL function is registered more than once (eg, if a function is both SPARQLFunction and JSFunction), fixes \#108, thanks Gabe Fie
SPARQL queries with words "values", "minus", or "service" in its comments no longer incorrectly throw an exception.
Handle transitive subclasses when evaluating sh:targetClass - @gtfierro
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
ExpressionConstraintComponent is implemented!
This requires a big version number bump because it's technically a breaking change.
sh:class Constraint now applies transitively.
rdfs:subClassOf relationships right to the top of the hierarchy.@gtfierroCompatibility with RDFLib 6.0.0
.term() (PR #84)Allow-Warnings is finally available. (Closes #64)
allow_warnings=True on validate() or -w in the CLI tool.abort_on_error to abort_on_firstabort_on_first=True on validate() or --abort in the CLI tool.Added an iterate_rules option, that causes SHACL Rules to run repeatedly until reaching a steady state. (Closes #76)
Relaxed the Max Evaluation Depth from 28 to 30, we were seeing some real-world cases where meta-shacl was failing on large Shapes Graphs at 28 levels
Potential speedups when executing validation by lazy-loading large modules which may never be required in a normal validation run.
requests when requests is not required to be installed.
requests in your python environment.Inplace Mode, for when cloning your datagraph is undesirable
inplace=True kwarg on validate().regex module is not installed (it will fall back to using builtin re)Implements all of the features in the SHACL-JS SHACL Extension specification: https://www.w3.org/TR/shacl-js/
pip3 install pyshacl[js] to get the correct extra packages.Fixed a long standing issue where our fancy loader would try to seek() on a file, after the file was closed by the JSON-LD parser
seek() on a file, after the file
was closed by the JSON-LD parser
Added the ability for PySHACL to use baked in graphs instead of fetching them from a HTTP endpoint when a known graph is imported using owl:imports
shacl.ttl was loaded into your Shapes file using owl:importsSPARQLConstraintComponent code, to allow for other custom constraint components in the future
shacl.ttl was loaded into the Shapes file
using owl:importsNew SPARQL-based Target Type feature
sh:parameter code in SPARQL-based Constraint Components, SHACLFunctions, and SPARQL-Based Target Types
SPARQLQueryHelper
SPARQLQueryHelper internal class is now more helpfulquery_helper can now extract param bindings into param-value pairs for parameterised queriesNew SHACL Advanced Spec Features!
In a validation report graph, when FocusNode and ValueNode are the same node, and are a blank node, when they get copied into the validation report gr
A couple of autogenerated sh:message strings were trying to serialize from dataGraph rather than shapeGraph
A couple of autogenerated sh:message strings were missing their focusNode element in v0.12.1
All SHACL Core constraints now have their own autogenerated sh:message.
All SHACL Core constraints now have their own autogenerated sh:message.
Added a copy of the implementation of the new 'Memory2' rdflib triplestore backend.
Python 3.5 support is removed. PySHACL now requires Python 3.6 or above.
setup.py and requirements.txt file.pyproject.toml and poetry to manage
dependencies, build and install.pip, upgrade to pip v18.1.0 or above.
sudo pip3 install --upgrade pipYou can get access to the same CLI tool if you install the module and run it using python3 -m pyshacl
-V shows the PySHACL versionpython3 -m pyshaclpython3 -m pyshacl --help for more detailsFixed a bug present since v0.11.0. If the data graph has multiple named graphs, and an extra ontology mixin source used and that also has multiple nam
v0.11.0. If the data graph has multiple named graphs, and an extra ontology mixin source
used and that also has multiple named graphs, then only the first graph in the mixins source was added to the datagraph.
Preparatory changes for the incoming rdflib 5.0.0 release
TOTAL_ORDER_CASTERS special cases in rdflib 5.0.0.Fixed badly-formatted dates in the changelog
Nodes defined as TargetNode by a SHACL Shape no longer is required to be present in the DataGraph.
Stringification of Focus Node, and Value Node in the results text string now works correctly
Bumped min OWL-RL version to 5.2.1 to bring in some new bugfixes
Fixed an inferencing bug introduced in v0.11.0 (present in v0.11.0 and v0.11.1)
Your coding agent can read these notes before it upgrades. Set up the MCP server →