简体   繁体   English

在Java中使用Opencyc猫头鹰时出现DisjointClasses错误

[英]DisjointClasses error while using opencyc owl in java

I'm currently working on a natural language processing project attempting to use openCYC as a KB. 我目前正在从事一个自然语言处理项目,试图将openCYC用作KB。 At the moment I'm simply trying to load the ontology and instantiate a reasoner using the java owl api v3.4.8 and HermiT, however whenever I try to instantiate the reasoner I get the error 目前,我只是尝试使用Java owl api v3.4.8和HermiT加载本体并实例化推理程序,但是每当我尝试实例化推理程序时,我都会收到错误消息

Exception in thread "main" java.lang.IllegalArgumentException: Error: Parsed DisjointClasses( http://sw.opencyc.org/concept/Mx4rEHSj4Q0sQVGnAmZNRRJ20Q ). 线程“主”中的异常java.lang.IllegalArgumentException:错误:解析了DisjointClasses( http://sw.opencyc.org/concept/Mx4rEHSj4Q0sQVGnAmZNRRJ20Q )。

current code: 当前代码:

File ontology = new File("owl-export-unversioned.owl");

    OWLOntologyManager m = OWLManager.createOWLOntologyManager();

    System.out.println("Loading...");
    OWLOntology o = m.loadOntologyFromOntologyDocument(ontology);
    System.out.println("Loaded");

    Reasoner hermit=new Reasoner(o);
    System.out.println(hermit.isConsistent());

Does this mean there is a problem with the opencyc ontology itself? 这是否意味着opencyc本体本身存在问题? Or am I doing something wrong? 还是我做错了什么?

The problem is that openCyc contains an erroneous axiom: a DisjointClasses with only one argument. 问题是openCyc包含一个错误的公理:仅具有一个参数的DisjointClasses The OWL specs specify that DisjointClasses must have two or more arguments. OWL规范指定DisjointClasses必须具有两个或更多参数。

The OWL API will let you parse this ontology, but HermiT will complain about this axiom, and possibly more. OWL API使您可以解析此本体,但是HermiT会抱怨这种公理,甚至更多。

You can use OWL2DLProfile to check which axioms are violating the OWL 2 DL profile. 您可以使用OWL2DLProfile检查哪些公理违反了OWL 2 DL配置文件。 This will report other erroneous axioms of the same type. 这将报告其他相同类型的错误公理。 You will have to decide yourself what is the correct solution, though - the OWL API does not have a fixing implementation yet. 但是,您将必须决定自己是正确的解决方案-OWL API尚无固定的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM