我正在尝试创建HermiT推理机的实例,但是控制台继续显示异常“ 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);
如控制台所说。
我不明白为什么无法创建实例以及为何引发异常。
答案 0 :(得分:1)
我决定将owl-api和hermit更新为最新版本,使用maven中央存储库发现了这些版本。