在下面的设计示例中,我有一个类
:Car
和一个对象属性:hasCarType
。在 :Car
的定义中,我想使用类 :hasCarType
.指定对
:CarType
的通用属性限制
凭直觉,我也想说
:hasCarType
有一个域:Car
和一个范围:CarType
.
但是,如果我说 either
:hasCarType rdfs:domain :Car
或 :hasCarType rdfs:range :CarType
,我会得到不需要的推论。即,本体中的every类被推断为类表达式'has car type' only CarType
的子类。如果我删除域/范围(或者说,删除域并将范围更改为其他内容,例如:hasCarType rdfs:range skos:Concept
),那么不需要的推论就会消失(即类表达式的唯一子类是:Car
) .如何解释域/范围与通用属性限制之间的这种相互作用? Protégé 中的默认解释并不是特别有启发性。例子:
Explanation for: Appellation SubClassOf 'has car type' only CarType
1) 'has car type' Range CarType
Protégé 使用 HermiT 推理器的结果:
@prefix : <urn:example/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
:hasCarType rdf:type owl:ObjectProperty ;
rdfs:domain :Car ;
rdfs:range :CarType ;
rdfs:label "has car type" .
:CarType rdf:type owl:Class ; rdfs:subClassOf skos:Concept .
:Car rdf:type owl:Class ;
owl:equivalentClass [ owl:intersectionOf ( [ rdf:type owl:Class ;
owl:unionOf ( :FourWheeledVehicle
:MotorVehicle
)
]
[ rdf:type owl:Restriction ;
owl:onProperty :hasCarType ;
owl:allValuesFrom :CarType
]
) ;
rdf:type owl:Class
] ;
rdfs:label "Car" .
:car1 rdf:type owl:NamedIndividual ,
:Car ;
:name [ rdf:type :Appellation ;
:content "My car"
] .