skillfed

owlrl

A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inference, on top of RDFLib. Based mechanical forward chaining.

owlrl v7.6.2 1.1M downloads/30d#4,354 on PyPI177
License unclear W3C-20150513 Active released

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 owlrl

uv

uv add owlrl

poetry

poetry add owlrl

Installing 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

License :: OSI ApprovedProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

owl2 rl reasoningrdfs inference enginerdf forward chainingsemantic web reasoningowl reasoning rdflibrdf triple inferenceowl-rl profile
semantic-webrdf-reasoningknowledge-graphs

More Information Analysis packages

Further reading