这意味着“CategoryHierarchy”类的所有个体都必须指定“hasOpeningTime”属性。
存在以下关系:
CategoryHierarchy -> hasOpeningTime > Season
“季节”类有以下子类:
spring
summer
autumn
winter
但是,有许多类别可以分配给任何季节。例如,属于“电影鉴赏家”类别的个人应该有任何季节。
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://test.com/my-ontology.owl#>
INSERT {
owl:act_1 rdf:type owl: CinemasTheatres .
owl:act_1 owl:hasOpeningTime owl:* . // ???
}
WHERE {
FILTER NOT EXISTS {
owl:act_1 rdf:type owl: CinemasTheatres .
}
}
更新:
CinemasTheatres
将是:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://test.com/my-ontology.owl#>
INSERT DATA {
owl:act_1 rdf:type owl: CinemasTheatres .
owl:act_1 owl:hasOpeningTime owl:spring .
owl:act_1 owl:hasOpeningTime owl:summer .
owl:act_1 owl:hasOpeningTime owl:autumn .
owl:act_1 owl:hasOpeningTime owl:winter .
}