我正在构建一个智能的家庭本体。现在我有了这样的类层次结构:

我想给'RoomStatus‘子类下定义。例如,我想定义,当室温在18-22摄氏度,湿度在40-50%的范围内,那么房间就有一个温和的状态。我试着在Protege中使用类表达式编辑器,但它不起作用。
我怎样才能明白这个定义呢?提前感谢!
发布于 2015-03-24 13:52:47
Hatim's answer可能对您有用,但我认为,在不必使用的时候,最好不要使用等效的类公理,并且避免将温和的状态与特定的温度和湿度联系起来。毕竟,对于一个房间来说,它意味着一个温和的状态是非常不同的,因为它对桑拿来说意味着一个温和的状态。
我建议使用普通类公理来说明:
如果房间的温度和湿度在指定的范围内,那么就有一个温和的状态。
作为一个类公理,这是:
房间和 (hasTemperature a整数≥18,≤22) 和 (hasHumidity a整数≥40,≤50) 子类
E 219(hasStatusE 120valueE 221 Mild_Status)
这几乎就是你可以用抗议者写的:

下面是这个公理的本体(在RDF/XML和TTL中):
@prefix : <https://stackoverflow.com/q/29228328/1281433/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
: a owl:Ontology .
:Room a owl:Class .
:Status a owl:Class .
:Mild_Status a owl:NamedIndividual , :Status .
:hasStatus a owl:ObjectProperty .
:hasTemperature a owl:DatatypeProperty .
:hasHumidity a owl:DatatypeProperty .
[ a owl:Class ;
rdfs:subClassOf [ a owl:Restriction ;
owl:hasValue :Mild_Status ;
owl:onProperty :hasStatus
] ;
owl:intersectionOf ( :Room _:b2 _:b3 )
] .
_:b3 a owl:Restriction ;
owl:onProperty :hasTemperature ;
owl:someValuesFrom [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( _:b0 _:b4 )
] .
_:b0 xsd:minInclusive 18 .
_:b4 xsd:maxInclusive 22 .
_:b2 a owl:Restriction ;
owl:onProperty :hasHumidity ;
owl:someValuesFrom [ a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions ( _:b5 _:b1 )
] .
_:b1 xsd:minInclusive 40 .
_:b5 xsd:maxInclusive 50 .<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns="https://stackoverflow.com/q/29228328/1281433/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="https://stackoverflow.com/q/29228328/1281433/"/>
<owl:Class rdf:about="https://stackoverflow.com/q/29228328/1281433/Room"/>
<owl:Class rdf:about="https://stackoverflow.com/q/29228328/1281433/Status"/>
<owl:Class>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="https://stackoverflow.com/q/29228328/1281433/hasStatus"/>
</owl:onProperty>
<owl:hasValue>
<owl:NamedIndividual rdf:about="https://stackoverflow.com/q/29228328/1281433/Mild_Status">
<rdf:type rdf:resource="https://stackoverflow.com/q/29228328/1281433/Status"/>
</owl:NamedIndividual>
</owl:hasValue>
</owl:Restriction>
</rdfs:subClassOf>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="https://stackoverflow.com/q/29228328/1281433/Room"/>
<owl:Restriction>
<owl:onProperty>
<owl:DatatypeProperty rdf:about="https://stackoverflow.com/q/29228328/1281433/hasHumidity"/>
</owl:onProperty>
<owl:someValuesFrom>
<rdfs:Datatype>
<owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:maxInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>50</xsd:maxInclusive>
</rdf:Description>
<rdf:Description>
<xsd:minInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>40</xsd:minInclusive>
</rdf:Description>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:someValuesFrom>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty>
<owl:DatatypeProperty rdf:about="https://stackoverflow.com/q/29228328/1281433/hasTemperature"/>
</owl:onProperty>
<owl:someValuesFrom>
<rdfs:Datatype>
<owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:minInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>18</xsd:minInclusive>
</rdf:Description>
<rdf:Description>
<xsd:maxInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>22</xsd:maxInclusive>
</rdf:Description>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:someValuesFrom>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</rdf:RDF>发布于 2015-03-24 10:42:09
您可以使用Protege的类表达式编辑器来完成这个任务,但是有一些步骤需要遵循:
最后,使用类表达式编辑器:您必须断言#Mild_status等效于:
RoomStatus
and (centigrade some integer[> 18])
and (centigrade some integer[< 22])
and (humidity some integer[> 40])
and (humidity some integer[<50])如果您想要使用这个表达式,例如检索推理:您必须知道并非所有的推理者都支持数据范围推理。小球支持这种表达,但我认为Fact++不支持。
https://stackoverflow.com/questions/29228328
复制相似问题