目前还不完全清楚你的意思是让两个属性un-相等。默认情况下,两个属性可以是不同的,因此您实际上不需要做任何特殊的事情来让它们不相等。不过,如果问题得到澄清,或许可以添加更多相关信息。
这样说并不完全是微不足道的,例如,
∀a,x 。 A(a) → (hasFinish(a,x) ⇔ hasColor(a,x))
在 OWL 中,但你可以做到。如果您想对所有课程都这么说,正如您所指出的,您可以使用owl:equivalentProperty。现在,当你说 p 是 r 的等价属性时,你也可以这样说
p ⊑ r
r ⊑ p
也就是说,p 和r 都是另一个的子属性。在 OWL 2 中(但不幸的是,不是 OWL 2 DL,正如 Antoine Zimmermann 在 cmets 中指出的那样),您可以断言给定属性是 chain 的超属性属性,例如,
hasFather •有兄弟⊑有叔叔
这就是说,如果一个人的父亲有一个兄弟,那么那个父亲的兄弟就是那个人的叔叔。
还有一个叫做 rolification 的概念,在OWL 2 rolification 中有更多描述,它是创建一个对应于一个类的属性的过程,该类将该类的每个个体与其自身相关联。对于你的 A 类,会有一个关系 RA 将每个 A 与自身相关联,并且只关联那些事例。如果你再看看像
这样的属性链
RA •已完成
您会注意到它实际上是 hasFinish 的子属性,其中第一个参数是 A。这意味着你可以说 hasFinish 和 hasColor 对于类 A 来说是相同的,通过进行两个子属性断言:
RA • hasColor ⊑已完成
RA • hasFinish ⊑有颜色
这些假设 A 类个人是这些陈述的主题。如果 A 实际上是这里的范围,那么您只需使用
∀a,x 。 A(a) → (hasFinish(x,a) ⇔ hasColor(x,a))
hasColor • RA ⊑已完成
hasFinish • RA ⊑有颜色
要获取属性RA,需要添加定义
A ≡ ∃RA.Self
到你的本体。在 Protégé 中,这看起来像:
生成的本体看起来像(在 RDF/XML 中):
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns="http://example.org/ep#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://example.org/ep"/>
<owl:Class rdf:about="http://example.org/ep#A">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
</owl:onProperty>
<owl:hasSelf rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>true</owl:hasSelf>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
<owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish">
<owl:propertyChainAxiom rdf:parseType="Collection">
<owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
<owl:ObjectProperty rdf:about="http://example.org/ep#hasColor"/>
</owl:propertyChainAxiom>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://example.org/ep#hasColor">
<owl:propertyChainAxiom rdf:parseType="Collection">
<owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/>
<owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish"/>
</owl:propertyChainAxiom>
</owl:ObjectProperty>
</rdf:RDF>
在海龟中:
@prefix : <http://example.org/ep#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:hasFinish a owl:ObjectProperty ;
owl:propertyChainAxiom ( :R_A :hasColor ) .
:A a owl:Class ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_A
] .
:hasColor a owl:ObjectProperty ;
owl:propertyChainAxiom ( :R_A :hasFinish ) .
<http://example.org/ep>
a owl:Ontology .
:R_A a owl:ObjectProperty .