How to correctly import Pellet 2.3.0 in Jena 3.0.1 (Eclipse)?

余生长醉 提交于 2020-01-06 01:59:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!