OWL restrictions - defining classes that only contains properties with a specific property value

℡╲_俬逩灬. 提交于 2019-12-21 04:14:18

问题


I'm currently playing a bit with the OWL and especially with restrictions. I'm trying to create a query that does the following:

Suppose that I have a class 'Cinema' that has a property 'movies' (that contains objects of type 'Movie'). The class 'Movie' contains a property named 'genre'. Now I want to create a class ActionCinemas that only has movies with the genre 'action'.

I'm really not sure how to do this. I was thinking about doing something with intersections or the cardinality but I'm not sure of that.

Could anyone give me a hand in this?


回答1:


You need a combination of an allValuesFrom restriction and a hasValue restriction, e.g like this:

Turtle syntax:

 my:ActionCinema a owl:Class ;
      rdfs:subClassOf my:Cinema,
                      [ a owl:Restriction; 
                        owl:onProperty my:hasMovie ;
                        owl:allValuesFrom [ a owl:Restriction ; 
                                            owl:onProperty my:hasGenre ;
                                            owl:hasValue my:Action ]
                      ] .

Manchester OWL syntax:

Class: ActionCinema
   SubClassOf: Cinema that hasMovie only ( hasGenre value Action )


来源:https://stackoverflow.com/questions/13110845/owl-restrictions-defining-classes-that-only-contains-properties-with-a-specifi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!