1

I am trying to import Pellet 2.3.0 reasoner in Jena 3.0.1 (working in Eclipse). To do so I have read all the similar questions here (although some are outdated) and the FAQ in the Apache Jena website. Using their code I always get an error in the following line:

OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);

Jena works fine and I have tested it. What I guess is that I haven't imported the right jar files for Pellet. I cloned the whole Pellet repository from GitHub and the only jar file I found is the one inside the Protege folder. Moving the cursor in the underlined text Eclipse tells me to import something but the problem remains. Are the jars responsible for that error or is something else?

Mandy
  • 21
  • 6
  • Trying to integrate the old version of Pellet into an Java project with Jena 3.x can be a real pain. After some further search i found another project on Github which bases on Pellet and offers a direct support with Jena 3.x without any complications. Especially when using Maven, the integration is really easy. Check this out: https://github.com/Galigator/openllet Openllet on Github: – Eric Jun 05 '19 at 15:43

1 Answers1

1

it seems like jena version > 3.0 is not compatible with pellet 2.4 or below. If you look into the dependencies of pellet.jena.PelletReasoner you will see that they use com.hp.hpl.jena . Jena 3.0 and above is in the package org.apache.jena. So, pellet dependencies are not up to date.

You may check out the pull request of oscii on github (here). He run into some errors, but they seem to affect the unit tests only. For me, it worked very well.

Stephan
  • 46
  • 2
  • So I can't use the current versions together? People that work with Jena and SWRL rules what kind of reasoner do they use? Maybe I should use OWL API instead? – Mandy Mar 26 '16 at 17:40
  • As far as I know, using Pellet is the only way to use SWRL in Jena. Moreover you may use the GeneralRuleReasoner to use jena-rules on RDFS graphs as described [here](https://jena.apache.org/documentation/inference/#rules). As I said, you can clone the repo of oscii and build pellet-jena by your self. It works very well with Jena 3.0 and above. – Stephan Mar 28 '16 at 08:30
  • Another comment on your first question: The .jar file you found in the protege folder is just the plugin for protege. You will have to build pellet-jena by your self. The easiest way is to build the whole project via maven (see m2e plugin for eclipse). --- To your comment: Yes, you can use OWL API for that. It's a matter of taste. I tested the performance and results of pellet under Jena and the OWL API and they are similiar. You can download the pellet-owl-api dependencies from [maven central](http://mvnrepository.com/artifact/com.github.ansell.pellet/pellet-owlapiv3/2.3.6-ansell). – Stephan Mar 30 '16 at 17:08