Ticket #16 (new enhancement)

Opened 3 years ago

Last modified 6 months ago

Add XML schema and namespace support for ucum-essence.xml

Reported by: braeckel Owned by:
Priority: major Milestone:
Keywords: Cc:

Description

Hello,

the current version of the XML portion of the specification (currently at http://aurora.regenstrief.org/~ucum/ucum-essence.xml) could benefit from having an XML schema and a namespace. The schema would provide the ability to ensure that new unit definitions conform properly to the definition grammar, while the namespace would allow for unambiguous element and attribute naming when UCUM is combined with other grammars. Together this would allow for a "common" set of units in the UCUM namespace, and allow these definitions to be extended with domain-specific or application-specific definitions in another XML file as needed.

This requires a very minor change to ucum-essence.xml (2 lines or so near the top), changes to some applications that currently use this XML file without a namespace, and the creation of an XML schema. I have created an initial cut at the ucum-essence.xml file and an associated schema which may be found at http://www.rap.ucar.edu/~braeckel/ucum/. All of my comments and questions on this process are documented in the schema file (ucum.xsd).

Thanks, Aaron Braeckel

Change History

Changed 6 months ago by gschadow

A schema could not "provide the ability to ensure that new unit definitions conform properly to the definition grammar" -- where "definition grammar" means how you put unit symbols together. The other thing is trivial, because we generate the ucum-essence.xml from other XML files.

The ucum-essence.xml is supposed to be simply a delivery vehicle, consumers could use this in various ways.

This could be done, but the utility of it is not clear.

I would like to see how someone would actually use this in combination with other XML so that namespace would be relevant. The schema may be helpful to some and they could use the one that you have reconstructed. Thank you very much for this contribution.

Changed 6 months ago by braeckel

You are correct that it would be difficult to completely ensure that unit definitions conform, but you can certainly add a much stronger validation mechanism. The "km = m * 1000" type of definition will not be completely solved with a schema, but you can guarantee that any XML definition files are well-formed in an XML syntactical sense. There may also be ways to go further than the current XML validation which would allow shallow validation on the definition contents themselves (Schematron, regex, etc.).

There are two portions of UCUM relevant here: 1) the units of measure defined by UCUM, irrespective of how these are represented (XML, text, DB, etc.). This might be summarized as "UCUM as an authority", much as EPSG is an authority for Coordinate Reference System definitions 2) the technical representation mechanism for UCUM's UoM definitions. In this case the XML

There are cases where domain-specific, organizationally-specific, and other units not yet in UCUM are used today and this will continue into the future. There are many cases of this in the meteorological and aviation domains that I work in. Either it is assumed that all will be added to UCUM before they are needed, or UCUM can allow other organizations to extend the UCUM units using the same representation techniques. In addition to the practical utility of having a schema for this XML file, this allows other parties to extend the the UCUM UoM definitions with some formal assurances of correctness.

Note: See TracTickets for help on using tickets.