Skip to content

Add pyoxigraph support, bump rdflib version, bump OWL-RL version for release#79

Open
ashleysommer wants to merge 2 commits intomasterfrom
oxigraph_support
Open

Add pyoxigraph support, bump rdflib version, bump OWL-RL version for release#79
ashleysommer wants to merge 2 commits intomasterfrom
oxigraph_support

Conversation

@ashleysommer
Copy link
Copy Markdown
Collaborator

@nicholascar
This is a set of changes I need merged into OWL-RL, to support a big update to PySHACL.

The major addition is the support in OWL-RL to perform inference on a PyOxigraph store.
This is not for performance reasons, instead it is for compatibility. This code uses a thin abstraction layer over the PyOxigraph store to make it appear to the OWL-RL reasoner as if it was a rdflib Graph. The conversion between Rust + Python objects, as well as the abstraction wrapper around the store for compability do remove the performance benefit of using PyOxigraph.

This is needed to support the new upcoming feature in PySHACL, that essentially does the same thing, it will be able to perform full SHACL shapes validation on a PyOxigraph store. The one missing piece is the pre-validation inferencing step, that requires this support in OWL-RL.

Other changes in this PR:
bump minimum RDFlib to v7.5.0. This not only brings newer RDFLib features and fixes, but also allows us to finally remove the annoying <4 restriction that needed to be on the requires-python version in this codebase, that older versions of RDFlib enforced.

Fianlly, also switched to the newer layout of the pyproject.toml file, that is supported by Poetry v2.0+. Bumped poetry requirement for that format capability.

…ded support for optional PyOxigraph integration. Updated dependencies in poetry.lock and adjusted .gitignore to exclude virtual environment. Enhanced README with installation instructions for optional features and added tests for Oxigraph compatibility.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an abstraction layer to allow OWL-RL inference to run against a PyOxigraph Store, updates the minimum RDFLib version for the upcoming release, and migrates packaging metadata to a newer pyproject.toml layout.

Changes:

  • Add DataGraph abstraction to support running closure expansion on a PyOxigraph store (including writing inferred triples to a named graph via destination).
  • Bump project version and minimum RDFLib requirement; update documentation accordingly.
  • Migrate packaging metadata to PEP 621 [project] layout and update lockfile; add an Oxigraph-focused test.

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
owlrl/graph_abstraction.py Introduces the RDFLib-like wrapper over a PyOxigraph store and term conversion helpers.
owlrl/Closure.py Integrates the abstraction layer into closure execution and destination handling.
test/test_dataset_oxigraph.py Adds test coverage for dataset-style inference over a PyOxigraph store with a destination named graph.
pyproject.toml Migrates to [project] metadata, bumps versions, adds optional oxigraph extra, and defines scripts.
poetry.lock Updates locked dependency set consistent with the new project/dependency constraints.
setup.py Updates Python version classifiers (drops 3.6–3.8, adds 3.11–3.12).
owlrl/__init__.py Updates stated RDFLib requirement and package __version__.
owlrl/OWLRL.py Updates docstring minimum RDFLib requirement.
owlrl/RDFSClosure.py Updates docstring minimum RDFLib requirement.
owlrl/CombinedClosure.py Updates docstring minimum RDFLib requirement.
owlrl/OWLRLExtras.py Updates docstring minimum RDFLib requirement.
owlrl/DatatypeHandling.py Updates docstring minimum RDFLib requirement.
owlrl/RestrictedDatatype.py Updates docstring minimum RDFLib requirement.
owlrl/XsdDatatypes.py Updates docstring minimum RDFLib requirement.
owlrl/AxiomaticTriples.py Updates docstring minimum RDFLib requirement.
README.rst Updates installation requirements and documents optional Oxigraph support and its tradeoffs.
.gitignore Ignores local virtualenv directory /.venv/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ashleysommer
Copy link
Copy Markdown
Collaborator Author

@copilot review again after latest commit with fixes

Copy link
Copy Markdown

Copilot AI commented Mar 30, 2026

@copilot review again after latest commit with fixes

All 8 review comments have been addressed in commit e455fda:

  • pyproject.toml: removed invalid [project.scripts] entries, updated license to SPDX "W3C-20150513", fixed "equivelent" spelling
  • owlrl/Closure.py: replaced PEP 604 | union syntax with typing.Union[...] for Python 3.9 compatibility, added proper guard so URIRef/string destinations only work with Dataset/ConjunctiveGraph/DataGraph, fixed error message to "must share the same backing store"
  • owlrl/graph_abstraction.py: replaced all PEP 604 | union syntax with typing.Union[...], fixed bind() signature to bind(prefix, namespace, **kwargs) matching RDFLib's convention

All 20 tests pass.

@ashleysommer
Copy link
Copy Markdown
Collaborator Author

ashleysommer commented Mar 31, 2026

@nicholascar
Can you please merge this and cut a new release. I've already bumped the version number in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants