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.1.zip (464.4 kB view hashes)

Uploaded Source

Built Distributions

pyfactxx-1.8.1-cp310-cp310-win_amd64.whl (329.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyfactxx-1.8.1-cp310-cp310-manylinux_2_27_x86_64.whl (676.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64

pyfactxx-1.8.1-cp39-cp39-win_amd64.whl (330.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyfactxx-1.8.1-cp39-cp39-manylinux_2_27_x86_64.whl (678.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64

pyfactxx-1.8.1-cp38-cp38-win_amd64.whl (330.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyfactxx-1.8.1-cp38-cp38-manylinux_2_27_x86_64.whl (678.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64

pyfactxx-1.8.1-cp37-cp37m-win_amd64.whl (329.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyfactxx-1.8.1-cp37-cp37m-manylinux_2_27_x86_64.whl (676.5 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64

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