Project

General

Profile

Actions

Bug #3553

closed

Create a schema file whose content is the definition of unit types

Added by Margaret O'Brien over 15 years ago. Updated over 15 years ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
eml - general bugs
Target version:
Start date:
10/22/2008
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
3553

Description

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.

Actions #1

Updated by Margaret O'Brien over 15 years ago

The basic structure of these definitions is below. In the interest of time, I didn't pursue creating the enumeration lists by transforming the unit dictionary - I just split them off manually. This closes the bug.

<xs:simpleType name="StandardUnitDictionary">
<xs:union memberTypes="unit:LengthUnitType unit:MassUnitType unit:otherUnitType"/>
</xs:simpleType>

&lt;xs:simpleType name="LengthUnitType"&gt;
&lt;xs:restriction base="xs:string"&gt;
&lt;xs:enumeration value="meter"/&gt;
...
&lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
Actions #2

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 3553

Actions

Also available in: Atom PDF