首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用数值数据表达式定义蛋白质类

用数值数据表达式定义蛋白质类
EN

Stack Overflow用户
提问于 2015-03-24 08:53:55
回答 2查看 3.3K关注 0票数 3

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

我想给'RoomStatus‘子类下定义。例如,我想定义,当室温在18-22摄氏度,湿度在40-50%的范围内,那么房间就有一个温和的状态。我试着在Protege中使用类表达式编辑器,但它不起作用。

我怎样才能明白这个定义呢?提前感谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-03-24 13:52:47

Hatim's answer可能对您有用,但我认为,在不必使用的时候,最好不要使用等效的类公理,并且避免将温和的状态与特定的温度和湿度联系起来。毕竟,对于一个房间来说,它意味着一个温和的状态是非常不同的,因为它对桑拿来说意味着一个温和的状态。

我建议使用普通类公理来说明:

如果房间的温度和湿度在指定的范围内,那么就有一个温和的状态。

作为一个类公理,这是:

房间和 (hasTemperature a整数≥18,≤22) 和 (hasHumidity a整数≥40,≤50) 子类E 219 (hasStatus E 120valueE 221 Mild_Status)

这几乎就是你可以用抗议者写的:

下面是这个公理的本体(在RDF/XML和TTL中):

代码语言:javascript
复制
@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 .
代码语言:javascript
复制
<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>
票数 3
EN

Stack Overflow用户

发布于 2015-03-24 10:42:09

您可以使用Protege的类表达式编辑器来完成这个任务,但是有一些步骤需要遵循:

  1. 创建#Mild_status并使其成为subClassof #RoomStatus (正如我在编辑器中看到的那样)
  2. 您必须定义域和两个数据属性(摄氏度和湿度)的范围,例如,类#RoomStatus和xml数据类型整数作为域。所有这一切都可以通过抗议者来完成。

最后,使用类表达式编辑器:您必须断言#Mild_status等效于:

代码语言:javascript
复制
RoomStatus
 and (centigrade some integer[> 18])
 and (centigrade some integer[< 22])
 and (humidity some integer[> 40])
 and (humidity some integer[<50])

如果您想要使用这个表达式,例如检索推理:您必须知道并非所有的推理者都支持数据范围推理。小球支持这种表达,但我认为Fact++不支持。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29228328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档