[英]HermiT Reasoner showing wrong result
我是OWL API的新手。 我從這里開始使用OWL API大量建議的文檔。 我正在使用相同的著名Pizza.owl。 考慮以下代碼片段
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");
現在,“ CheeseyVegetableTopping”沒有確定的屬性“ hasCountryOfOrigin”,但是if語句將輸出以下內容:
Instances of <http://localhost:3030/Pizza.owl#CheeseyVegetableTopping> have a country of origin<http://localhost:3030/Pizza.owl#hasCountryOfOrigin>
無論我在推理機中使用哪個比薩餅,都不會出現在上面顯示的其他比薩餅中。 意味着無論屬性是否存在,hasProperty函數都將返回true。 輔助工具hasProperty的使用與OWL-API-documentation中的用法完全相同。 我不知道我應該在這里復制還是不復制。 我不是為了簡化事情而復制。 提前致謝。
在這種情況下,您需要仔細查看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>
請注意, CheeseyVegetableTopping是不一致的 。 這意味着不可能有任何實例。 毫無疑問 ,每個CheesesyVegetableTopping必須具有原產國,因為沒有反例。 也就是說,有沒有沒有來源國cheesey蔬菜澆頭。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.