owlrl
A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inference, on top of RDFLib. Based mechanical forward chaining.
What it is and what it does
OWL-RL is a Python library that performs logical inference on RDF graphs according to the OWL2 RL Profile and RDFS specifications. It sits on top of rdflib and uses forward-chaining rules to derive new triples from existing ones, expanding your graph with inferred knowledge. The library is designed for semantic web applications where you need to apply standardized reasoning rules to RDF data—for example, inferring that if A is a subclass of B and B is a subclass of C, then A is a subclass of C.
The package includes command-line tools for transforming RDF files and optional integration with PyOxigraph for compatibility with in-memory stores. It requires rdflib 7.6.0 or newer and supports Python 3.9 through 3.13, with no known security vulnerabilities.
Use it for:
- Expand an RDF knowledge graph with inferred triples derived from OWL2 RL rules and RDFS semantics.
- Build semantic web applications that need to apply standardized reasoning to linked data.
- Validate or enrich RDF data by deriving implicit relationships and classifications.
- Convert or transform RDF files using the command-line owlrl script with inference applied.
- Integrate reasoning into an application already using rdflib for graph management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements OWL2 RL Profile and RDFS inference on top of rdflib using forward-chaining rules to derive new triples from RDF graphs.
Yes. OWL-RL is actively maintained, has low install friction, no security vulnerabilities, and solves a specific and well-defined problem in semantic web reasoning. The unclear license treatment warrants a quick review of LICENSE.txt, but the package is suitable for projects that need OWL2 RL or RDFS inference on rdflib graphs.
Install
owlrl on PyPI
pip
pip install owlrluv
uv add owlrlpoetry
poetry add owlrlInstalling owlrl
Before you install
Low friction: pure Python wheel with a single runtime dependency (rdflib). Actively maintained with last commit 2026-08-06. Supports Python 3.9 through 3.13.
License in practice
Licensed under W3C-20150513 (W3C© SOFTWARE NOTICE AND LICENSE). License treatment is marked unclear; review LICENSE.txt before use in proprietary or commercial contexts to confirm compatibility with your project.
Quickstart
pip install owlrl
from owlrl import DeductiveClosure
from rdflib import Graph
g = Graph()
g.parse('data.ttl')
DeductiveClosure(g).expand()
Requires RDFLib 7.6.0 or newer.
Verify before relying
- Performance characteristics and scalability limits for large RDF graphs.
- Whether the forward-chaining approach is suitable for real-time or streaming inference workloads.
- Specific OWL2 RL axioms and RDFS rules that are fully implemented versus those with known limitations.
- Performance impact of optional integration with PyOxigraph compared to native rdflib stores.
Package facts
| License | W3C-20150513 (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — rdflib |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,112,524/month — #4,354 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: owlrl-7.6.2-py3-none-any.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
owlready2Owlready2 is a Python module for…
copyleft · top 15,000 on PyPI
pyshaclValidates RDF graphs against SHACL shape…
permissive · top 5,000 on PyPI
rdflibRDFLib is a Python library for parsing,…
permissive · top 1,000 on PyPI
CFGraphCFGraph extends rdflib's Graph to read RDF…
permissive · top 15,000 on PyPI
SPARQLWrapperSPARQLWrapper provides a Python interface to…
unclear · top 5,000 on PyPI
provImplements the W3C PROV Data Model in Python,…
permissive · top 15,000 on PyPI
sparqlslurperTranslates rdflib Graph.triples() calls into…
permissive · top 15,000 on PyPI
rdflib-jsonldProvides JSON-LD parsing and serialization for…
permissive · top 15,000 on PyPI
followthemoneyProvides a pragmatic data model and validation…
permissive · top 15,000 on PyPI
pyrdfa3Parses RDFa markup embedded in HTML documents…
unclear · top 15,000 on PyPI