The Pellet reasoner is implemented in Java and supports full OWL 2 and DL safe rules with reasoning based on a tableaux algorithm. It was the first DL reasoner fully supporting OWL DL.
To compile Pellet reasoner we need to include the following libraries to our Android’s Pellet library project:
- aterm-java-1.6.jar (original)
- jgraph-jdk1.5.jar (original)
- androjena_0.5.jar (original)
- icu4j-3.4.5.jar (original)
- iri-0.8.jar (original)
- slf4j-android-1.6.1-RC1.jar (original)
- owlapi-distribution-3.4.10-bin.jar (original)
To resolve the compiling issues of Pellet sources with Android SDK we need to:
- Resolve javax.xml.bind dependencies Android SDK does not provide the implementation of some classes needed in Pellet, some of these classes belong to the javax.xml.bind package and are used to bind xml data (javax.xml.bind and Xerces, libraries not contained in Android).This problem can be solved by adding the source code of both javax.xml.bind and Xerces to our Android project. However, Dalvik has a limit of 65536 methods references per .dex file and it gets exceeded then applying this solution. To solve this we have to extract only the needed classes from the libraries, that is to say, obtain the Java Architecture for XML Binding and extract following classes:
Place these files into our project and finally redirect the old javax.xml.bind dependencies to them.
- Remove all *.test packages and the TestATermManchesterSyntaxTenderer class.
- Replace de java.rmi.server.UID imports with it.polimi.dei.dbgroup.pedigree.androjena.java.rmi.server.UID.
- Replace the java.rmi.server.UID imports withit.polimi.dei.dbgroup.pedigree.androjena.java.rmi.server.UID.
- Remove the com.clarkparsia.pellet.sparql package.
- Inside the com.clarkparsia.pellint.rdfxml.OWLSyntaxChecker class, we should rewrite some code: o.asResource() is replaced by o.as(Resource.class) o.asLiteral() is replaced by o.as(Literal.class)
- Remove the class org.mindswap.pellet.utils.progress.SwingProgressMonitor.
- Remove the class pellet.PelletQuery.
- Remove the package com.clarkparsia.pellet.owlapiv3.EntailmenteQueryVisitor. Remove the appearances of queryVisitor variable in the com.clarkparsia.pellet.owlapiv3.EntailmentChecker class.
- Resolve the org.apache.xerces dependencies: Android SDK does not provide the implementation of some datatypes classes, to resolve this problem we should use the Apache Xerces project for Java. Though the fast solution would be include the whole Xerces library to the Android project, it does not compile with Dalvik. To include the necessary classes we need to download sources and include the package org.apache.xerces.jaxp.datatype directly to our Android project. While also deleting all references inside these classes to DatatypeMessageFormatter.
- Resolve other minor compiling issues.
As can be noted some major classes were deleted in order to obtain a Dalvik ready Pellet, whence following these steps we have removed SPARQL functionalities.
The Pellet 2.3.1 version for Android is available at GitHub and as a zip file.