首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为数据类型属性在Protege中定义DataRange表达式

为数据类型属性在Protege中定义DataRange表达式
EN

Stack Overflow用户
提问于 2014-07-02 13:08:03
回答 2查看 13.8K关注 0票数 11

我是添加了几个新的DataType在猫头鹰使用蛋白酶。

DataType类似于百分比,我希望指定它的范围,其双值范围为0到100。

类似地,一个名为DataType的Quality,我希望指定它的范围,其双值范围为0到1。

如何在数据范围表达式中指定这些内容?

我试图找出,但我发现两个联系,但没有用在我的上下文。

  1. 如果我们手动创建OWL文件而不使用How to Define My Own Ranges for OWL DataProperties,这是非常有用的。
  2. http://answers.semanticweb.com/questions/16541/datatype-property-protege --当我们没有添加新数据类型的选项时,这与上下文有关。

请帮助编写这些场景的数据范围表达式。

设想情况:

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-07-02 14:51:00

只是xsd:double[ >= 0, <= 100 ]

代码语言: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="http://stackoverflow.com/q/24531940/1281433/percentages#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <owl:Ontology rdf:about="http://stackoverflow.com/q/24531940/1281433/percentages"/>
  <owl:DatatypeProperty rdf:about="http://stackoverflow.com/q/24531940/1281433/percentages#hasPercentage">
    <rdfs:range>
      <rdfs:Datatype>
        <owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#double"/>
        <owl:withRestrictions rdf:parseType="Collection">
          <rdf:Description>
            <xsd:minInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
            >0</xsd:minInclusive>
          </rdf:Description>
          <rdf:Description>
            <xsd:maxInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
            >100</xsd:maxInclusive>
          </rdf:Description>
        </owl:withRestrictions>
      </rdfs:Datatype>
    </rdfs:range>
  </owl:DatatypeProperty>
</rdf:RDF>
代码语言:javascript
复制
@prefix :      <http://stackoverflow.com/q/24531940/1281433/percentages#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

:hasPercentage  a   owl:DatatypeProperty ;
        rdfs:range  [ a                     rdfs:Datatype ;
                      owl:onDatatype        xsd:double ;
                      owl:withRestrictions  ( [ xsd:minInclusive
                                        0 ] [ xsd:maxInclusive  100 ] )
                    ] .

<http://stackoverflow.com/q/24531940/1281433/percentages>
        a       owl:Ontology .
票数 15
EN

Stack Overflow用户

发布于 2018-03-03 07:02:38

这篇文章可能有助于那些希望将离散整数(或任何数据类型)值赋值为数据类型属性范围的人。在数据范围表达式编辑器中键入以下代码:

代码语言:javascript
复制
{"0"^^xsd:int , "1"^^xsd:int , "10"^^xsd:int , "18"^^xsd:int , "2"^^xsd:int , "3"^^xsd:int , "4"^^xsd:int , "5"^^xsd:int , "6"^^xsd:int , "8"^^xsd:int}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24531940

复制
相关文章

相似问题

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