unit

<h:div class="summary">A scientific unit.</h:div>
<h:div class="description">
  <h:p>A scientific unit. Units are of the following types:</h:p>
  <h:ul>
    <h:li>SI Units. These may be one of the seven fundamental types (e.g. meter) or may be derived (e.g. joule). An SI unit is identifiable because it has no parentSI attribute and will have a unitType attribute. 2005-122-17 - this may be obsolete; PMR</h:li>
    <h:li>nonSI Units. These will normally have a parent SI unit (e.g. calorie has joule as an SI parent).</h:li>
    <h:li>Constructed units. These use a syntax of the form:
      <h:pre><unit id="g.s-1" name="gram per second" unitType="myUnitType:massPerTime"> <unit units="units:g" power="1"/> <unit units="siUnits:s" power="-1"/> </unit></h:pre>This defines a new unit (g.s-1) which is composed from two existing units (units:g and siUnits:s) to create a new unit. The conversion to SI is computed from the two child units and may be added as a 'multiplierToSI' attribute. Only siUnits or units with 'multiplierToSI' can be used as child units; 'constantToSI cannot be used yet. If the new unit points to a unitType then the dimension can be checked. Thus if the published dimension of massPerTime does not agree with mass.length-1 an error is throwable. Alternatively a new unitType can be added as a child.</h:li>
  </h:ul>
  <h:p>The relationship of a unit to its SI parent is potentially complex and inconsistencies may arise. The following are available:
    <h:ul>
      <h:li>parentSI. This points to the ID of a parent SI unit. If this ID is the same as the current unit the implication is that this is an SI unit.</h:li>
      <h:li>isSI. a boolean indicating whether the current unit is SI.</h:li>
      <h:li>multiplierToSI and constantToSI. If these are 1.0 and 0.0 (or missing) the implication is that this unit is SI. However this is fragile as units can be defined without these attributes and a unit could coincidentally have no numeric differences but not be an SI unit.</h:li>
    </h:ul>
  </h:p>
</h:div>
<h:div class="example" href="unit1.xml"/>
<h:div class="curation">2003:04-09 Description or parentSI attribute enhanced.</h:div>
<h:div class="curation">2006:03-21 Added metadata and metadataList to content.</h:div>

Element Information

Model

anyCml | ANY element from ANY namespace OTHER than 'http://www.xml-cml.org/schema' | ANY element from LOCAL namespace 'No Namespace'
Children: anyCml

Attributes

QName Type Fixed Default Use Inheritable Annotation
constantToSI xsd:double optional
<h:div class="summary">Additive constant to generate SI equivalent.</h:div>
<h:div class="description">The amount to add to a quantity in non-SI units to convert its representation to SI Units. This is applied *after* multiplierToSI. It is necessarily zero for SI units.</h:div>
id idType optional
<h:div class="summary">A unique ID for an element.</h:div>
<h:div class="description">Id is used for machine identification of elements and in general should not have application semantics. It is similar to the XML ID type as containing only alphanumerics, '_', ',' and '-' and and must start with an alphabetic character. Ids are case sensitive. Ids should be unique within local scope, thus all atoms within a molecule should have unique ids, but separated molecules within a doc (such as a published article) might have identical ids. Software should be able to search local scope (e.g. all atoms within a molecule). However this is under constant review.</h:div>
isSI xsd:boolean optional
<h:div class="summary">indicates whether a unit is an SI or derived SI unit.</h:div>
<h:div class="description">required on SI unit elements with value 'true'. Optional on other units with attribute 'false'. A unitList should contain either SI units or non-SI units but not both.</h:div>
multiplierToData xsd:double 1.0 optional
<h:div class="summary">The scale by which to multiply raw data or a unit.</h:div>
<h:div class="description">The scale is applied *before* adding any constant. The attribute may be found on a data item (scalar, array, matrix, etc.) or a user-defined unit.</h:div>
multiplierToSI xsd:double optional
<h:div class="summary">Multiplier to generate SI equivalent.</h:div>
<h:div class="description">The factor by which the non-SI unit should be multiplied to convert a quantity to its representation in SI Units. This is applied *before* _constantToSI_. Necessarily unity for SI unit.</h:div>
name xsd:string optional
<h:div class="summary">Name of the object.</h:div>
<h:div class="description">A string by which the object is known. Often a required attribute. The may or may not be a semi-controlled vocabulary.</h:div>
parentSI namespaceRefType optional
<h:div class="summary">A dictRef-like reference to the id of the parent SI unit.</h:div>
<h:div class="description">This parent should occur in this or another dictionary and be accessible through the dictRef mechanism. This attribute is forbidden for SI Units themselves. The mechanism holds for base SI units (7) and all compound (derived) units made by combinations of base Units.</h:div>
<h:div class="example" href="unit3.xml"/>
power xsd:double optional
<h:div class="summary">The power to which a dimension should be raised.</h:div>
<h:div class="description">Normally an integer. Must be included, even if unity.</h:div>
symbol xsd:string optional
<h:div class="summary">A symbol.</h:div>
<h:div class="description">No semantics. However it should contain only ASCII characters and we may have to develop an escaping mechanism. Used on _atomicBasisFunction_, _unit_, etc.</h:div>
title xsd:string optional
<h:div class="summary">A title on an element.</h:div>
<h:div class="description">No controlled value.</h:div>
<h:div class="example" href="title1.xml"/>
unitType xsd:string optional
<h:div class="summary">A reference to the type of a unit.</h:div>
<h:div class="description">Used in defining the unit and doing symbolic algebra on the dimensionality.</h:div>
units unitsType optional
<h:div class="summary">Scientific units on an element.</h:div>
<h:div class="description">These must be taken from a dictionary of units. There should be some mechanism for validating the type of the units against the possible values of the element.</h:div>
Wildcard: ANY attribute from ANY namespace OTHER than 'http://www.xml-cml.org/schema'

Source

<xsd:element name="unit" id="el.unit" substitutionGroup="anyCml">
  <xsd:annotation>
    <xsd:documentation>
      <h:div class="summary">A scientific unit.</h:div>
      <h:div class="description">
        <h:p>A scientific unit. Units are of the following types:</h:p>
        <h:ul>
          <h:li>SI Units. These may be one of the seven fundamental types (e.g. meter) or may be derived (e.g. joule). An SI unit is identifiable because it has no parentSI attribute and will have a unitType attribute. 2005-122-17 - this may be obsolete; PMR</h:li>
          <h:li>nonSI Units. These will normally have a parent SI unit (e.g. calorie has joule as an SI parent).</h:li>
          <h:li>Constructed units. These use a syntax of the form:
            <h:pre><unit id="g.s-1" name="gram per second" unitType="myUnitType:massPerTime"> <unit units="units:g" power="1"/> <unit units="siUnits:s" power="-1"/> </unit></h:pre>This defines a new unit (g.s-1) which is composed from two existing units (units:g and siUnits:s) to create a new unit. The conversion to SI is computed from the two child units and may be added as a 'multiplierToSI' attribute. Only siUnits or units with 'multiplierToSI' can be used as child units; 'constantToSI cannot be used yet. If the new unit points to a unitType then the dimension can be checked. Thus if the published dimension of massPerTime does not agree with mass.length-1 an error is throwable. Alternatively a new unitType can be added as a child.</h:li>
        </h:ul>
        <h:p>The relationship of a unit to its SI parent is potentially complex and inconsistencies may arise. The following are available:
          <h:ul>
            <h:li>parentSI. This points to the ID of a parent SI unit. If this ID is the same as the current unit the implication is that this is an SI unit.</h:li>
            <h:li>isSI. a boolean indicating whether the current unit is SI.</h:li>
            <h:li>multiplierToSI and constantToSI. If these are 1.0 and 0.0 (or missing) the implication is that this unit is SI. However this is fragile as units can be defined without these attributes and a unit could coincidentally have no numeric differences but not be an SI unit.</h:li>
          </h:ul>
        </h:p>
      </h:div>
      <h:div class="example" href="unit1.xml"/>
      <h:div class="curation">2003:04-09 Description or parentSI attribute enhanced.</h:div>
      <h:div class="curation">2006:03-21 Added metadata and metadataList to content.</h:div>
    </xsd:documentation>
  </xsd:annotation>
  <xsd:complexType>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element ref="anyCml"/>
      <xsd:any namespace="##other" processContents="lax"/>
      <xsd:any namespace="##local" processContents="lax"/>
    </xsd:choice>
    <xsd:attributeGroup ref="id"/>
    <xsd:attributeGroup ref="units">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="summary">Reference to a unit.</h:div>
          <h:div class="description">
            <h:p>This is used for the identification of child units when new units are composed from existing ones. Athough the syntax looks unusual it takes advantage of the tools for resolving units. See above for syntax.</h:p>
          </h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:attributeGroup ref="title"/>
    <xsd:attributeGroup ref="symbol">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="summary">Symbol for the unit.</h:div>
          <h:div class="description">
            <h:p>This may be used for typographical display but NOT for identification as there is considerable variation in use.</h:p>
          </h:div>
          <h:div class="curation">2006-01-29: PMR. Added attribute.</h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:attributeGroup ref="name"/>
    <xsd:attributeGroup ref="parentSI"/>
    <xsd:attributeGroup ref="isSI"/>
    <xsd:attributeGroup ref="unitType"/>
    <xsd:attributeGroup ref="multiplierToData"/>
    <xsd:attributeGroup ref="multiplierToSI"/>
    <xsd:attributeGroup ref="constantToSI"/>
    <xsd:attributeGroup ref="power">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="summary">Power of unit used to create new one.</h:div>
          <h:div class="description">
            <h:p>Only allowed on child units</h:p>
          </h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:anyAttribute namespace="##other" processContents="lax"/>
  </xsd:complexType>
</xsd:element>

Sample