【发布时间】:2018-07-12 19:25:33
【问题描述】:
我收到此错误:
Exception in thread "main" java.lang.AbstractMethodError
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.lambda$loadFactories$1(OWLAPIServiceLoaderModule.java:97)
at java.util.ArrayList.forEach(Unknown Source)
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.loadFactories(OWLAPIServiceLoaderModule.java:95)
at org.semanticweb.owlapi.OWLAPIServiceLoaderModule.configure(OWLAPIServiceLoaderModule.java:52)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
at com.google.inject.spi.Elements.getElements(Elements.java:110)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.semanticweb.owlapi.apibinding.OWLManager.createInjector(OWLManager.java:104)
at org.semanticweb.owlapi.apibinding.OWLManager.getOWLDataFactory(OWLManager.java:63)
at OntController.<init>(OntController.java:86)
at Driver.main(Driver.java:9)
每当我尝试使用 OWLManager 时,即 df = OWLManager.getOWLDataFactory(); 或 manager = OWLManager.createOWLOntologyManager();。
我注意到自从我通过 maven 导入 Pellet 后,这个错误就开始出现了。这是我的 pom.xml 中的依赖标记:
<dependency>
<groupId>com.github.ansell.pellet</groupId>
<artifactId>pellet-owlapiv3</artifactId>
<version>2.3.3</version>
</dependency>
有没有办法让 Pellet 和最新版本的 OWL API 工作?我不确定如何解决此错误。
【问题讨论】:
-
名字是
pellet-owlapiv3- 这是什么意思?是的,它基于 OWL API v3……这不是很明显吗?接下来,我不知道您使用的是哪个版本...但 google 是您的朋友:github.com/owlcs/owlapi/wiki/… 您可以在那里找到 Pellet for OWL API v4 的链接。对于 OWL API,我使用了 google...github.com/Galigator/openllet