创建 HermiT 实例时出现 NoSuchMethodError

NoSuchMethodError while creating HermiT instance

我正在尝试创建 HermiT reasoner 的实例,但控制台继续显示异常 "noSuchMethodError"。

具体来说,这是来自 java 控制台的错误:

Caused by: java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntologyID.getDefaultDocumentIRI()Ljava/util/Optional;
at org.semanticweb.HermiT.structural.OWLClausification.preprocessAndClausify(OWLClausification.java:77)
at org.semanticweb.HermiT.Reasoner.loadOntology(Reasoner.java:214)
at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:205)
at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:179)
at org.semanticweb.HermiT.ReasonerFactory.createHermiTOWLReasoner(ReasonerFactory.java:51)
at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:19)
at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:15)
at org.processmining.plugins.myminer.knowledge.OWLOntologia.retrieve_property_class(OWLOntologia.java:76)
at org.processmining.plugins.myminer.knowledge.OntologyVisualizer.visualize(OntologyVisualizer.java:39)
... 13 more

我已经导入了 HermiT(版本 1.4.3.517)所需的所有依赖项,这就是创建 ReasonerFactory 的行:

OWLReasonerFactory reasonerFactory = new ReasonerFactory();

错误的行是:

OWLReasoner hermit = reasonerFactory.createReasoner(ontology);

如控制台所说。

不明白为什么创建不了实例,为什么会抛出Exception

我决定更新到 owl-api 和 hermit 的最新版本,版本是使用 maven 中央存储库找到的。