HermiT
Version 1.3.8
The HermiT reasoner is implemented in Java and supports full OWL 2 and DL safe rules with reasoning based on a hypertableaux algorithm. It was the first DL reasoner that could classify some large ontologies thanks to a novel and efficient classification algorithm. HermiT is also included in the Protégé (the most popular ontology editor) distribution.
HermiT 1.3.8 cannot be converted directly to Dalvik
To compile HermiT reasoner we need to include the following libraries to our Android’s HermiT library project:
- axiom-1.2.8.jar (original)
- dk.brics.automaton-1.11-8-android.jar (modified): dk.brics.automaton is a Java library that implements finite-state automata. Inside a reasoner it’s used to deserialize the automatas needed by jautomata library, specifically, to deserialize datatypes like dateTime, int (or whatever datatype the ontology could need). The problem is that the serialized automatas included in the library can’t be deserialized properly in Android as they overload the dalvik heap while deserializing. These serialized automatas are included within the library in its root using aut extension, that files have to be replaced for new ones, to do so we need to rewrite the serialize/deserialize functions and use the serialize function to build the new aut files with the seralized automatas. Once we have these files, replace the old ones inside the jar and we are done.
- jautomata-core-2.0-android.jar (modified): Jautomata is a library for creating, manipulating and displaying finite-state automata within the Java platform. Being jautomata a requisite for HermiT reasoning, it needs to be compiled in Android OS. For that purpose we need to go to the source and remove the usage of awt.point (a class not included in Android SDK) in some hashCode functions and replace it with our own hashCode function. We also need to remove junit library and its dependencies.
- owlapi-distribution-3.4.10-bin.jar (original)
As for the HermiT sources, there are some classes that are not required in order to use the reasoner, so we simply remove them:
- Since debug functions are not required, we remove debug package and its references.
- Protégé support is not needed, we can safely remove ProtegeReasonerFactory class.
- We can also remove command line package and its classes.
Once we have compiled the sources with the given libraries we build them to get our Android’s HermiT library. Finally include the next libraries in your project to get it working:
- hermit-1.3.8-android.jar (modified)
- dk.brics.automaton-1.11-8-android.jar (modified)
- jautomata-core-2.0-android.jar (modified)
- owlapi-distribution-3.4.10-bin.jar (original)
The HermiT 1.3.8 version for Android is available at GitHub and as a zip file.