WIP: Potential improvements to "global" elements
- Truncate descriptions
The current schema includes a number of "global" elements, including e.g. <si:globalUnit>
, <si:globalUnitPhase>
, <si:globaUnivariateUnc>
, and <si:globalBivariateUnc>
. In our opinion, the idea behind these elements are good, as they allow for more efficient encoding for data. However, they also potentially complicate the tools, as they add another way of representing things, making it e.g. harder to compare if two XML files have identical data contents or not.
From a computer science point of view, it would be desirable to have only a single canonical format. However, if having a single format is not possible, e.g. to due to transport efficiency or other reasons, the second desirable situation is one where the alternative formats can be converted into the canonical format with an easy and simple algorithm. Furthermore, it is desirable that the same logical type data is always represented with the same elements, even though the scope which they apply to may vary.
Keeping this in mind, we tentatively (subject e.g. to checking the implementability with XML etc) propose the following changes to the version 1.2.:
-
Consider changing the name of the "global" elements either to "list" elements, or simply use their "plain" (non-prefixed) alternatives, is possible. That is, instead of having
<si:globalUnit>
, consider having<si:listUnit>
, or (if possible) perhaps simply<si:unit>
. In the latter case, the context (weather in<si:list>
or e.g.<si:real>
) defines the exact meaning. -
Move the "global" elements so that they are, with a list, before the elements they apply to, and not after.
Example:
Instead of having
<si:list>
<si:real><si:value>2.34</si:value></si:real>
<si:real><si:value>3.34</si:value></si:real>
<si:real><si:value>2.34</si:value></si:real>
<si:globalUnit>\metre</si:globalUnit>
</si:list>
have
<si:list>
<si:unit>\metre</si:unit>
<si:real><si:value>2.34</si:value></si:real>
<si:real><si:value>3.34</si:value></si:real>
<si:real><si:value>4.34</si:value></si:real>
</si:list>
As far as we can see, this would bring forth two benefits:
a. It would be possible to use simple XSLT to transform the "condensed" format (with listUnit
) to the canonical format.
b. It would became possible to change the unit/date/whatever within the list, e.g.
<si:list>
<si:unit>\metre</si:unit>
<si:dateTime>2018-11-16T12:30:01.67-01:00</si:dateTime>
<si:real><si:value>2.34</si:value></si:real>
<si:real><si:value>3.34</si:value></si:real>
<si:dateTime>2018-11-16T12:30:01.69-01:00</si:dateTime>
<si:real><si:value>4.34</si:value></si:real>
<si:real><si:value>5.34</si:value></si:real>
</si:list>
In the example above, the first two entries would have the first date, the second two the second date.
Finally, the format would be also perhaps less ambiguous if some of the data have an explicit different unit, while others are using the same. For example, the following encoding could be used for a number of entries that are listed in metres, while there is one intervening listed in millimetres.
<si:list>
<si:unit>\metre</si:unit>
<si:real><si:value>2.34</si:value></si:real>
<si:real><si:value>3.34</si:value></si:real>
<si:real>
<si:unit>\milli\metre\<si:unit>
<si:value>340</si:value>
</si:real>
<si:real><si:value>5.34</si:value></si:real>
</si:list>
- Show labels
- Show closed items