-
Notifications
You must be signed in to change notification settings - Fork 0
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
measurementType idea up for discussion #15
Comments
The issue was discussed today with BLW personnel and technical consultants. We agree that the measureType is a good idea. Initial reflection seems however to indicate that the proper place for this is in the respective standard. Otherwise a restriction on allowable units is not possible. Putting a measurement of type measurement in the respective spec has the advantage that we can simplify attribute naming, e.g., heightInM would not be simply be height of type measurementType in which we can specify the unit from an allowable subset of unitTypes from eCH-0261. A secondary question of whether to pursue this change at this time or in a respective version 2 will be discussed with highter-level BLW representatives. |
With all the power and flexibility of XSD, I guessed that restriction inheritance should not be an issue, so I looked a little further into it. Apparently, you can solve both suggested usecases in a pretty elegant way:
So, apparently (this however needs careful validation by someone having proper XML tools at disposal...) the technical doubts around this proposal are solved and a measureType type could be safely defined in the 0261 standard to be reused in all the downstream ones. |
I just noticed that case 2 from above (further restrict the available units in a downstream standard) is actually already used. See for example this snippet from 0263:
|
Added "A thought on interoperability" section to the initial post |
In QA meetings on 2023-01-22, it was decided to implement this in v1. Naming suggestion: measureType with two elements/attributes named value and unit respectively. value would be of type decimal with a relatively generous precision, say 4 spaces. |
Should we also include an optional "unitName" for specifing the name in case the unit is "piece"? |
Yes, I agree, and in the annotation specify how this is intended to be used. |
implemented with #22 |
It seems to me, that restrictions in complexTypes don't work if the original Type is in a different namespace, this would mean, that we would need to redefine the measureType in any standard... |
Ouch. Not good. |
it works with redefining the measurementType in each namespace. This is the way I have implemented it in v1. |
Idea
This idea came to me while looking at the 0262 standard and the implementation that this standard makes of unitType as defined in 0261.
Looking forward to your reactions.
eCH-0261/src/eCH-0261-1-0.xsd
Line 467 in 42afd75
At the moment, the unitType is only an enumeration of valid units. This forces any standard using it to build a 3-elements construct with quantity, unit and unitName (see picture from the 0262 word)
My proposal is to integrate those elements directly in the 0261 standard by renaming unitType to measureType (or similar) and then refactor this new measureType to contain:
Possible benefits:
Possible issues:
I am actually not sure that you can limit downstream the available unitType. For example, if I want to define a volume in m3 element, can I define my element in the downstream standard in such a way that uses type:measureType but only allows for unitType="m3"?--> confirmed not an issue, see comments belowA thought on interoperability and "unitName"
Using the "unitName" attribute as a free text is actually a blow to interoperability, since I (italian-speaking Ticinese) will write down "Pianta" or "germoglio" or whatever, which will of course not be the same as a german-speaking person using exactly the same unit ("plant").
I thus ask myself if it would not be better to get rid of this potential source of confusion and the "pc" unit and replace them with explicitly defined "pieces" like "plant", "box" or whatever is needed.
I am fully aware of the potential complexity of the task, but since one of our goals is to allow interoperability I think it would be good to spend some time to think about this.
One of the possible implications of such a change is that the whole CodeList must be made much more flexible to allow for easier integration of new "pieces" types. In this case, it could be necessary to make it an external list published in I14Y instead of an embedded one.
The text was updated successfully, but these errors were encountered: