Skip to main content

Python bindings to FaCT++ reasoner

Project description

Python bindings for FaCT++ reasoner

FaCT++ is a well-optimized open-source reasoner for SROIQ(D) description logic with simple datatypes (OWL 2), written in C++. FaCT++ was created in 2003-2015 by Dmitry Tsarkov and Ian Horrocks in the University of Manchester, UK.

This repository is the work in progress for linking the FaCT++ with the Python's RDFLib package. This repository is based on the works of Artur Wroblewski factpp and coras. The goals are to create the RDFLib store with inference capabilities and to demonstrate the use of the FaCT++ API.

Reasoner details

The FaCT++ implements the atomic decomposition algorithms (i.e. represents the ontologies as terse directed acyclic graphs). A tableaux decision procedure is applied for SROIQ(D) together with the set of optimisation heuristics, such as:

  • lexical normalisation and simplification,
  • synonym replacement,
  • rewriting absorption,
  • told cycle elimination,
  • dependency-directed backtracking (backjumping),
  • boolean constant propagation,
  • semantic branching,
  • ordering heuristics,
  • model merging,
  • completely defined concepts,
  • clustering for wide and shallow taxonomies.

To tackle the OWL 2 computational complexity (double exponential in time for the worst case), the FaCT++ presents persistent and incremental reasoning. In the persistent mode, FaCT++ saves the inferred information together with its internal state into a file, which can be reloaded later with much less computational effort than reasoning would require. In the incremental mode, FaCT++ determines which parts of the precomputed inferences may be affected by an incoming change and only recomputes a subset of the inferences.

The mentioned above allows to achieve a very good performance on such known ontologies as FHKB, SNOMED CT, and Thesaurus.

The FaCT++ supports Java OWL-API, Lisp API, and DIG interface. It can also be used in C. There is also a work of Levin and Cowell on C++ usage (unmaintained).

Installation

pip install cython
cd FaCT++.Python
cmake .
make && make install

(Sorry, no pip support currently!)

Usage

Run an example:

python examples/imply-class.py

Try to load FOAF ontology:

./bin/factpp-load ontologies/foaf.rdf

and print ontology report:

./bin/factpp-load ontologies/foaf.rdf 2>&1 | bin/factpp-load-report

Authors of Python part

  • Artur Wroblewski
  • Evgeny Blokhin
  • Andrey Sobolev
  • Ivan Rygaev

License

  • Kernel reasoner code: GNU LGPL 2.1
  • Coras Python interface: GNU GPL 3.0

Project details


Download files

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

Source Distribution

pyfactxx-1.8.0.zip (468.2 kB view hashes)

Uploaded Source

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