问题描述
我在本体中填充了定义Hour的数据.现在,我想对定义为int且值为0-23的特定数据类型(小时)进行限制.可以在白天和夜晚的小时划分上设置限制,例如,将天(小时最小6整数)和(小时最大17整数)划分为一天,并将其定义为对象Property isDay,但是问题是推论没有发生.先感谢您,艾略特
I have populated my ontology with data defining among others Hour. Now, I want to make a restriction on that specific datatype (hour) which is defined as int and has values from 0-23. The restriction would be set on the division of the hour according to day and night for example (hour min 6 int) and (hour max 17 int) for the day and that defined as object Property isDay, but the problem is the inferences does not happen.Thank you in advance,Eliot
推荐答案
您可以创建:DayEvent
类作为:Event
的子类,然后对要指定为以下范围的范围的dataType属性:hour
声明限制.时段,例如6< = DayEvent hour< = 17,这种方式:
You can create a :DayEvent
class as subclass of :Event
and then declare restriction on the dataType property :hour
for the range you want to specify as day slot, say 6 <= DayEvent hour <=17, this way:
:DayEvent rdf:type owl:Class ;
owl:equivalentClass [
rdf:type owl:Restriction ;
owl:onProperty :hour ;
owl:someValuesFrom [ rdf:type rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions (
[ xsd:minInclusive 6]
[ xsd:maxInclusive 17]
)
]
] ;
rdfs:subClassOf :Event .
然后,所有具有dataType属性:hour
且值在指定范围内的个人都将被推断为:DayEvent
的成员.
Then all individuals with dataType property :hour
having values within the specified range will be inferred as members of :DayEvent
.
这至少可以与Protégé4.3和5,推理机HermiT,FaCT ++和Pallet一起使用.
This would work at least with Protégé 4.3 and 5, with reasoners HermiT, FaCT++ and Pallet.
等效的类定义将以Protégé语法显示,如下所示:hour some xsd:integer[>= 6 , <= 17]
.
The equivalent class definition will look in Protégé syntax like this: hour some xsd:integer[>= 6 , <= 17]
.
这篇关于Protege数据类型限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!