buildingSMART / IDS

Computer interpretable (XML) standard to define Information Delivery Specifications for BIM (mainly used for IFC)
https://www.buildingsmart.org/standards/bsi-standards/information-delivery-specification-ids/
Other
199 stars 61 forks source link

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

Open MatthiasWeise opened 3 months ago

MatthiasWeise commented 3 months ago

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?

berlotti commented 3 months ago

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

atomczak commented 3 months ago

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.

TLiebich commented 3 months ago

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.

atomczak commented 3 weeks ago

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