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.
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:
Scripts
This Python package contains a couple of Command Line 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 to transform a file into RDF (on the standard output)- Run the script with
-hto get the available flags.
- Run the script with
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
Please follow the instructions for Support and Contact as given for the RDFLib package:
Development
Changes
To view the changelog for this software package, see CHANGELOG.rst.
Release Procedure
- ensure all tests pass:
pytest - update all the version numbers
pyproject.tomlREADME.rst
- remove the current
dist/directory - build the new distribution
- test the metadata rendering
- test pushing it to PyPI
- actually push it to PyPI
pytest
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 and 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.1.tar.gz.
File metadata
- Download URL: owlrl-7.6.1.tar.gz
- Upload date:
- Size: 48.5 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 |
b1e920cd5017044b17c1791e18ff5b51bd48b03755b2aa22896827ef3820a7d8
|
|
| MD5 |
5bc35aaabe7fa444f8d7c0fd4406c2da
|
|
| BLAKE2b-256 |
54fcca6c905411af11d36848ba28398c5e335c33dd70b9bc95039cb861b41424
|
File details
Details for the file owlrl-7.6.1-py3-none-any.whl.
File metadata
- Download URL: owlrl-7.6.1-py3-none-any.whl
- Upload date:
- Size: 55.7 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 |
5030eb136da9fdf4fc9dfcac95325d1039e2b3ed8aa352d4f302b66c0e475a6c
|
|
| MD5 |
d4476fdbabd402dbd41df31e309b7ba3
|
|
| BLAKE2b-256 |
ca675f5029c8db03b23746851444763a3da87859b63e0333ad43ef563bcd52fe
|