OWL API NoSuchMethodError

OWL API NoSuchMethodError

我正在使用使用 OWL API 4.1.3 的 logmap,在编译时出现以下错误:

Exception in thread "main" java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntologyID.getOntologyIRI()Lcom/google/common/base/Optional;
    at uk.ac.ox.krr.logmap2.OntologyLoader.setOWLOntology(OntologyLoader.java:150)
    at uk.ac.ox.krr.logmap2.OntologyLoader.<init>(OntologyLoader.java:113)
    at uk.ac.ox.krr.logmap2.overlapping.LexicalOverlappingExtractor.createOverlapping(LexicalOverlappingExtractor.java:156)
    at uk.ac.ox.krr.logmap2.overlapping.LexicalOverlappingExtractor.createOverlapping(LexicalOverlappingExtractor.java:131)
    at uk.ac.ox.krr.logmap2.LogMap2Core.OverlappingEstimation(LogMap2Core.java:873)
    at uk.ac.ox.krr.logmap2.LogMap2Core.<init>(LogMap2Core.java:293)
    at uk.ac.ox.krr.logmap2.LogMap2Core.<init>(LogMap2Core.java:240)
    at uk.ac.ox.krr.logmap2.LogMap2_Matcher.<init>(LogMap2_Matcher.java:145)
    at Alignment.LogMap.LogMapAligner.getAlignment(LogMapAligner.java:40)
    at Main.main(Main.java:50)

您的类路径中有多个 OWLAPI 版本。确保只有一个,并且是与您正在使用的所有库兼容的版本。