Package: reasonable
ReasonableAn OWL 2 RL reasoner with reasonable performancePerformanceComparing performance ofreasonablewithOWLRLandAllegro. Evaluation consisted of loading Brick models of different sizes into the respective reasoning engine and timing how long it took to produce the materialization.reasonableis about 7x faster than Allegro and 38x faster than OWLRL on this workload.How to UseCommand Line InterfaceYou can download a static build of the command line toolhere(this is automatically built from the latest master).Usage as follows:$ reasonable -h
An OWL 2 RL reasoner with reasonable performance

Usage: reasonable [OPTIONS] <INPUT_FILES>...

Arguments:
  <INPUT_FILES>...  

Options:
  -o, --output-file <OUTPUT_FILE>  [default: output.ttl]
  -h, --help                       Print help
  -V, --version                    Print versionExample:$ reasonable example_models/ontologies/Brick.n3 example_models/small1.n3 -o myout.ttl
[2023-07-04T15:31:52Z INFO  reasonable] Loading file example_models/ontologies/Brick.n3
[2023-07-04T15:31:52Z INFO  reasonable::reasoner] Loaded 14803 triples from file example_models/ontologies/Brick.n3
[2023-07-04T15:31:52Z INFO  reasonable] Loading file example_models/small1.n3
[2023-07-04T15:31:52Z INFO  reasonable::reasoner] Loaded 14 triples from file example_models/small1.n3
[2023-07-04T15:31:52Z INFO  reasonable] Starting reasoning
[2023-07-04T15:32:11Z INFO  reasonable] Reasoning completed in 18.66sec
[2023-07-04T15:32:11Z INFO  reasonable] Writing to myout.ttlPythonTo facilitate usage, we use thepyo3project to generate Python 3.x bindings to this project.
Installing theseshouldbe as easy aspip install reasonable.See also thebrickschemapackage for working with Brick models. The package provides a generic interface to this reasoner and several others.Usage looks like:importreasonable# import triples from an rdflib Graphimportrdflibg=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 diskr=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))RustSeeRust docsExample of usage from Rust:use::reasonable::owl::Reasoner;usestd::env;usestd::time::Instant;uselog::info;fnmain(){env_logger::init();letmutr=Reasoner::new();env::args().skip(1).map(|filename|{info!("Loading file {}",&filename);r.load_file(&filename).unwrap()}).count();letreasoning_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 RulesUsing rule definitions fromhere.TODO: implement RDF/RDFS entailment semantics as describedhereNote: haven't implemented rules that produce exceptions; waiting to determine the best way of handling these errors.Equality SemanticsCompletedRule nameNotesnoeq-refimplementation is very inefficient; causes lots of fluxyeseq-symyeseq-transyeseq-rep-syeseq-rep-pyeseq-rep-onoeq-diff1throws exceptionnoeq-diff2throws exceptionnoeq-diff3throws exceptionProperty Axiom SemanticsCompletedRule nameNotesnoprp-apyesprp-domyesprp-rngyesprp-fpyesprp-ifpyesprp-irpthrows exceptionyesprp-sympyesprp-asypthrows exceptionyesprp-trpyesprp-spo1noprp-spo2yesprp-eqp1yesprp-eqp2yesprp-pdwthrows exceptionnoprp-adpthrows exceptionyesprp-inv1yesprp-inv2noprp-keynoprp-npa1throws exceptionnoprp-npa2throws exceptionClass SemanticsCompletedRule nameNotesyescls-thingyescls-nothing1yescls-nothing2throws exceptionyescls-int1yescls-int2yescls-uniyescls-comthrows exceptionyescls-svf1yescls-svf2yescls-avfyescls-hv1yescls-hv2nocls-maxc1throws exceptionnocls-maxc2nocls-maxqc1throws exceptionnocls-maxqc2throws exceptionnocls-maxqc3nocls-maxqc4nocls-ooClass Axiom SemanticsCompletedRule nameNotesyescax-scoyescax-eqc1yescax-eqc2yescax-dwthrows exceptionnocax-adcthrows exceptionOtherno datatype semantics for nowDevelopment NotesTo publish new versions ofreasonable, tag a commit with the version (e.g.v1.3.2) and push the tag to GitHub. This will execute thepublishaction which builds an uploads to PyPi.