[eml-dev] [Bug 3553] New: - Create a schema file whose content is the definition of unit types

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Wed Oct 22 13:54:53 PDT 2008


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3553

           Summary: Create a schema file whose content is the definition of
                    unit types
           Product: EML
           Version: 2.0.1
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: eml - general bugs
        AssignedTo: jones at nceas.ucsb.edu
        ReportedBy: mob at icess.ucsb.edu
         QAContact: eml-dev at ecoinformatics.org


This item needs its own bug so that it can be referenced as changes are needed.
It was precipitated by the fix for bug #1019.

In EML 201, the unit dictionaries are enumerated lists that are defined ad hoc
in individual modules. For example, attribute.xsd defined a StandardUnitType,
and spatialRaster defines types called lengthUnits and angleUnits.  These 
types should be defined altogether in a separate schema doc
(eml-unitTypeDefinitions.xsd), which can be imported as needed. The simplest
organization would be to create enumerated lists based on unitTypes, and then
combine these into larger groups with xs:union:

<xs:simpleType name="StandardUnitDictionaryType">
<xs:union memberTypes="unit:LengthUnitDictionaryType
unit:OtherUnitDictionaryType "/>
</xs:simpleType>

<xs:simpleType name="LengthUnitDictionaryType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="meter"/>
    <xs:enumeration value="nanometer"/>
    ...etc
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="OtherUnitDictionaryType">
  <xs:restriction base="xs:string">
    <!-- all the other units that were in the standard list enumeration -->
    ...
  </xs:restriction>
</xs:simpleType>


Initially, eml-unitTypeDefinitions.xsd needs to contain just these two types,
which are used by attribute.xsd (standardUnits), and by coverage.xsd
(lengthUnits). Additional Types can be expected for types currently defined in
the spatial schemas (e.g., angle) as those schemas are revisited in the future.
Types could be added as necessary -- such as for information units, which are
allowable under SI, but not currently included in our dictionary
(<xs:simpleType name="InformationUnitDictionary"> )

This is the first step (albeit, a tiny one) toward uncoupling units from the
EML spec. It appears that an effort was started once before to create these
enumerations: a transformation stylesheet exists to create enumeration lists
from the standardDictionary.xml file, but it was never finished. See
"getunits.xsl". Generating the schema doc by transforming the
unitDictionary.xml would be one way to keep the dictionary and the enumerations
synchronized.


More information about the Eml-dev mailing list