Defining DataRange Expression in Protege for a Data Type Property

后端 未结 2 1806
余生分开走
余生分开走 2021-02-08 12:52

I am adding few new DataType in the OWL using Protege.

The DataType is like percentage and I want to specify it\'s range with the double value ranging from 0 to 100.

2条回答
  •  醉话见心
    2021-02-08 13:22

    It's just xsd:double[ >= 0, <= 100 ].

    screenshot

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

提交回复
热议问题