Geonovum / uml2json

Best Practise for OGC - UML to JSON Encoding Rules
https://geonovum.github.io/uml2json/document.html
0 stars 1 forks source link

7.3.3.8 - pja - Do enumeration literals exist with type boolean? #16

Closed PalmJanssen closed 1 year ago

PalmJanssen commented 1 year ago

Do enumeration literals exist with type boolean? Is an other type than CharacterString needed?

jechterhoff commented 1 year ago

It depends upon whether the application schema contains enumerations whose enums can more precisely be encoded with a type other than a string (so either a boolean, number, or integer). If that is the case, modeling experts may want to have an encoding where these types are actually used.

Examples for enumerations of different literal encoding type are:

For the numeric cases, the enum definition typically explains what a certain literal value means.

However, the boolean examples may not be so good, since they are a bit constructed. In other words, your question, if an enumeration literal with type boolean exists, is quite on point. ISO 19103:2015 defines type Boolean as an enumeration with enums true and false. ISO 19103:2005 also has such an enumeration, where the initial value for enum true is 1 and the initial value for false is 0. The latest draft of ISO 19103 refers to ISO 11404:2007, section 8.1.1, where Boolean is defined as a datatype with value space true and false. The second Boolean enumeration example is therefore not in line with recent versions of ISO 19103, where only true and false are valid values for type Boolean. ShapeChange does recognize both true and 1, and uses false in case of any other enum value for an enumeration with literal encoding type Boolean. That somewhat also covers the old definition of Boolean in ISO 19103:2005, as well as boolean encoding in XML Schema, but is more of an implementation detail, I guess.

All that being said, in theory I can see cases for enumerations with literal encoding type Boolean. Not sure if such enumerations exist in domain specific application schemas today. In practice I have always used type Boolean directly. Therefore, I am not sure if this is an "(exc)use case". Maybe by adding examples for the different cases in section 7.3.3.8, we can solve this issue?

jechterhoff commented 1 year ago

Decision: Remove Boolean in the table.