Changelog History
Page 1
-
v1.0 Changes
๐ 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.
-
v0.40.0 Changes
July 08, 2026โ Added
Compatibility with Oxigraph stores.
- PySHACL can now validate a graph that is loaded into a PyOxigraph
pyoxigraph.Storeinstance. - ๐ New
DataGraphgraph abstraction layer that wraps RDFLibGraph/Datasetand, when installed,pyoxigraph.Store. - Validation and SHACL Rules expansion can use an Oxigraph-backed data graph for faster SPARQL execution.
- Install with the new optional extra:
pip install pyshacl[oxigraph]. - Pass a
pyoxigraph.Storedirectly tovalidate()orshacl_rules().
SHACL Functions and SHACL-JS Functions now register and execute on both RDFLib and Oxigraph SPARQL engines.
- SPARQL constraints can invoke SHACL Functions as SPARQL extension functions when using an Oxigraph-backed data graph.
โ Python 3.13 support in the test matrix.
pyduktape2dependency is now version-split for Python 3.13+.
๐ Changed
๐ฅ Dropped
rdflib.ConjunctiveGraphsupport throughout the codebase. Breaking- 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 issues later.
- ๐ Multigraph inputs must be an
rdflib.Dataset; barerdflib.Graphremain supported for single-graph use.
Adapted to RDFLib 7.3+ API changes
- 0๏ธโฃ
default_contexthas been replaced withdefault_graph, andcontexts()replaced withgraphs(). - Resolves #316
- Thanks @torsknod2
โก๏ธ Updated minimum dependency versions:
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.- Internal validation and rules expansion now operate on the
DataGraphwrapper rather than raw RDFLib graph objects. - 0๏ธโฃ SPARQL prefix resolution for shapes graphs stored in a
Datasetnow readssh:declareblocks from the default graph. - ๐ DASH conformance checking now enumerates named graphs with
Dataset.graphs()instead of the deprecatedcontexts()API.
๐ Fixed
- OWL
owl:importsover HTTP no longer leaves closedHTTPResponseobjects that trigger finalizer errors during garbage collection.
โ Removed
- ๐ฅ Support for
rdflib.ConjunctiveGraphas a data graph, shapes graph, or ontology graph input type. Breaking
- PySHACL can now validate a graph that is loaded into a PyOxigraph
-
v0.31.0 Changes
January 16, 2026v0.31.0
โ Added
- ๐ Support for validating multiple target data graphs.
- Default "combine" mode loads all given data graphs into a single Dataset and validates all at once.
- New "validate-each" mode validates each data graph independently and returns multiple results.
- CLI now accepts multiple data graph paths and adds a
--validate-eachflag. - New
validate_each()entrypoint for per-graph validation in library code.
๐ Fixed
- ๐ Support for validating multiple target data graphs.
-
v0.30.1 Changes
March 14, 2025๐ Fixed
- ๐ Fixed a bug in SHACL Shape Targeting feature, BNode shapes that are referenced by a shape in
sh:or,sh:andorsh:xonewere not getting selected.- Fixes #280
- ๐ Fixed a bug in SHACL Shape Targeting feature, BNode shapes that are referenced by a shape in
-
v0.30.0 Changes
January 24, 2025๐ Fixed
Finalize the decoupling of
base_urifrom graphidentifier.- Blame the conflated naming of
publicIDin RDFLib for that confusion.
- Blame the conflated naming of
load_from_sourcewill now correctly detect and use the BaseURI of files passed in, for relative URIs.- Fixes #281
๐ Changed
- โก๏ธ Update to Poetry v2.0 and new pyproject.toml format.
- โ Removed "Black", switched to "Ruff" for formatting as well as linting.
- ๐ Switched to parsing
file:IRIs in line with the RDF spec, and allow (base-less, or root-less) relativefile:IRIs (as per the RDF spec).- But "file:" IRIs in Turtle files are now not made relative to BaseURI, because they are relative to the CWD.
-
v0.29.1 Changes
January 24, 2025v0.29.1 - 2024-12-16
โ Added
- Two new basic examples in the Examples folder.
- "sparql_assert_datatype.py" shows how to use SPARQL-based Constraints to assert a datatype on a literal.
- "remote_sparql.py" shows how to use SparqlConnector store to validate data on a remote SPARQL endpoint.
๐ Fixed
- Fixed a bug where the
identifierwould become "None" (string) in theload_from_sourcefunction. - โ Typos in the example Ontology files in the test suite.
- Two new basic examples in the Examples folder.
-
v0.29.0 Changes
November 01, 2024๐ v0.29.0 - 2024-11-01 - Halloween Release
โ Added
- 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 the datagraph. - When using SHACL Triple Rules from SHACL-AF spec, PySHACL will now add the expressed triples into
a separate named graph. This allows you to more easily get the expanded triples back out again afterward.- This is implemented for TripleRules, SPARQLRules and JSRules
๐ Changed
๐ PySHACL no longer supports older RDFLib versions
- PySHACL relies on the latest OWL-RL version, that in-turn relies on the latest RDFLib version
- Therefore PySHACL now requires RDFLib v7.1.1 or newer
โฌ๏ธ Dropped Python 3.8 support.
- Python developers discontinued Python 3.8 last month
- The next version of RDFLib and OWL-RL will not support Python 3.8
- Removed Python 3.8 from the RDFLib test suite
- Python 3.9-specific typing changes will be incrementally introduced
- When validating a Dataset instead of a bare Graph, PySHACL will now expand RDFS and OWL-RL inferences into
-
v0.28.1 Changes
October 25, 2024v0.28.1 - 2024-10-25
๐ Fixed
- ๐ PySHACL no longer overwrites the Python
rootlogger and removes all its handlers. How Rude.
- ๐ PySHACL no longer overwrites the Python
-
v0.28.0 Changes
October 23, 2024v0.28.0 - 2024-10-23
โ Added
owl:imports now works with bnode values, where it contains the following:
- schema:url is the string where to find the imported ontology
- schema:url (again) with a "file://" path, to a local copy of the ontology
- schema:identifier that is the canonical name to use for the ontology at load time (this is the publicID)
RDFUtil.loader
load_from_sourcefunction now supportsidentifierthat is akin to the publicID of the file being
๐ loaded, and that is passed to RDFLib parser to correctly do relative URIs, etc.
๐ Changed
Big change to how Milti-graph datasets (ie, rdflib.ConjunctiveGraph and rdflib.Dataset) are handled.
- Instead of validating each named graph individually, PySHACL now sets
defaultUnion=Trueand
now validates the entire Dataset at once. - This allows you to logically segment your dataset as desired into many individual named graphs, and validation
will still work as you expect it to. - This is in preparation for another big upcoming change in pySHACL that will allow OWL-RL inferencing to place
inferred triples into a separate named graph, and SHACL Rules to place inferred triples into a separate named graph,
and validation will still work as expected because validation is now against a union of the whole dataset.
- Instead of validating each named graph individually, PySHACL now sets
Pre-Compile Regexs in sh:Pattern constraints. This allows faster re-use of the constraint, if is applied to
many different targets.
๐ Fixed
- Attempting to stringify a focus_node ar a value_node from the datagraph, where that node doesn't actually exist in
the datagraph, no longer crashes, it falls back to a different method.
-
v0.27.0 Changes
October 11, 2024โ Added
SHACL Rules Expander Mode
- A new alternative Run Mode for PySHACL
- PySHACL will not validate the DataGraph against Shapes and Constraints, instead it will simply run all SHACL-AF Rules to expand the DataGraph.
- 0๏ธโฃ By default it will output a new graph containing the existing DataGraph Triples plus the expanded triples
- โ Run with inplace mode to expand the new triples directly into the input DataGraph
Focus Node Filtering
- You can now pass in a list of focus nodes to the validator, and it will only validate those focus nodes.
- Note, you still need to pass in a SHACL Shapes Graph, and the shapes still need to target the focus nodes.
- This feature will filter the Shapes' targeted focus nodes to include only those that are in the list of specified focus nodes.
SHACL Shape selection
- You can now pass in a list of SHACL Shapes to the validator, and it will use only those Shapes for validation.
- โ This is useful for testing new shapes in your shapes graph, or for many other procedure-driven use cases.
Combined Shape Selection with Focus Node filtering
- The combination of the above two new features is especially powerful.
- If you give the validator a list of Shapes to use, and a list of focus nodes, the validator will operate in
a highly-targeted mode, it feeds those focus nodes directly into those given Shapes for validation. - In this mode, the selected SHACL Shape does not need to specify any focus-targeting mechanisms of its own.
Combined Rules Expander Mode with Shape Selection
- The combination of SHACL Rules Expander Mode and Shape Selection will allow specialised workflows.
- For example, you can run specific expansion rules from a SHACL Shapes File, based on the new triples required.
๐ Changed
๐ฏ Don't make a clone of the DataGraph if the input data graph is ephemeral.
- An ephemeral graph is one that is loaded from a string or file location by PySHACL
- This includes all files opened by the PySHACL CLI validator tool
- ๐ We don't need to make a copy because PySHACL parsed the Graph into memory itself already, so we are not concerned about not polluting the user's graph.
๐จ Refactorings
- shacl_path_to_sparql_path code to a reusable importable function
- move sht_validate and dash_validate routes to
validator_conformance.pymodule.- Removes some complexity from the main
validatefunction.
- Removes some complexity from the main
Typing
- ๐ A whole swathe of python typing fixes and new type annotations. Thanks @ajnelson-nist
๐ Fixed
๐ Fixed SHACL Path generation where sh:inversePath is wrapping a different kind of SHACL Path.
- ๐ This probably fixes lots of unreported sh:inversePath bugs
- ๐ Fixes #227
๐ Fixed generic message generation when there are multiple sh:and, sh:or, or sh:xone constraints on a Shape.
- ๐ Fixes #220
๐ Fix logic determining if a datagraph is ephemeral.