假设你的目标是: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 .
: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 ] 。
: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 .