NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #2951 most downloaded on PyPI
Python SHACL Validator
Latest stable
0.40.2
Last release 25 days ago
28 Oct 2026
Release timing varies
gaps range from 8 days to 10 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
81 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Oxigraph-backed validation no longer computes len() of the whole data graph for every validation result.
len() of the whole data graph for every validation result.
datagraph or sg evaluated the truthiness of the DataGraph, which on Oxigraph runs a COUNT query over the entire store.xsd:string; they are now mapped back to plain RDFLib literals, which fixes false violations of sh:in, sh:hasValue and similar constraints.Logic in sh:intersection list in SHACL Expressions
Your coding agent can read these notes before it upgrades. Set up the MCP server →
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. Breakingrdflib.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. BreakingSupport 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
SHACL Rules Expander Mode
Focus Node Filtering
SHACL Shape selection
Combined Shape Selection with Focus Node filtering
Combined Rules Expander Mode with Shape Selection
Don't make a clone of the DataGraph if the input data graph is ephemeral.
Refactorings
validator_conformance.py module.
validate function.Typing
Fixed SHACL Path generation where sh:inversePath is wrapping a different kind of SHACL Path.
Fixed generic message generation when there are multiple sh:and, sh:or, or sh:xone constraints on a Shape.
Fix logic determining if a datagraph is ephemeral.
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
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 limit, and you are cetain you know what you are doing:
--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.Bumped Black version to 24.3.0 to mitigate CVE.
Bumped Poetry and Poetry-Core version to latest-and-greatest (fixes a bunch of long-standing bugs, I highly recommend updating).
cli main() no longer returns and int, it now emits sys.exit(code) and never returns.
Fixed typing on Python 3.8 and 3.12 (PRs #192 and #223). Thanks @ajnelson-nist
Fixed auto-generated validation message for 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
Dropped support for Python 3.7
Add preliminary support for Python 3.12
Dropped support for RDFLib v6.2.0 and earlier
Bumped to updated version of Black and Ruff
Do not hard-pin to importlib-metadata. Fixes #214
Shape can have multiple values for sh:not. Fixes #217
sh:not. Fixes #217Switched from deprecated pkg_resources to importlib.metadata for compatibility with Python 3.11 and 3.12.
sh:qualifiedMinValue on sh:qualifiedValueShape now works again, even if there are no value nodes found
on the path of the parent PropertyShape. Fixes #213 Thank you @ajnelson-nist for finding and reporting this.pkg_resources to importlib.metadata for compatibility with Python 3.11 and 3.12.
pyshacl[extras] are detected at runtime. If this adversely affects you, let us know.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.
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 !
Big change to how ontology mix-in mechanism works !
run PySHACL as a persistent service, exposing an OpenAPI3.0-compatible REST interface
That means, if no glaring bugs or issues are found in this release, this version will be re-released eventually as PySHACL v1.0.
That means, if no glaring bugs or issues are found in this release, this version will be re-released eventually as PySHACL v1.0.
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.
That means, if no glaring bugs or issues are found in this release after two weeks, this version will be re-released as PySHACL v1.0.
inplace validator option.schema.ttl file to newer version that doesn't have UTF-8 encoding issuesdocker pull docker.io/ashleysommer/pyshacl:latestThat means, if no glaring bugs or issues are found in this release after two weeks, this version will be re-released as PySHACL v1.0.
That means, if no glaring bugs or issues are found in this release after two weeks, this version will be re-released as PySHACL v1.0.
$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 Fixed an issue where the filetype detection routine in the RDF loader
Added the ability to pipe in SHACL file or ONT file via stdin on Linux or MacOS Fixed an issue where the filetype detection routine in the RDF loader would fail to reset the file back to the start.
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
This version of PySHACL requires RDFLib 6.0.0. As a direct result of that, this version of PySHACL also requires Python v3.7.
This version of PySHACL requires RDFLib 6.0.0. As a direct result of that, this version of PySHACL also requires Python v3.7.
Nothing published for this version
bump OWL-RL version to 5.2.3, and make rdflib_jsonld an optional dependency
bump OWL-RL version to 5.2.3, and make rdflib_jsonld an optional dependency
This is the last version of PySHACL to support RDFLib 5.0.0, subsequent releases of PySHACL will depend on RDFLib v6.0.0. As a direct result of that,
This is the last version of PySHACL to support RDFLib 5.0.0, subsequent releases of PySHACL will depend on RDFLib v6.0.0. As a direct result of that, this is also the last version of PySHACL to support Python v3.6.
See v0.16.1 release for or Changelog for release notes
See v0.16.1 release for or Changelog for release notes
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
Re-releasing v0.14.3, in order to push the release to Zenodo for a DOI
Potential speedups when executing validation by lazy-loading large modules which may never be required in a normal validation run.
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)Have you ever wanted to use Javascript to write SHACL constraints? Do you want to use Javascript to select custom SHACL targets? Have you the need to
Have you ever wanted to use Javascript to write SHACL constraints? Do you want to use Javascript to select custom SHACL targets? Have you the need to use Javascript to run SHACL Rules for emitting triples? Do you have the requirement to execute Javascript code from a SPARQL Function?
If yes, then this is the release for you!
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:importsNote I know there are some mypi errors in this release. This does not affect runtime functionality. These typing errors will be fixed in the near future.
New 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 Specification 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
One column per quarter.