当我尝试让Pellet使用OWL API时如何解决这个AbstractMethodError?

时间:2018-07-12 19:25:33

标签: owl protege pellet

我收到此错误:

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正常工作?我不确定如何解决此错误。

1 个答案:

答案 0 :(得分:2)

您正在使用OWLAPI 5运行Pellet。Pellet没有与owlapi 5兼容的发行版,您需要使用最新的Openllet发行版。