IDS icon indicating copy to clipboard operation
IDS copied to clipboard

Restriction of values: Enumeration limited to string-based datatype or do we allow for real, integer and measurements

Open MatthiasWeise opened this issue 1 year ago • 4 comments

Use case: IDS user wants to define discrete values for length-based properties.

Possible definition in IDS with enumeration (given example with property thickness and datatype IfcLengthMeasurement and allowed values 24cm, 36cm and 48cm):

<property dataType="IFCLENGTHMEASUREMENT">
   <propertySet>
      <simpleValue>ElementDimensions</simpleValue>
   </propertySet>
   <baseName>
      <simpleValue>Thickness</simpleValue>
   </baseName>
   <value>
        <xs:restriction base="xs:string">
              <xs:enumeration value="0.24" />
              <xs:enumeration value="0.36" />
              <xs:enumeration value="0.48" />
        </xs:restriction>
   </value>
</property>

Question: Do we support that in current IDS?

MatthiasWeise avatar May 31 '24 10:05 MatthiasWeise

I would say Strings for IfcLengthMeasurement is not supported in IDS, or anywhere else in a situation where we want interoperability.

berlotti avatar May 31 '24 10:05 berlotti

afaik, this is allowed in IDS 1.0:

        <xs:restriction base="xs:double">
              <xs:enumeration value="0.24" />
              <xs:enumeration value="0.36" />
              <xs:enumeration value="0.48" />
        </xs:restriction>

as well as other data types: ~~boolean~~, integer, date, dateTime, duration and time.

atomczak avatar Jun 10 '24 07:06 atomczak

this would follow XML Schema Part 2: Datatypes one minor correction - enumeration is not a facet for xs:boolean (see 3.2.2 boolean)

but one question for IDS - when using xs:double in enumeration, would tolerances apply? my recommendation would be yes, as it is an OR combination of equalness, and not a range.

TLiebich avatar Jun 10 '24 18:06 TLiebich

I don't hear anyone against it, so let's add this one to the docs and test cases.

atomczak avatar Aug 21 '24 19:08 atomczak