Skip to main content
Pre-release

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

Reasonable

Nightly Build Build PyPI version

An OWL 2 RL reasoner with reasonable performance

Performance

Comparing performance of reasonable with OWLRL and Allegro. Evaluation consisted of loading Brick models of different sizes into the respective reasoning engine and timing how long it took to produce the materialization. reasonable is about 7x faster than Allegro and 38x faster than OWLRL on this workload.

benchmark

How to Use

Python

To facilitate usage, we use the pyo3 project to generate Python 3.x bindings to this project. Installing these should be as easy as pip install reasonable.

See also the brickschema package for working with Brick models. The package provides a generic interface to this reasoner and several others.

Usage looks like:

import reasonable

# import triples from an rdflib Graph
import rdflib
g = rdflib.Graph()
g.parse("example_models/ontologies/Brick.n3", format="n3")
g.parse("example_models/small1.n3", format="n3")

r = reasonable.PyReasoner()
r.from_graph(g)
triples = r.reason()
print("from rdflib:", len(triples))

# import triples from files on disk
r = reasonable.PyReasoner()
r.load_file("example_models/ontologies/Brick.n3")
r.load_file("example_models/small1.n3")
triples = r.reason()
print("from files:", len(triples))

Rust

See Rust docs

Example of usage from Rust:

use ::reasonable::owl::Reasoner;
use std::env;
use std::time::Instant;
use log::info;

fn main() {
    env_logger::init();
    let mut r = Reasoner::new();
    env::args().skip(1).map(|filename| {
        info!("Loading file {}", &filename);
        r.load_file(&filename).unwrap()
    }).count();
    let reasoning_start = Instant::now();
    info!("Starting reasoning");
    r.reason();
    info!("Reasoning completed in {:.02}sec", reasoning_start.elapsed().as_secs_f64());
    r.dump_file("output.ttl").unwrap();
}

OWL 2 Rules

Using rule definitions from here.

TODO: implement RDF/RDFS entailment semantics as described here

Note: haven't implemented rules that produce exceptions; waiting to determine the best way of handling these errors.

Equality Semantics

Completed Rule name Notes
no eq-ref implementation is very inefficient; causes lots of flux
yes eq-sym
yes eq-trans
yes eq-rep-s
yes eq-rep-p
yes eq-rep-o
no eq-diff1 throws exception
no eq-diff2 throws exception
no eq-diff3 throws exception

Property Axiom Semantics

Completed Rule name Notes
no prp-ap
yes prp-dom
yes prp-rng
yes prp-fp
yes prp-ifp
yes prp-irp throws exception
yes prp-symp
yes prp-asyp throws exception
yes prp-trp
yes prp-spo1
no prp-spo2
yes prp-eqp1
yes prp-eqp2
yes prp-pdw throws exception
no prp-adp throws exception
yes prp-inv1
yes prp-inv2
no prp-key
no prp-npa1 throws exception
no prp-npa2 throws exception

Class Semantics

Completed Rule name Notes
yes cls-thing
yes cls-nothing1
yes cls-nothing2 throws exception
yes cls-int1
yes cls-int2
yes cls-uni
yes cls-com throws exception
yes cls-svf1
yes cls-svf2
yes cls-avf
yes cls-hv1
yes cls-hv2
no cls-maxc1 throws exception
no cls-maxc2
no cls-maxqc1 throws exception
no cls-maxqc2 throws exception
no cls-maxqc3
no cls-maxqc4
no cls-oo

Class Axiom Semantics

Completed Rule name Notes
yes cax-sco
yes cax-eqc1
yes cax-eqc2
yes cax-dw throws exception
no cax-adc throws exception

Other

  • no datatype semantics for now

Metadata

Release files for reasonable 0.1.47_alpha11

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

Source distribution (sdist)

