Skip to main content

An OWL 2 RL reasoner with reasonable performance

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reasonable-0.1.49_alpha12.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

reasonable-0.1.49_alpha12-cp37-abi3-win_amd64.whl (365.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_24_x86_64.whl (434.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.24+ x86-64

reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (418.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ x86-64

reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (757.7 kB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_7_x86_64.whl (404.9 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

Details for the file reasonable-0.1.49_alpha12.tar.gz.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12.tar.gz
Algorithm Hash digest
SHA256 a7e5ccef9d1887bdc081f3b6397436e889c725633fc930193eb50e8581875f6b
MD5 1e8ed4fbb91d7420e1f8b7be52be02ee
BLAKE2b-256 4c57e67faf3ab3fb410327d27d5307ab7f631f64427b75b26d6564ee4f30be10

See more details on using hashes here.

File details

Details for the file reasonable-0.1.49_alpha12-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a148b26d9e2620dae366280645f7b991e7c2e2d565b113fdc4f8450a08ad43cc
MD5 7268c145e84548a7f975a94c33ce632e
BLAKE2b-256 0b52df4d39c5caba13a8333dbf5f495ed96af39b1614d942288ccfc456536c15

See more details on using hashes here.

File details

Details for the file reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 bdac08284998edd8c9b43027026545e46644ce5bc4c0b74429d322ae502d24fe
MD5 faf9328340046472fdad36af71674ddc
BLAKE2b-256 2b50fa141cfd7cae05f22890b24113417ae6957d5ad18a7e2a60d62cd1715650

See more details on using hashes here.

File details

Details for the file reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 937c6db38c14852e3e82d905ede9ff8e0c824d6b68c8f26fc7b4794f4f894abc
MD5 89194112a8022839bd101f5e79c79569
BLAKE2b-256 6c293d33f3580bfdcaeaacdb98d2717b21c331a6cadd8280fceea52df51d0e3e

See more details on using hashes here.

File details

Details for the file reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c727aa09703b044b121ba08c842e7db75ff6ee36941fd1ccf41782389a4817a9
MD5 f8aa325de3844ba802c19ee49665e992
BLAKE2b-256 7946938993be16300e06f49e38bcd31d899a495fd287a3b1c0f4bf51d15b9357

See more details on using hashes here.

File details

Details for the file reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.49_alpha12-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2b3d05cdadaf11f44ad82ca7d67545c82e4c0ca533b557ecf32689406e1922b8
MD5 19bb454981b9a88bdeb2f3d29a9ca039
BLAKE2b-256 16601870827304b8b7bae344b3e0794ec6610c91306b26f6de6af4cea04cf659

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page