Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MatthiasWeise opened this issue May 31, 2024 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation please contribute A PR is welcome for this issue. Please target the `development` branch. tests
Milestone

Comments

@MatthiasWeise
Copy link
Contributor

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
Copy link
Member

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

@atomczak
Copy link
Contributor

atomczak commented Jun 10, 2024

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
Copy link

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
Copy link
Contributor

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

@atomczak atomczak self-assigned this Aug 21, 2024
@atomczak atomczak added documentation Improvements or additions to documentation tests todo labels Aug 21, 2024
@atomczak atomczak added please contribute A PR is welcome for this issue. Please target the `development` branch. and removed todo labels Nov 6, 2024
@atomczak atomczak added this to the 1.0 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation please contribute A PR is welcome for this issue. Please target the `development` branch. tests
Projects
None yet
Development

No branches or pull requests

4 participants