问题
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?
回答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.
来源:https://stackoverflow.com/questions/36144230/how-to-correctly-import-pellet-2-3-0-in-jena-3-0-1-eclipse