如何指定属性的“任何”值?

时间:2018-12-01 19:04:09

标签: sparql owl ontology protege

我为类“ CategoryHierarchy”分配了一个限制“ hasOpeningTime”。

https://fullcalendar.io/docs/agendaEventMinHeight

这意味着“ CategoryHierarchy”类的所有个人都必须指定属性“ hasOpeningTime”。 有以下关系:

CategoryHierarchy -> hasOpeningTime > Season

“季节”类具有以下子类:

spring
summer
autumn
winter

例如,MountainSnowSports-> hasOpeningTime->冬天。

但是,有许多类别可以分配给任何季节。例如,“电影院”类别的个人应该有任何季节。 创建此类人员时该如何指定?

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 .
}  

1 个答案:

答案 0 :(得分:0)

阅读AKSW的注释后,添加CinemasTheatres实例多个季节的解决方案如下:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX test: <http://test.com/my-ontology.owl#> 

INSERT DATA { 
  test:act_1 rdf:type test: CinemasTheatres . 
  test:act_1 test:hasOpeningTime test:spring .
  test:act_1 test:hasOpeningTime test:summer .
  test:act_1 test:hasOpeningTime test:autumn .
  test:act_1 test:hasOpeningTime test:winter .
}