The units attribute is mandatory and can be customised to support mass, volumes, moles, percentages, or rations (e.g. ppm).
<substanceList id="s1">
<amount units="units:ml">100</amount>
<substance id="s1">
<amount units="units:l">1</amount>
<molecule id="h2o" ref="mols:water"/>
</substance>
<substance id="s2">
<amount units="units:mole">0.1</amount>
<molecule id="nacl" formula="Na 1 O 1 H 1"/>
</substance>
</substanceList>
This is not formally of type ID (an XML NAME which must start with a letter and contain only letters, digits and .-_:). It is recommended that IDs start with a letter, and contain no punctuation or whitespace. The function generate-id() in XSLT will generate semantically void unique IDs.
It is difficult to ensure uniqueness when documents are merged. We suggest namespacing IDs, perhaps using the containing elements as the base. Thus mol3:a1 could be a useful unique ID. However this is still experimental.
<action title="turn on heat" start="T09:00:00" convention="xsd"/>
The namespace is optional but recommended where possible
Note: this convention is only used within STMML and related languages; it is NOT a generic URI.
<list>
<!-- dictRef is of namespaceRefType -->
<scalar dictRef="chem:mpt">123</scalar>
<!-- error -->
<scalar dictRef="mpt23">123</scalar>
</list>
There is no controlled vocabulary for conventions, but the author must ensure that the semantics are openly available and that there are mechanisms for implementation. The convention is inherited by all the subelements, so that a convention for molecule would by default extend to its bond and atom children. This can be overwritten if necessary by an explicit convention.
It may be useful to create conventions with namespaces (e.g. iupac:name). Use of convention will normally require non-STMML semantics, and should be used with caution. We would expect that conventions prefixed with "ISO" would be useful, such as ISO8601 for dateTimes.
There is no default, but the conventions of STMML or the related language (e.g. CML) will be assumed.
<bond convention="fooChem" order="-5" xmlns:fooChem="http://www.fooChem/conventions"/>
The namespace is optional but recommended where possible
Note: this convention is only used within STMML and related languages; it is NOT a generic URI.
<list>
<!-- dictRef is of namespaceRefType -->
<scalar dictRef="chem:mpt">123</scalar>
<!-- error -->
<scalar dictRef="mpt23">123</scalar>
</list>
A reference to a dictionary entry.
Elements in data instances such as scalar may have a dictRef attribute to point to an entry in a dictionary. To avoid excessive use of (mutable) filenames and URIs we recommend a namespace prefix, mapped to a namespace URI in the normal manner. In this case, of course, the namespace URI must point to a real XML document containing entry elements and validated against STMML Schema.
Where there is concern about the dictionary becoming separated from the document the dictionary entries can be physically included as part of the data instance and the normal XPointer addressing mechanism can be used.
This attribute can also be used on dictionary elements to define the namespace prefix
<scalar dataType="xsd:float" title="surfaceArea"
dictRef="cmlPhys:surfArea"
xmlns:cmlPhys="http://www.xml-cml.org/dict/physical"
units="units:cm2">50</scalar>
<stm:list xmlns:stm="http://www.xml-cml.org/schema/stmml">
<stm:observation>
<p>We observed <object count="3" dictRef="#p1"/>
constructing dwellings of different material</p>
</stm:observation>
<stm:entry id="p1" term="pig">
<stm:definition>A domesticated animal.</stm:definition>
<stm:description>Predators include wolves</stm:description>
<stm:description class="scientificName">Sus scrofa</stm:description>
</stm:entry>
</stm:list>
These will be linked to dictionaries of units with conversion information, using namespaced references (e.g. si:m)
Distinguish carefully from unitType which is an element describing a type of a unit in a unitList
<stm:unitList xmlns:stm="http://www.xml-cml.org/schema/stmml"> <!-- ======================================================================= --> <!-- ========================= fundamental types =========================== --> <!-- ======================================================================= --> <stm:unitType id="length" name="length"> <stm:dimension name="length"/> </stm:unitType> <stm:unitType id="time" name="time"> <stm:dimension name="time"/> </stm:unitType> <!-- ... --> <stm:unitType id="dimensionless" name="dimensionless"> <stm:dimension name="dimensionless"/> </stm:unitType> <!-- ======================================================================= --> <!-- ========================== derived types ============================== --> <!-- ======================================================================= --> <stm:unitType id="acceleration" name="acceleration"> <stm:dimension name="length"/> <stm:dimension name="time" power="-2"/> </stm:unitType> <!-- ... --> <!-- ======================================================================= --> <!-- ====================== fundamental SI units =========================== --> <!-- ======================================================================= --> <stm:unit id="second" name="second" unitType="time"> <stm:description>The SI unit of time</stm:description> </stm:unit> <stm:unit id="meter" name="meter" unitType="length" abbreviation="m"> <stm:description>The SI unit of length</stm:description> </stm:unit> <!-- ... --> <stm:unit id="kg" name="nameless" unitType="dimensionless" abbreviation="nodim"> <stm:description>A fictitious parent for dimensionless units</stm:description> </stm:unit> <!-- ======================================================================= --> <!-- ===================== derived SI units ================================ --> <!-- ======================================================================= --> <stm:unit id="newton" name="newton" unitType="force"> <stm:description>The SI unit of force</stm:description> </stm:unit> <!-- ... --> <!-- multiples of fundamental SI units --> <stm:unit id="g" name="gram" unitType="mass" parentSI="kg" multiplierToSI="0.001" abbreviation="g"> <stm:description>0.001 kg. </stm:description> </stm:unit> <stm:unit id="celsius" name="Celsius" parentSI="k" multiplierToSI="1" constantToSI="273.18"> <stm:description><p>A common unit of temperature</p></stm:description> </stm:unit> <!-- fundamental non-SI units --> <stm:unit id="inch" name="inch" parentSI="meter" abbreviation="in" multiplierToSI="0.0254" > <stm:description>An imperial measure of length</stm:description> </stm:unit> <!-- derived non-SI units --> <stm:unit id="l" name="litre" unitType="volume" parentSI="meterCubed" abbreviation="l" multiplierToSI="0.001"> <stm:description>Nearly 1 dm**3 This is not quite exact</stm:description> </stm:unit> <!-- ... --> <stm:unit id="fahr" name="fahrenheit" parentSI="k" abbreviation="F" multiplierToSI="0.55555555555555555" constantToSI="-17.777777777777777777"> <stm:description>An obsolescent unit of temperature still used in popular meteorology</stm:description> </stm:unit> </stm:unitList>