A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inference, on top of RDFLib. Based mechanical forward chaining.
Project description
OWL-RL
A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inference, on top of RDFLib, based on forward chaining.
This package is a Python library that also contains a couple of scripts:
scripts/RDFConvertService: a CGI script to invoke the library. It may have to be adapted to the local server setup.
scripts/owlrl: a script that can be run locally on to transform a file into RDF (on the standard output). Run the script with -h to get the available flags.
Installation
This package requires RDFLib 7.6.0 or newer. It can be installed from the Python Package index in the usual way:
pip install owlrl
or
poetry add owlrl
Optional: run the closure against an Oxigraph in-memory store by installing the extra:
pip install owlrl[oxigraph]
Use
This package can run inference according to RDFS and/or OWL-RL.
For details on RDFS, see the RDF Semantics Specification; for OWL 2 RL, see the OWL 2 Profile specification.
View the OWL-RL documentation online: http://owl-rl.readthedocs.io/
Oxigraph store (optional)
After installing the oxigraph extra (see Installation above), you may pass a PyOxigraph Store into owlrl.DeductiveClosure(...).expand(...) and related closure entry points wherever you would normally pass an RDFLib Graph or Dataset. Inferred triples can still be written to a separate named graph on that store via the destination argument, as with RDFLib.
This integration is provided for compatibility (for example, keeping the rest of an application on Oxigraph) rather than for speed. Converting terms to and from RDFLib objects removes most of the performance benefit of Oxigraph, and this project still uses RDFLib types and logic internally for all inference steps.
License
This software is released under the W3C© SOFTWARE NOTICE AND LICENSE. See LICENSE.txt.
Support & Contacts
For general “how do I…” queries, please use https://stackoverflow.com and tag your question with rdflib. Existing questions:
If you want to contact the rdflib maintainers, please do so via:
the rdflib-dev mailing list: https://groups.google.com/group/rdflib-dev
the chat, which is available at gitter or via matrix #RDFLib_rdflib:gitter.im
Development
Changes
To view the changelog for this software library, see CHANGELOG.rst.
Release Procedure
ensure all tests pass: pytest
update all the version numbers
pyproject.toml
README.rst
remove the current dist/ dir
build the new distribution
test the metadata rendering
test push it to PyPI
actually push it to PyPI
rm -vf dist/* poetry build bsdtar -xvf dist/owlrl-*.whl -O '*/METADATA' | view - bsdtar -xvf dist/owlrl-*.tar.gz -O '*/PKG-INFO' | view - poetry publish --dry-run poetry publish -u __token__ -p <OWL-RL PyPI Token>
commit the version update
tag it
push the commits & tag to GitHub
make a GitHub release
reuse the CHANGELOG entry for the release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file owlrl-7.6.0.tar.gz.
File metadata
- Download URL: owlrl-7.6.0.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.7 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c77edf5e2012c4fae25c3bb9cd416e32440280bfb0e3fc2a84e41a5ec255d9b1
|
|
| MD5 |
10c4891a8ece1ddc71ffc308a973b5c0
|
|
| BLAKE2b-256 |
f0e3b9afbb80f3a33bd0151003acc0e87b834c11783fcb7462ef28063d5ccbab
|
File details
Details for the file owlrl-7.6.0-py3-none-any.whl.
File metadata
- Download URL: owlrl-7.6.0-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.7 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06bd31beee0c56d6faffe3ec83fa795a2597ccf31ed6e9eb2770c5161ec3ad22
|
|
| MD5 |
4980875b33137cca8da7fc6aca4b3116
|
|
| BLAKE2b-256 |
210217cc67e789d033123e0f457995349a7d24bbef68bf2dae9fc0d7eccaa82a
|