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.47_alpha4.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

reasonable-0.1.47_alpha4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (6.5 kB view details)

Uploaded Python 3 manylinux: glibc 2.5+ x86-64

reasonable-0.1.47_alpha4-cp39-cp39-macosx_10_7_x86_64.whl (409.9 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

reasonable-0.1.47_alpha4-cp38-cp38-macosx_10_7_x86_64.whl (409.2 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

reasonable-0.1.47_alpha4-cp37-cp37m-macosx_10_7_x86_64.whl (409.2 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

reasonable-0.1.47_alpha4-cp36-cp36m-macosx_10_7_x86_64.whl (409.4 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

Details for the file reasonable-0.1.47_alpha4.tar.gz.

File metadata

  • Download URL: reasonable-0.1.47_alpha4.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.11.1

File hashes

Hashes for reasonable-0.1.47_alpha4.tar.gz
Algorithm Hash digest
SHA256 d08566af31fa6d981a5656e71d622c19d28e15047e58e7746167174910eb0723
MD5 32c1e64504906488e9a38a6c88b8b76f
BLAKE2b-256 ad21cda192ad198756108163dd1adf67d96a78fe4d568ffec8ce2095ec102bbf

See more details on using hashes here.

File details

Details for the file reasonable-0.1.47_alpha4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f23676bd489a58865a3590a90b40b63de2c958a1e7f41e917e2413ad312cc4d2
MD5 dbdebea560135aacec983ab7fd6a78f8
BLAKE2b-256 6e5a4922aaf5b015750fc1840c496761be0b97cb377445c3ba61be365daf12bd

See more details on using hashes here.

File details

Details for the file reasonable-0.1.47_alpha4-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha4-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 99425bbf9972485602c1e7a993721819e7fda119d8c29ba6ec5a99bbffa9eb94
MD5 a1b335c1cd434e3334beae73ca35ef4c
BLAKE2b-256 f72c570310d62af7e82329489000fb3ac1442e7b2e04481047a50b571ae0b57c

See more details on using hashes here.

File details

Details for the file reasonable-0.1.47_alpha4-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha4-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d94838bd14cfe090e637f9d7764619d7fff5ca24df095953f021f9fd4870b2a9
MD5 219aac846491c55a1a34508857732ddd
BLAKE2b-256 0ccd15fb0fa338150730db2a47b71429b2384f7e95d97c54493d70b729146fd1

See more details on using hashes here.

File details

Details for the file reasonable-0.1.47_alpha4-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha4-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f92746c32f6c3052d0af65c58f91c111640ceeccbb781adcaa3f1270c9d32438
MD5 662d4d6f3ae1d519d8eb8e75b4fe153f
BLAKE2b-256 d58a7ff32db7489472b113546cd82f722fc4ff387e39c3f171c497f938880ca7

See more details on using hashes here.

File details

Details for the file reasonable-0.1.47_alpha4-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha4-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e65a74d14e29d355ff2b3799d615c320b8796302e467cb6c20e984934950d71c
MD5 1c9a06c5f0443ae0e08f0bc2de1d3d5d
BLAKE2b-256 cff6084af947475f4469214bad5622ba748f1e88964dcbdcebcdcfd7924c82de

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