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

Uploaded Source

Built Distributions

reasonable-0.1.47_alpha6-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_alpha6-cp39-cp39-macosx_10_7_x86_64.whl (409.4 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

reasonable-0.1.47_alpha6-cp38-cp38-macosx_10_7_x86_64.whl (409.3 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

reasonable-0.1.47_alpha6-cp37-cp37m-macosx_10_7_x86_64.whl (409.3 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

reasonable-0.1.47_alpha6-cp36-cp36m-macosx_10_7_x86_64.whl (409.6 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: reasonable-0.1.47_alpha6.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_alpha6.tar.gz
Algorithm Hash digest
SHA256 9cd5e1bb0ca1e628691a7d0362ffe0ce308655f044fb183782c75b3b134a08d6
MD5 3808c242355ed814b48fe1c103b7d114
BLAKE2b-256 8c82aa92082ba1c3f7b563caa046c431a1e873de731772069d73dadbd2811d31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha6-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e0c507396202f8f0be3b028aa6bea8ed45e812b8d00e81947704cb06495cc9a
MD5 dd6126f2c8707d92c24cf212a28c28c8
BLAKE2b-256 0c41c46f9c61112f36344e6d9cd0105ba16fbf334c1cd5ad2e1d1ba983d40cc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ba4568eef368925d0fb3694da26adea722d3f4b494174b131773779cd79acdbb
MD5 9e8158615cefb54a1556a6895d602f28
BLAKE2b-256 08a4e719a7584f7cda9e231b9ecf93c1fd8de3a9094037533ee900595eda45e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha6-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 22efffa6205cd2b9cad914338b6b965a608209786ba9d1dea393e26d996acbf3
MD5 fa621e9224525d02235e8714c666b7b9
BLAKE2b-256 9459389402ff66e8f1a56d52664bf034f65719dca91f25dd31b55538cddcca63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha6-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8e6f8b6688cd97c7de2181a60998f284a3d003d0c849298f237b1b05e4bbf63a
MD5 89345c190544ed74b2003f7a9a4821c5
BLAKE2b-256 460e92399c9f54a6cc57441fa042a2b76be263daad24798be3ccbc0e7dab06c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasonable-0.1.47_alpha6-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 941427816c555457fb3d0791344b35b5073c8934ebd4a5c11d7f6f9c259c4b58
MD5 b76eba57c3f6c55d72d9b0872b05fa89
BLAKE2b-256 4dbb91984a843bf43c0e630a099a3dd0a157986eb4d7396762b07362c388af3f

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