考虑一下OWL中有类A和B。存在两个不同的对象属性P1和P2,它们的范围分别是类C和域A和B。
我想创建一个类D,它表示包含对象属性P1的任何a,其值等于B包含的任何对象属性P2。
有可能用OWL来描述这一点吗?
我想创建一个类D,它表示包含其值等于任何对象特性P2的对象特性P1B.包含
我认为您正在寻找这样的类表达式(在DL和Manchester语法中):
D≡A&sqcap&存在 p1。(∃&shinsp;p2-1.B)
D等价类(A和
这意味着某个东西是D当且仅当它是a,并且对p1有一些值,即B的某个实例的p2值。
如果p1和p2的域分别是A和B,那么你实际上可以将其简化为:
D≡存在 p1&存在 p2-1
D等价类p1一些(逆)(p2)某些事物)
以下是OWL的N3RDF序列化中的第一个。
@prefix : <http://stackoverflow.com/q/28506192/1281433/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:A a owl:Class .
:B a owl:Class .
:p a owl:ObjectProperty .
:q a owl:ObjectProperty .
:D a owl:Class ;
owl:equivalentClass [ a owl:Class ;
owl:intersectionOf ( :A _:b0 )
] .
_:b0 a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom [ a owl:Restriction ;
owl:onProperty [ owl:inverseOf :q ] ;
owl:someValuesFrom :B
] .
如果你有域和范围公理,这样你就可以使用更简单的形式,那就是:
@prefix : <http://stackoverflow.com/q/28506192/1281433/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:A a owl:Class .
:B a owl:Class .
:p a owl:ObjectProperty ;
rdfs:domain :A .
:q a owl:ObjectProperty ;
rdfs:domain :B .
:D a owl:Class ;
owl:equivalentClass [ a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom [ a owl:Restriction ;
owl:onProperty [ owl:inverseOf :q ] ;
owl:someValuesFrom owl:Thing
]
] .