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

Part of the Legra RDF stack: pyshacl-turbo, rdflib-turbo and owlrl-turbo.

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.

pip install owlrl-turbo==0.1.0a1
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)

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 a copy into the native runtime and conversion back. 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. DeductiveClosure classes, custom Python rule hooks, owl:imports loading, configurable axiom/datatype options, OWL-RL extensions and complete inconsistency diagnostics are not exposed. Inference initialization follows pyshacl-turbo's pinned modes, rather than configurable owlrl constructor flags. Full OWL-RL conformance and output parity are not claimed.

Output stays within standard RDF: literal subjects and non-IRI predicates are excluded. Valid literal-valued consequences remain part of the contract. Native owl:hasKey checks every property, intentionally differing from the pinned Python reasoner's incomplete comparison. See ADR 0001.

For SHACL, pass expanded.to_rdflib() to pyshacl_turbo.validate(). This conversion copies; pyshacl-turbo does not yet share the new dataset handle. No speedup claims are made for this initial release. 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

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 pytest. Tests compare complete closures on bounded fixtures and exercise source mutation, malformed inputs, standard RDF output and a pyshacl-turbo pipeline.

CI requires 100% measured Python package line and branch coverage. This does not measure Rust coverage, full API compatibility or standards conformance.

Metadata

Release files for owlrl-turbo 0.1.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.1.0a1
File Size Uploaded
owlrl_turbo-0.1.0a1.tar.gz 17.8 kB Details

Built distribution (wheel)

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

Total release size: 26.7 kB

Release files / owlrl_turbo-0.1.0a1.tar.gz

Download URL owlrl_turbo-0.1.0a1.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
19ff3eb9496c5f011925498c269c19235dbeb5399b52d98b7db79b6151083c01
BLAKE2b-256 checksum
How to use checksums
f1f25b403119ff010312e62be307f71fd5d63cc7cb1f658b8c1f8486dfa925a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

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

Download URL owlrl_turbo-0.1.0a1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f6088b24603f63480bbd7fc17ec916a244b7d17c3f0ca30adf8a1080ce4c15a
BLAKE2b-256 checksum
How to use checksums
da7ccaf752c6571353e0fd7d08482e1822db21d8f2d34db75a754ea0ca4b9557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

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