Source distribution for reasonable 0.1.47_alpha11
File Size Uploaded Provenance Actions
reasonable-0.1.47_alpha11.tar.gz 1.5 MB Without provenance Details for reasonable-0.1.47_alpha11.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for reasonable 0.1.47_alpha11
File Actions
reasonable-0.1.47_alpha11-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for reasonable-0.1.47_alpha11-py3-none-win_amd64.whl
reasonable-0.1.47_alpha11-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details for reasonable-0.1.47_alpha11-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
reasonable-0.1.47_alpha11-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl Python 3 none macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details for reasonable-0.1.47_alpha11-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
reasonable-0.1.47_alpha11-cp37-abi3-manylinux_2_24_x86_64.whl CPython 3.7 abi3 Linux glibc 2.24+ x86-64 Details for reasonable-0.1.47_alpha11-cp37-abi3-manylinux_2_24_x86_64.whl
reasonable-0.1.47_alpha11-cp37-abi3-macosx_10_7_x86_64.whl CPython 3.7 abi3 macOS 10.7+ x86-64 Details for reasonable-0.1.47_alpha11-cp37-abi3-macosx_10_7_x86_64.whl

Total release size: 2.3 MB

Release files / reasonable-0.1.47_alpha11.tar.gz

Download URL reasonable-0.1.47_alpha11.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
6de5d44c39c65b1c1646e306e972e7272822383417a464757fdbf7ef37fb80f2
BLAKE2b-256 checksum
How to use checksums
3241d4d8731229378526ae72582aef6120b81d38f4b062e1500c3541944974ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.1

Release files / reasonable-0.1.47_alpha11-py3-none-win_amd64.whl

Download URL reasonable-0.1.47_alpha11-py3-none-win_amd64.whl
Size 8.4 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6fd56613ffedffb9f556570fcb6ebbd3bc31d85a9571d46882be94ca26cd37b9
BLAKE2b-256 checksum
How to use checksums
e1d631ca31862af5389e87545999413116493b25f1b84f410f8b8dcd1ead6803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.3

Release files / reasonable-0.1.47_alpha11-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL reasonable-0.1.47_alpha11-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 6.5 kB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
cbf7af39785cf9932f0b62f7a2d67e73a159c0dbf5b11794ae3417d5e6a806cc
BLAKE2b-256 checksum
How to use checksums
df492131d94bd8387a8a10070e5450fb9af71dbfe9d43672b2fa177b764221ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.1

Release files / reasonable-0.1.47_alpha11-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL reasonable-0.1.47_alpha11-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 8.0 kB
Tags Python 3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f9d53f6db1b11db59732807da6584de3855f0837e5b22f39cec7926c4a6917fe
BLAKE2b-256 checksum
How to use checksums
b6b79ff4f2a7b59a0a307673b3867111ba9a428501f31f3705abd75e0c6382dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.3

Release files / reasonable-0.1.47_alpha11-cp37-abi3-manylinux_2_24_x86_64.whl

Download URL reasonable-0.1.47_alpha11-cp37-abi3-manylinux_2_24_x86_64.whl
Size 438.6 kB
Tags CPython 3.7 Linux glibc 2.24+ x86-64 abi3
SHA-256 checksum
How to use checksums
10487a5129b3d352fb8f4f41521160d5c272ae578746106d90c7f8a068e8ff20
BLAKE2b-256 checksum
How to use checksums
d9b5c91c7e5b56ca43f17f28c06f05e5d0b4abb28c22350fbffbab8d20dd7911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.3

Release files / reasonable-0.1.47_alpha11-cp37-abi3-macosx_10_7_x86_64.whl

Download URL reasonable-0.1.47_alpha11-cp37-abi3-macosx_10_7_x86_64.whl
Size 409.7 kB
Tags CPython 3.7 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
26c7a2d8883b15f443718b15af84bd72f01f04c0b3505a5578505f0600a4eeaa
BLAKE2b-256 checksum
How to use checksums
2347f8bcfb4da5c421e48d2d47c6531ff1051a1017a7ba096f1c4a19eab8764e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.11.3

Security for reasonable 0.1.47_alpha11

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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