[英]Why does my OWL inferencer not give me the results I expected?
Hi Semantic Web folks, 嗨语义网的人,
I dont expect to have <rdf:type rdf:resource='#Tsunami'>
in the NamedIndividual: instance_Dromen after inferencing the below OWL code. 在推断下面的OWL代码之后,我不希望在NamedIndividual:instance_Dromen中有<rdf:type rdf:resource='#Tsunami'>
。 Somehow there is something wrong with the disjointness between #Huis and #Auto or maybe I dont use complementOf in the right way? 不知何故,#Huis和#Auto之间的脱节有什么问题,或者我可能不会以正确的方式使用complementOf? In the result of the inferencer the NamedIndividual: instance_Dromen has the following output: 在推理器的结果中,NamedIndividual:instance_Dromen具有以下输出:
-- -
<rdf:Description rdf:about="http://www.almfluss.com/rdf/0.1/Ontology.owl#instance_Dromen">
<owl:sameAs rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#instance_Dromen"/>
<rdf:type rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#Wielen"/>
<rdf:type rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#Auto"/>
<rdf:type rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#Onderstel"/>
<rdf:type rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#Tsunami"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
<rdf:type rdf:resource="http://www.almfluss.com/rdf/0.1/Ontology.owl#Dromen"/>
</rdf:Description>
The OWL code I use as input for the inferencer is: 我用作推理器输入的OWL代码是:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY swrl "http://www.w3.org/2003/11/swrl#" >
<!ENTITY swrlb "http://www.w3.org/2003/11/swrlb#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY Ontology201210 "http://www.almfluss.com/rdf/0.1/Ontology.owl#" >
]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.almfluss.com/rdf/0.1/Ontology.owl#"
xmlns:Ontology201210="http://www.almfluss.com/rdf/0.1/Ontology.owl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#"
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xml:base="http://www.almfluss.com/rdf/0.1/Ontology.owl#">
<owl:DatatypeProperty rdf:about="#hasValue"/>
<owl:Class rdf:about="#Dromen">
<owl:equivalentClass>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="#Huis"/>
<rdf:Description rdf:about="#Auto"/>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
<owl:equivalentClass>
<owl:Class>
<owl:complementOf rdf:resource="#Werkloos"/>
</owl:Class>
</owl:equivalentClass>
<owl:equivalentClass>
<owl:Class>
<owl:complementOf rdf:resource="#Arbeidsongeschikt"/>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<owl:NamedIndividual rdf:about="#instance_Dromen">
<rdf:type rdf:resource="#Wielen"/>
<rdf:type rdf:resource="#Onderstel"/>
</owl:NamedIndividual>
<owl:Class rdf:about="#Huis">
<owl:equivalentClass>
<owl:Class>
<owl:complementOf rdf:resource="#Tsunami"/>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<owl:NamedIndividual rdf:about="#instance_Huis"/>
<owl:Class rdf:about="#Auto">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="#Wielen"/>
<rdf:Description rdf:about="#Onderstel"/>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<owl:disjointWith rdf:resource="#Huis"/>
</owl:Class>
<owl:NamedIndividual rdf:about="#instance_Auto"/>
<owl:Class rdf:about="#Werkloos">
<owl:equivalentClass>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="#ZelfOntslag"/>
<rdf:Description rdf:about="#Ontslagen"/>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<owl:NamedIndividual rdf:about="#instance_Werkloos"/>
<owl:Class rdf:about="#Arbeidsongeschikt"/>
<owl:NamedIndividual rdf:about="#instance_Arbeidsongeschikt"/>
<owl:Class rdf:about="#Wielen"/>
<owl:NamedIndividual rdf:about="#instance_Wielen"/>
<owl:Class rdf:about="#Onderstel"/>
<owl:NamedIndividual rdf:about="#instance_Onderstel"/>
<owl:Class rdf:about="#Ontslagen"/>
<owl:NamedIndividual rdf:about="#instance_Ontslagen"/>
<owl:Class rdf:about="#ZelfOntslag"/>
<owl:NamedIndividual rdf:about="#instance_ZelfOntslag"/>
<owl:Class rdf:about="#Tsunami"/>
<owl:NamedIndividual rdf:about="#instance_Tsunami"/>
</rdf:RDF>
I hope somebody can help me. 我希望有人可以帮助我。
Thanks in advance. 提前致谢。
Regards, Martijn van der Plaat 此致,Martijn van der Plaat
Your ontology is quite a mess, for example, you've said that Auto is disjoint from Huis, but that Dromen is equivalent to the union of Huis & Auto. 你的本体论非常混乱,例如,你已经说过,Auto与Huis脱节,但是Dromen相当于Huis&Auto的联盟。
If you are writing it by hand, stop. 如果您是手工书写,请停止。 Go get Protege 4 and use it to author your ontology. 去获取Protege 4并用它来创作你的本体。 In addition to making it easier to write the ontology, it integrates with various reasoners so you can check consistency & satisfiability right in the GUI. 除了更容易编写本体之外,它还与各种reasoners集成,因此您可以在GUI中检查一致性和可满足性。 And you'll also be able to use the explanation facility to tell you why a particular inference was made. 而且您还可以使用解释工具来告诉您为何进行了特定的推断。
Lastly, it is almost always the case that you want subClassOf rather than equivalentTo. 最后,几乎总是需要subClassOf而不是equivalentTo。 Equivalence goes both ways in the relation, which is not often what the author intended. 对等在关系中是双向的,这通常不是作者的意图。
I agree with what @Michael wrote. 我同意@Michael所写的内容。 Just some general points about presenting OWL code as part of a (Stackoverflow) question: 关于将OWL代码作为(Stackoverflow)问题的一部分呈现的一些一般性观点:
After these changes you might be left with just a few lines of code and the problem with it might become immediately visible... 在这些更改之后,您可能只剩下几行代码,并且它的问题可能立即可见......
Your instance_Dromen
(call it i
from now on, for brevity) is defined to be of type Wielen
and of type Onderstel
. 您的instance_Dromen
(从现在开始称之为i
,为简洁起见)被定义为Wielen
类型和Onderstel
类型。 The reasoning that leads to it being of type Tsunami
is as follows: 导致它是Tsunami
类型的原因如下:
Auto
to be equivalent to the intersection of Wielen
and Onderstel
, therefore i
is inferred to be of type Auto
. 你已经将类Auto
定义为等同于Wielen
和Onderstel
的交集,因此i
推断它是Auto
类型。 i
is of type Auto
, we know it is not of type Huis
(since these two classes are defined as disjoint). 由于i
是Auto
类型,我们知道它不是Huis
类型(因为这两个类被定义为不相交)。 Tsunami
is defined as the complement of Huis
(that is, everything that is not a Huis
is a Tsunami
), and i
is not of type Huis
, we can infer that i
is a Tsunami
. 由于Tsunami
被定义为Huis
的补充(也就是说,所有不是Huis
都是Tsunami
),而且i
不是Huis
类型,我们可以推断出i
是Tsunami
。 Put more succinctly, the way your ontology is modeled leads to every Auto
being a Tsunami
. 更简洁地说,你的本体论建模方式导致每一个Auto
都是Tsunami
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.