简体   繁体   English

HermiT推理机显示错误结果

[英]HermiT Reasoner showing wrong result

I am new to OWL API. 我是OWL API的新手。 I am using OWL API vastly suggested documentation from here . 我从这里开始使用OWL API大量建议的文档。 I am using same famous Pizza.owl. 我正在使用相同的著名Pizza.owl。 Consider the following code snippet 考虑以下代码片段

OWLClass mozzarellaTopping = manager.getOWLDataFactory().getOWLClass(IRI.create(prefix + "CheeseyVegetableTopping"));  
OWLObjectProperty hasOrigin = manager.getOWLDataFactory().getOWLObjectProperty(IRI.create(prefix + "hasCountryOfOrigin"));  

if (hasProperty(manager, reasoner, mozzarellaTopping, hasOrigin)) 
    System.out.println("Instances of " + mozzarellaTopping  + " have a country of origin" + hasOrigin);  
else
    System.out.println("No country of origin does not exist");  

Now the "CheeseyVegetableTopping" does not have property "hasCountryOfOrigin" for sure but the if statement would printout following:- 现在,“ CheeseyVegetableTopping”没有确定的属性“ hasCountryOfOrigin”,但是if语句将输出以下内容:

Instances of <http://localhost:3030/Pizza.owl#CheeseyVegetableTopping> have a country of origin<http://localhost:3030/Pizza.owl#hasCountryOfOrigin>

No matter which Pizza i used in the reasoner, it would not go in the else of the if shown above. 无论我在推理机中使用哪个比萨饼,都不会出现在上面显示的其他比萨饼中。 Means the hasProperty function would return true no matter the property exist or not. 意味着无论属性是否存在,hasProperty函数都将返回true。 The helper hasProperty has been used exactly the same from OWL-API-documentation . 辅助工具hasProperty的使用与OWL-API-documentation中的用法完全相同。 I dont know should i have copied that here or not. 我不知道我应该在这里复制还是不复制。 I am not copying to keep the things simple. 我不是为了简化事情而复制。 Thanks in advance. 提前致谢。

In this case, you need to take a closer look at pizza.owl: 在这种情况下,您需要仔细查看pizza.owl:

<owl:Class rdf:about="#CheeseyVegetableTopping">
    <rdfs:label xml:lang="pt"
        >CoberturaDeQueijoComVegetais</rdfs:label>
    <rdfs:comment xml:lang="en"
        >This class will be inconsistent. This is because we have given it 2 disjoint parents, which means it could never have any members (as nothing can simultaneously be a CheeseTopping and a VegetableTopping). NB Called ProbeInconsistentTopping in the ProtegeOWL Tutorial.</rdfs:comment>
    <rdfs:subClassOf>
        <owl:Class rdf:about="#CheeseTopping"/>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
        <owl:Class rdf:about="#VegetableTopping"/>
    </rdfs:subClassOf>
</owl:Class>

Note that CheeseyVegetableTopping is inconsistent . 请注意, CheeseyVegetableTopping不一致的 That means that there can be no instances of it. 这意味着不可能有任何实例。 It's vacuously true that every CheesesyVegetableTopping must have country of origin because there are no counterexamples. 毫无疑问 ,每个CheesesyVegetableTopping必须具有原产国,因为没有反例。 That is, there are no cheesey vegetable toppings that don't have a country of origin. 也就是说,有没有没有来源国cheesey蔬菜浇头。

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

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