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

Uploaded Source

Built Distributions

reasonable-0.1.47_alpha5-cp39-cp39-macosx_10_7_x86_64.whl (410.4 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

reasonable-0.1.47_alpha5-cp38-cp38-macosx_10_7_x86_64.whl (409.7 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

reasonable-0.1.47_alpha5-cp37-cp37m-macosx_10_7_x86_64.whl (409.7 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

reasonable-0.1.47_alpha5-cp36-cp36m-macosx_10_7_x86_64.whl (409.7 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for reasonable-0.1.47_alpha5.tar.gz
Algorithm Hash digest
SHA256 2e50f2ff6a53863301f980fe8d960b6ef68596f5366179b681d4122d3509ff0f
MD5 a356040c0418880ec83700122f9e4593
BLAKE2b-256 e54e7d2e845628b9cb566c9994b8aaa5c1adce7e6230a93a92d4c86ebfe710ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1a64429ee02502f5d2fac86a361dff02c333f599d9b45081c193097d03a5b208
MD5 5d512583e88490facaad71ca90273817
BLAKE2b-256 1823e33b3a13b2416d94d00b7f58d97e8d0478ae6c9e2b8cb12a3006a5c8a16a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha5-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 632eab00d90f09ca07e6a696df7d34762cbba0e290d17465d3704f4dd3d19804
MD5 8b5193a2e4860d931093e0f0e8c324ab
BLAKE2b-256 59649c9bfa52b1e9c7c50486d391c63b67d03b254a4af93510e2661a818bb630

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha5-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 92a4a3ec84becf9c9e802394a1e2d4ceff616ffc658145cb5392fcaeabaa2622
MD5 2c12c2c425e9db93eec5eb2549685ba8
BLAKE2b-256 a70e50e3eedd7480796ac0bdea6236cd091dbd3e79d04e0cebbfc0ad219fc0d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha5-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5a01dafaa94620ffab55792ddf1ccad899b361f39d26c23d601806a2e66fd4c1
MD5 87225332ed4cd68d34d72368effbe3a3
BLAKE2b-256 f7bf93b91d1e7b28172200275d941bffe9c99952e9f21c2611720519772bd647

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