简体   繁体   English

为什么我的OWL推理器没有给我我预期的结果?

[英]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)问题的一部分呈现的一些一般性观点:

  • use a human readable syntax, ie avoid XML and avoid RDF (you used both...) since both are unnecessarily verbose for a human-human communication 使用人类可读的语法,即避免使用XML并避免使用RDF(您同时使用了两种语言),因为两者对于人与人之间的沟通都是不必要的冗长
  • explain your intention behind each axiom in plain English 用简单的英语解释每个公理背后的意图
  • use English entity names (Dutch is not widely spoken among Stackoverflow users) 使用英文实体名称(Stackoverflow用户之间没有广泛使用荷兰语)
  • remove stuff that is irrelevant (eg SWRL namespace prefixes in this case) 删除无关的东西(例如,在这种情况下为SWRL名称空间前缀)

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类型的原因如下:

  1. you have defined the class Auto to be equivalent to the intersection of Wielen and Onderstel , therefore i is inferred to be of type Auto . 你已经将类Auto定义为等同于WielenOnderstel的交集,因此i推断它是Auto类型。
  2. Since i is of type Auto , we know it is not of type Huis (since these two classes are defined as disjoint). 由于iAuto类型,我们知道它不是Huis类型(因为这两个类被定义为不相交)。
  3. Since 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类型,我们可以推断出iTsunami

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.

相关问题 为什么jquery会给我这个代码一个“选择器未定义”的错误? - Why does jquery give me a “selector is undefined” error for this code? 为什么此XSLT无法生成预期的输出? - Why does this XSLT not generate my expected output? 为什么XML :: LibXML :: Document的toString()给我“ SCALAR(…)”而不是XML字符串? - Why does XML::LibXML::Document's toString() give me “SCALAR(…)” instead of an XML string? 为什么TinyXPath在两个不同的类中调用时会为同一个对象提供不同的结果? - Why does TinyXPath give different results for the same object when called in two different classes? 当我在字符串中插入XML Soap请求时,为什么Eclipse给我一个错误? - Why Eclipse give me an error when I insert this XML Soap request inside a String? 我可以使我的XML Schema(XSD)为我提供带有* any *名称的元素的VS Intellisense吗? - Can I make my XML Schema (XSD) give me VS Intellisense with elements that have *any* name? 为什么Xquery给我变量一个错误? 一世 - Why is Xquery giving me an error on my variable? I 我的重写规则给了我500。怎么了? - My rewrite rule give me a 500. What is wrong? Python lxml XPath:前面的关键字未给出预期的结果 - Python lxml XPath : preceding keyword does not give expected result 我正在尝试使用 lua 单循环工作解析 XML 文件,但嵌套循环没有给出预期的结果 - I'm trying to parse an XML file using lua single loop works, but nested loop does not give the expected result
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM