# Plan for EML 2.2 Unit Dictionary EML 2.2 will be backward compatible (a 2.1 EML instance will validate against 2.2 schema if only change is to the namespaces). Since we now control the stmml schema, we can make a few changes, so that EML 2.2 uses stmml-1.2. Here are the stmml:unitList features, and how we propose to use them: ## Required: - **unit/@id** - unique within the list, Typically is a human readable string, in English. Also used to dereference a customUnit (in stmml under additionalMetadata) ## Recommended: - **unit/@name** - typically the same string as id. - **unit/@udunitsSynonym** - an alias for this unit that can be understood by the udunits package for conversions (current version = udunits2). Added for stmml 1.2 (by eml-dev). - **unit/descriptions** - text description of the unit (or sometimes, how it is used) ## Optional: - **unit/@deprecatedInFavorOf** - indicates that this unit has a preferred substitute (e.g., with a name that uses standardized spelling). Users are strongly encouraged to use the preferred unit instead. Added for stmml 1.2 (by eml-dev), mainly to maintain backward compatibility with the EML 2.1. This way, all original units are still be allowed, but can be demoted in favor of a cleaner list. - **unit/@abbreviation** - TO DO: minimum: agree on a character set. Ideal: populate according to a set of rules - **unit/@unitType** - a string, naming a group of units based on their dimensions. May be useful for creating groups of units. (see below, Note on unitType) ## No longer used: These are current STMML attributes, but are not needed if we promote the udunits package: - **unit/@multiplierToSi** - a decimal, which for value conversions to the parent - **unit/@constantToSi** - a decimal, which for value conversions to the parent - **unit/@parentSi** - a string, naming the parent unit (or complex parent unit) ## Note on unitType The STMML unitType element contains structured descriptions of units by their dimensions. STMML schema says that unitList/unit/@unitType is a reference to unitList/unitType (unitType is one:many with unit). So ideally, if the dictionary populates unit/@unitType, it should also populate unitList/unitType. unitType may be informative for constructors (in choosing a unit) or helpful in creating subgroups of units. The candidate eml-unitDictionary.xml (checked in 2018-03-29) does not contain unitTypes. For two reasons: 1. if we promote the use of the “udunits” package for conversions, then the dimensions in unitType will not be used at all. 2. there are a fair number of errors and ambiguities in the EML2.1 dictionary’s unitTypes, and their assignments to units, so they need more careful review before they can be added. Since the EML parser uses only unit/@id, I suspect that we could patch in the unitTypes later.