Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

owlrl-turbo

PyPI Tests and wheels Python line coverage Python branch coverage Shared runtime Rust line coverage Shared runtime Rust region coverage Shared runtime Rust function coverage

Performance

Compare RDFLib + OWL-RL + pySHACL with rdflib-turbo, owlrl-turbo and pyshacl-turbo used together. The Turbo pipeline keeps one native dataset through parsing, in-place inference and SHACL validation.

End-to-end measurements for 1,000 synthetic nodes:

Platform Inference Python trio (ms) Turbo trio (ms) Python peak (MiB) Turbo peak (MiB)
Linux x86-64 RDFS 522.5 47.6 47.15 68.66
Linux x86-64 OWL-RL 801.3 56.4 48.69 69.29
macOS ARM64 RDFS 702.8 80.7 55.38 59.94
macOS ARM64 OWL-RL 1,028.5 72.5 55.91 60.42

Turbo uses more memory in these runs: 8–46% higher whole-process peak RSS. Ordinary RDF inference closures and complete SHACL report graphs match. Generalized RDF statements and report text differ, so these timings are not a full-output speedup claim or a claim of complete drop-in parity.

Measured in CI on 21 October 2026, using source-built wheels and Python 3.13: rdflib-turbo 0.2.0a7, owlrl-turbo 0.1.0a3, pyshacl-turbo 0.6.0 versus rdflib 7.6.0, owlrl 7.6.2, pyshacl 0.40.1. Times are medians of seven samples after warmup and include data parsing, shape compilation, inference, validation and full report construction. Shapes are parsed before timing. Memory is the median peak RSS of three fresh processes, including the interpreter, imports and retained output. Shared CI hosts and small synthetic cases do not establish universal speedups or large-dataset capacity.

See the complete Linux measurements, macOS measurements and continuously recorded benchmark history for all samples, source identities, dependency locks and other dataset sizes.

Overview

Functional alpha of native RDFS and OWL-RL materialization for Python. Uses the shared exact-term dataset runtime provided by rdflib-turbo, with native inference extracted from pyshacl-turbo. There is no runtime dependency on Python owlrl or pyshacl-turbo and no Python inference fallback.

Companion turbo projects: pyshacl-turbo and rdflib-turbo.

uv add owlrl-turbo==0.1.0a3
from rdflib_turbo import Dataset
from owlrl_turbo import expand

source = Dataset().parse(data='''
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    <urn:Person> rdfs:subClassOf <urn:Agent> .
    <urn:alice> a <urn:Person> .
''')
expanded = expand(source, inference="rdfs")
assert bool(expanded.query('ASK { <urn:alice> a <urn:Agent> }'))
assert len(source) == 2  # the default leaves the source unchanged

# Reuse the existing dataset handle and commit only on successful inference.
expand(source, inference="owlrl", inplace=True)

With rdflib-turbo's shared-validation release and the matching pyshacl-turbo release, pass source directly to pyshacl_turbo.validate(source, shacl_graph=...). This retains the dataset used above; only the report becomes an RDFLib graph. The canonical version benchmarks compare this pipeline against the three original Python libraries and historical turbo releases. Exact wheels, dependency locks, raw timings and RSS are retained.

expand(graph, inference="owlrl", inplace=False, destination=None) accepts rdflib_turbo.Dataset or RDFLib Graph/Dataset. Modes are rdfs, owlrl and both. The return value has the input kind. Native inputs remain native between calls; RDFLib inputs require one copy into the native runtime. Inplace calls stream only changed rows back; nonmutating calls explicitly export their independent result. RDFLib namespaces and blank-node identities are preserved. Named input contexts are retained. RDFLib Dataset inference defaults to urn:owlrl-turbo:inference; use destination to explicitly name the output graph for Dataset inputs.

Native operations release the GIL and hold a dataset lock throughout execution. Inference commits only after successful native execution. Errors leave the source unchanged. RDFLib inplace commits occur after native success, using RDFLib's normal mutation API; external RDFLib stores do not acquire a new transaction guarantee.

This is not a complete drop-in owlrl replacement. A limited DeductiveClosure class interface supports native axiomatic and datatype-axiom options. Custom Python rule hooks and OWL-RL extensions and complete inconsistency diagnostics are not exposed. Inference initialization follows pyshacl-turbo's pinned modes. Full OWL-RL conformance and output parity are not claimed.

Programmatic inference retains generalized RDF terms, including literal subjects. Strict document formats retain their own syntax contracts. Explicit interpret_owl_imports parsing is separate from closure execution. Native owl:hasKey checks every property, intentionally differing from the pinned Python reasoner's incomplete comparison. The canonical Dataset and streaming writeback source integration still requires coordinated installed-wheel acceptance; see ADR 0011.

