3

我想设计一个对象属性,它总是只在同一级别的类之间链接。例如,

在此处输入图像描述

我想将属性限制为isCounterPartOf属于同一上层类的兄弟节点的弧,例如

house isCounterPartOf cars
bad isCounterPartOf good
slow isCounterPartOf fast

并且该属性不应在不同级别的类(具有不同祖先的类)之间链接,例如

cars isCounterPartOf bad
cars isCounterPartOf object
cars isCounterPartOf Entity

有没有办法只定义一个属性来做到这一点?

4

1 回答 1

3

假设你的目标是:isCounterPartOf链接两个人,一个是eg的成员:Bad,那么另一个应该归类为:Good,你不需要定义域和范围:isCounterPartOf,就是它owl:SymmetricProperty。您只需要分别定义您的类,:Bad使其等价于:isCounterPartOf some :Good:Good等价于:isCounterPartOf some :Bad,以及分别为所有“对”类。

那么如果:

:A :isCounterPartOf :B

:C :isCounterPartOf :B

:A a :Slow

:C a :Bad

那么:B将被分类为:Fast:Good

澄清(基于评论)

在上面的示例中,1.:isCouterPartOf是一个对称对象属性:

:isCounterPartOf rdf:type owl:ObjectProperty ,
                          owl:SymmetricProperty .
  1. :Good, :Bad,:Slow:Fast是 OWL 类,其中:( 不知道为什么代码格式化不起作用)

    :Bad rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; 猫头鹰:onProperty:isCounterPartOf;owl:someValuesFrom :Good ] 。

    :Fast rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; 猫头鹰:onProperty:isCounterPartOf;owl:someValuesFrom :Slow ] 。

    :Good rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; 猫头鹰:onProperty:isCounterPartOf;owl:someValuesFrom :Bad ] 。

    :Slow rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; 猫头鹰:onProperty:isCounterPartOf;owl:someValuesFrom :Fast ] 。

  2. :A, :B, 和:C是个人,据此断言:( 同样,不知道为什么代码格式化不起作用)

    :A rdf:type owl:NamedIndividual , :Slow ;

    :isCounterPartOf :B。

    :B rdf:type owl:NamedIndividual , owl:Thing 。

    :C rdf:type owl:NamedIndividual , :Bad ;
    :isCounterPartOf :B。

基于这些断言,当您运行推理器时,您将遇到以下情况:

:A rdf:type owl:NamedIndividual ,
            :Bad , #inferred
            :Slow ;

   :isCounterPartOf :B .

:B rdf:type owl:NamedIndividual ,
            :Fast , #inferred
            :Good , #inferred
            owl:Thing ;

   :isCounterPartOf :A , #inferred
                    :C . #inferred

:C rdf:type owl:NamedIndividual ,
            :Bad ,
            :Slow ; #inferred

   :isCounterPartOf :B .
于 2016-05-09T06:02:02.940 回答