0

I want to use double values for class expression syntax in Protégé but I can't find any examples. All are using integer values, not double. For instance: http://protegeproject.github.io/protege/class-expression-syntax/

For instance, I want to express the height of a person in meters:

  • hasHeight value 1.89
  • hasHeight min 1.70

How can I do this?

What currently works (according syntax): "hasHeight some xsd:double" infers that all instances that has a xsd:double value in the property hasHeight are instances. However, I want to restrict this to a particular value range. For example: between 1.80 and 1.70. How can I do this?

I thougt this is equivalent to queries from The DL Query tab where I can query relevant instances with "hasHeight some xsd:double[<=1.80]", but this is not allowed in the class expression editor in Protégé. Why?

Thanks in advance!

user3352632
  • 617
  • 6
  • 18

2 Answers2

3

It doesn't work because Protégé is an editor for OWL 2, which in fact has some restrictions on the datatypes allowed in facets:

The OWL 2 datatype map provides the following datatypes for the representation of real numbers, decimal numbers, and integers:

owl:real
owl:rational
xsd:decimal
xsd:integer
xsd:nonNegativeInteger
xsd:nonPositiveInteger
xsd:positiveInteger
xsd:negativeInteger
xsd:long
xsd:int
xsd:short
xsd:byte
xsd:unsignedLong
xsd:unsignedInt
xsd:unsignedShort
xsd:unsignedByte

Possible class expression:

hasHeight some xsd:decimal[>= 1.7, <= 1.8] (the parser in Protégé seems to need the spaces after <= symbol)

UninformedUser
  • 8,397
  • 1
  • 14
  • 23
  • 1
    Thanks, changing it to xsd:decimal does not work. I can execute: "'hasHeight some xsd:decimal[>=1.7,<=1.8]" in DL QUery Tab, however, the same statement under in the class under "Equivalent To" does not work. How can I define ranges there? I can only state: "hasHeight value 1.71", but not a range. How can I do this? – user3352632 Jun 17 '18 at 15:43
  • 1
    The parser is a bit picky, use spaces after the `<,>,<=,>=` symbols: `hasHeight some xsd:decimal[>= 1.7, <= 1.8]` – UninformedUser Jun 17 '18 at 18:01
2

To define that individuals of type Person can have one or more hasHeight data properties you can state the following:

DataProperty: hasHeight
Class: Person
  SubClassOf:
    hasHeight some xsd:double

Note that this is different from cardinality restrictions, which limits how many times an individual of type Person can be associated via the hasHeight property. To specify that an individual of type Person has exactly 1 height you can specify it as follows:

DataProperty: hasHeight
Class: Person
  SubClassOf: 
    hasHeight exactly 1 xsd:double

Thus the complete definition is as follows:

DataProperty: hasHeight
Class: Person
  SubClassOf:
    hasHeight some xsd:double, 
    hasHeight exactly 1 xsd:double
Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22