For SHACL with matching shared-runtime releases, pass the native dataset directly to pyshacl_turbo.validate(). Explicit expanded.to_rdflib() conversion copies the dataset. Requires Python 3.11+; rdflib-turbo supplies the native platform wheel or builds its extension from source.

MIT OR Apache-2.0. Copyright 2026 DataRoad Inc, Delaware, USA, trading as Legra.

Development

Development uses native uv project commands and the committed uv.lock. Run make dev to sync the project and test tools, then make check. Add or update Python dependencies with uv add; run Ruff, mypy and pytest through uv run. Build wheels and source distributions with uv build. The coverage and release harnesses create isolated uv projects and install the exact built wheels.

The shared companion-project benchmark suite compares the three turbo projects with their reference packages, including RDFS, OWL-RL, native/RDFLib conversion and complete SHACL pipelines. With the three repositories as siblings, run make benchmark-companions. Measurements use pinned published wheels and separate timing and peak RSS workers.

Use make dev and make check. The initial alpha is published only by the verified GitHub Actions workflow; see release instructions.

Install rdflib-turbo first, then install this project with its test extra and run uv run --locked --extra test pytest. Tests compare complete closures on bounded fixtures and exercise source mutation, malformed inputs, standard RDF output and a pyshacl-turbo pipeline.

Coverage

Coverage badges update from successful main-branch CI measurements, including the daily scheduled run. Python lines and branches are separate; Rust badges measure owned native source exercised by Rust and Python integration tests. The Rust badges cover the shared rdflib-turbo runtime, including this project's tests.

CI requires 100% measured Python package line and branch coverage. Coverage is separate from full API compatibility and standards conformance.

Rust coverage of the shared runtime is measured by rdflib-turbo's native coverage harness, including this project's Python integration tests against an instrumented native wheel. With sibling checkouts, run make test-rust-coverage. owlrl-turbo has no separate Rust implementation; the shared-runtime result is not a Python coverage percentage or a conformance claim.

owlrl class interface (limited compatibility)

from owlrl_turbo import DeductiveClosure, OWLRL_Semantics

DeductiveClosure(OWLRL_Semantics).expand(graph)  # mutates graph; returns None

RDFS_Semantics and RDFS_OWLRL_Semantics are also available. Default constructor settings use native inference. RDFLib graphs use explicit conversion; native Dataset inputs retain their handle. Both axiomatic_triples and datatype_axioms are forwarded to the native runtime by class and functional entry points. improved_datatypes=False is accepted for the built-in semantics; closure execution never changes RDFLib process-global converters. Custom rule classes and process-global datatype switches are not yet implemented and raise explicit errors. This remains a limited compatibility facade with the standard-RDF/hasKey boundaries described in ADR 0005.

The axiom options, diagnostic history and native copy/closure APIs require published rdflib-turbo>=0.2.0a20. Distinct ordinary Graph source and destination endpoints must share one backing Store; unrelated contexts are not captured. CI installs the exact minimum from the public registry and tests both RDFLib closure and independent native Graph expansion. Candidate-provider testing uses a separate explicit exact-wheel override.

Metadata

Release files for owlrl-turbo 0.2.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for owlrl-turbo 0.2.0a1
File Size Uploaded Provenance Actions
owlrl_turbo-0.2.0a1.tar.gz 166.1 kB With provenance Details for owlrl_turbo-0.2.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for owlrl-turbo 0.2.0a1
File Interpreter ABI Platform Actions
owlrl_turbo-0.2.0a1-py3-none-any.whl Python 3 none any Details for owlrl_turbo-0.2.0a1-py3-none-any.whl

Total release size: 181.9 kB

Release files / owlrl_turbo-0.2.0a1.tar.gz

Download URL owlrl_turbo-0.2.0a1.tar.gz
Size 166.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3e08ccd6b7f77e1370060c17529303e82b37233145e85362450c7053cf6c2a3a
BLAKE2b-256 checksum
How to use checksums
67bcef65d230df90ef746343de42b47c9fb2b75f7c231df03c0b2113d36f9e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / owlrl_turbo-0.2.0a1-py3-none-any.whl

Download URL owlrl_turbo-0.2.0a1-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dfb52ab8d71b7c6729f076210171537d17fee8a74e27810dce61e811fe4d0ab
BLAKE2b-256 checksum
How to use checksums
7fc9a874cae74288557f3ce24ee9dac591be53f9a5d5a986ace813b32552adc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for owlrl-turbo 0.2.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for owlrl_turbo-0.2.0a1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page