OWL限制-定义仅包含具有特定属性值的属性的类 [英] OWL restrictions - defining classes that only contains properties with a specific property value
问题描述
我目前正在与OWL合作,尤其是在限制方面.我正在尝试创建一个执行以下操作的查询:
I'm currently playing a bit with the OWL and especially with restrictions. I'm trying to create a query that does the following:
假设我有一个具有属性电影"的电影院"类(其中包含电影"类型的对象). 电影"类包含一个名为流派"的属性.现在,我想创建一个仅包含类型为动作"的电影的ActionCinemas类.
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.
有人可以帮我吗?
推荐答案
您需要组合allValuesFrom限制和hasValue限制,例如:
You need a combination of an allValuesFrom restriction and a hasValue restriction, e.g like this:
海龟语法:
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 ]
] .
曼彻斯特OWL语法:
Class: ActionCinema
SubClassOf: Cinema that hasMovie only ( hasGenre value Action )
这篇关于OWL限制-定义仅包含具有特定属性值的属性的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!