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

Shared dataset pipeline

35.8× faster with RDFS and 11.8× faster with OWL-RL on this 10,000-node synthetic fixture, using less peak memory. The Turbo trio shares one native dataset through parsing, inference and public SHACL validation.

Pipeline Python trio (s) Turbo trio (s) Speedup Python peak (MiB) Turbo peak (MiB)
Parse → RDFS → SHACL 15.889 0.444 35.8× 139.7 126.7
Parse → OWL-RL → SHACL 11.104 0.940 11.8× 151.2 123.4

Complete scoped and generalized closures, report graphs and report text matched. Peak memory was 9.3% lower for RDFS and 18.4% lower for OWL-RL.

Measured 3 November 2026 on Apple M3 Max / macOS arm64, CPython 3.13.16, uv 0.13.5. Originals: RDFLib 7.6.0 / OWL-RL 7.6.2 / pySHACL 0.40.2, without optional native adapters. Turbo: published rdflib-turbo 0.2.0a33 / owlrl-turbo 0.2.0a1, with pyshacl-turbo code from #137, tested at 9be3f03. That facade wheel was an unpublished build, not the public 0.8.0 release.

Medians use five alternating fresh-process pairs after an untimed warmup; peak RSS uses seven separate cold processes per arm. Times include data parsing, inference and public validation/report construction; imports and SHAPES preparation are outside timing. Memory includes the whole process and retained results, before correctness encoding. These finite fixture results do not establish universal speedups or full drop-in parity. See all samples, output fingerprints and exact artifact identities and the pipeline harness.

Matched public Graph pipeline

Parse → OWL-RL → SHACL: about 11× in this measured synthetic run. Both arms use public Graph APIs, expand into the same source Graph and validate in place. The Turbo trio keeps one RDF dataset in memory throughout; a separate non-timed ownership regression checks the actual shared route without adding spies to timed children.

1,000-literal case Python trio (ms) Turbo trio (ms) Time ratio Python peak (MiB) Turbo peak (MiB)
Literal reflexivity 285.2 25.5 11.2× 88.0 86.1
Literal typing 362.7 31.5 11.5× 100.5 98.8

Measured 31 October 2026, macOS 27.0.1 (arm64), CPython 3.13.16, native uv 0.13.5: original registry wheels of rdflib-turbo 0.2.0a23 / owlrl-turbo 0.2.0a1 / pyshacl-turbo 0.7.1, versus RDFLib 7.6.0 / OWL-RL 7.6.2 / pySHACL 0.40.1. These are medians of five fresh children per arm after a separate warmup. The total includes Graph construction/parsing, OWL-RL closure construction/expansion and public validation/report construction; imports, fixture text and SHAPES preparation are outside. Complete scoped/generalized facts, literal metadata, report/text, namespace/effect/flag gates passed for rdflib.NORMALIZE_LITERALS=True. The separate NORMALIZE_LITERALS=False check differs in a global-setting side effect and has no performance ratio.

Peak RSS is absolute whole-process memory captured before correctness encoding; it includes imports, setup and retained results. This single-host result is not a universal speed or memory claim. See the portable numeric provenance and method/locked replay. From a pyshacl-turbo checkout, use a fresh output directory:

uv run --no-project --python 3.13.16 python -I -B benchmarks/matched_graph_driver.py \
    --cohort benchmarks/matched-graph-releases.json --roles baseline --widths 1000 \
    --repeats 5 --output benchmark-artifacts/matched-graph-readme

Historical measurements and provenance

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.2.0a2
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.0a2

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.0a2
File Size Uploaded Provenance Actions
owlrl_turbo-0.2.0a2.tar.gz 163.1 kB With provenance Details for owlrl_turbo-0.2.0a2.tar.gz

Built distribution (wheel)

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

Total release size: 180.3 kB

Release files / owlrl_turbo-0.2.0a2.tar.gz

Download URL owlrl_turbo-0.2.0a2.tar.gz
Size 163.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1db9932a0ba641519c9ef92b9243d9d7f01307f17226332a757748495583cad1
BLAKE2b-256 checksum
How to use checksums
e9c1270ab22c99b5c098ad8f1175e320dbef86d4b9c8159a013e6e61b0c448c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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 Nov 8, 2026.

Transparency log

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

Download URL owlrl_turbo-0.2.0a2-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d881829320ad582011b2b4ea99126fb73d424acb6e6a9f9affca8de7be091f8f
BLAKE2b-256 checksum
How to use checksums
ca397518274b427588553fb2129003b4873e92928d4b4ad45c81a5435e3f0324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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 Nov 8, 2026.

Transparency log

Security for owlrl-turbo 0.2.0a2

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.0a2.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 Nov 8, 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