如何在Jena 3.0.1(Eclipse)中正确导入Pellet 2.3.0? [英] How to correctly import Pellet 2.3.0 in Jena 3.0.1 (Eclipse)?

查看:595
本文介绍了如何在Jena 3.0.1(Eclipse)中正确导入Pellet 2.3.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Jena 3.0.1中导入Pellet 2.3.0推理器(在Eclipse中工作)。为此,我已经阅读了所有类似的问题(尽管有些已经过时了)和Apache Jena网站上的FAQ。使用他们的代码,我总是在以下行中出现错误:



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



杰娜工作正常,我已经测试了。我猜想我没有为Pellet导入正确的jar文件。我从GitHub克隆了整个Pellet存储库,发现唯一的jar文件是Protege文件夹中的一个。将光标移动到带下划线的文本中,Eclipse会让我导入一些东西,但问题依然存在。是否该jar是负责该错误还是别的东西?

解决方案

看起来像jena版本> 3.0不兼容小丸2.4或以下。如果您查看pellet.jena.PelletReasoner的依赖关系,您将看到它们使用com.hp.hpl.jena。 Jena 3.0及以上版本在包org.apache.jena中。因此,粒子依赖关系不是最新的。



您可以在github上查看oscii的提取请求( here )。他遇到一些错误,但它们似乎只影响单元测试。对我来说,它工作得很好。


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?

解决方案

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.

这篇关于如何在Jena 3.0.1(Eclipse)中正确导入Pellet 2.3.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