不,你不能。您看到的 RDF 是 OWL 公理的编码,例如:EquivalentClasses(C ObjectSomeValuesFrom(p D))。它被编码为:
:C owl:equivalentClass [
rdf:type owl:Restriction;
owl:onProperty :p;
owl:someValuesFrom :D .
]
现在,假设您还有公理 EquivalentClasses(C ObjectSomeValuesFrom(r E))。这被编码为:
:C owl:equivalentClass [
rdf:type owl:Restriction;
owl:onProperty :r;
owl:someValuesFrom :E .
]
现在,如果你可以应用你想要的缩写,你会得到:
:C rdf:type owl:Restriction ;
owl:onProperty :p ;
owl:onProperty :r ;
owl:someValuesFrom :D ;
owl:someValuesFrom :E .
现在有歧义。 C等于以下哪一项?
- ObjectSomeValuesFrom(p D)
- ObjectSomeValuesFrom(p E)
- ObjectSomeValuesFrom(r D)
- ObjectSomeValuesFrom(r E)
仅从 RDF,您无法判断。您实际上需要对 EquivalentClasses 公理进行编码。
附录
解决 cmets 的问题:我使用 C、p 和 D 来缩短文本。你原来的 RDF sn-p 是公理的 RDF 编码
等效类(
示例:限制类
ObjectSomeValuesFrom(示例:resProp 示例:resValue)
)
原来如此
example:restrictionClass owl:equivalentClass [
rdf:type owl:Restriction;
owl:onProperty example:resProp;
owl:someValuesFrom example:resValue.
]
编码。 example:restrictionClass 在两个地方都是相同的 IRI。整个空白节点是类表达式ObjectSomeValuesFrom(example:resProp example:resValue)。然后 owl:equivalentClass 只是将两者联系起来。请注意,表达式是不一样的;它们表示的类是相同的。从 OWL 本体到 RDF 的映射在OWL 2 Web Ontology Language: Mapping to RDF Graphs (Second Edition) 中给出。具体来说,请查看2.1 Translation of Axioms without Annotations 中的表 1,您会在其中找到规则:
EquivalentClasses( CE1 ... CEn )
------------------------------------
T(CE1) owl:equivalentClass T(CE2) .
...
T(CEn-1) owl:equivalentClass T(CEn) .
和
ObjectSomeValuesFrom( OPE CE )
------------------------------
_:x rdf:type owl:Restriction .
_:x owl:onProperty T(OPE) .
_:x owl:someValuesFrom T(CE) .
当你往相反的方向走时,你可以读入 RDF 并重构你的公理。但是支持映射让你做你正在谈论的缩写,并且你有两个等效的类公理。你最终会得到模棱两可的 RDF,因为你会有 两个 owl:onProperty 三元组和两个 owl:someValuesFrom 三元组。
也许算术的一个例子会有所帮助。我们知道 4、2+2 和 1+3 都是表示相同数字的表达式。所以我们可以有公理:
现在假设我们在 RDF 中使用如下代码对其进行编码:
:four :equals [ rdf:type :sum ; :left :two ; :right :two ] .
:four :equals [ rdf:type :sum ; :left :one ; :right :three ] .
很好,我们可以从中重构 4 = 2+2 和 4 = 1+3。现在假设我们试图将这些属性移动到 :four,而不是与 :equals 相关的空白节点。我们最终会得到:
:four rdf:type :sum .
:four :left :two .
:four :right :two .
:four :left :one .
:four :right :three .
但这应该代表什么公理?您有四种方法可以从 :four 中选择左右。它应该对以下哪项进行编码?
- 4 = 2 + 2
- 4 = 2 + 3
- 4 = 1 + 2
- 4 = 1 + 3