According to ISO standards, there are three types of units: base units, conventional units, and derived units.
Base units are defined as units of measurement that cannot be derived by combining other base units within the same system of units. For example, in the International System of Units (SI), the meter (length), the second (time), the kilogram (mass), etc., are considered base units. Therefore, the set of base units depends on the system of units being used, allowing for different base units for the same type of measurement. For instance, in the case of mass units in the International System of Units (SI), the base unit is the kilogram, while in the Unified Code for Units of Measure (UCUM), it is the gram.
Conventional units are those that are neither base units nor direct combinations of base units. Examples include the electronvolt, feet, nautical miles, and any measurement derived from base units like milligrams, hours, etc. To define a conventional unit, a conversion factor or formula to another preferred unit is needed.
Derived units are defined by the combination of other units and are used for quantities different from those corresponding to base units, such as Hertz (s⁻¹) or Newton (kg·m/s²). Generally, derived units are intended to be directly based on the base units of a specific system. If a derived unit is not based on the base units of the system, it is better to use the concept of a conventional unit.
There is some overlap between derived and conventional units, and sometimes it is easier or more convenient to document a unit of measure as either derived or conventional.
Based on the introduction, there are three general configurations for documenting units in XML. The basic structure of each, along with variations, is shown below using some examples:
<gml:BaseUnit gml:id="BaseUnit_1">
<gml:identifier codeSpace="urn:ogc:def:uom:SI">s</gml:identifier>
<gml:unitsSystem xlink:href="https://www.bipm.org"/>
</gml:BaseUnit>
<gml:BaseUnit gml:id="BaseUnit_2">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">rad</gml:identifier>
<gml:unitsSystem xlink:href=" https://www.ucum.org"/>
</gml:BaseUnit>
Note that the radian is not a base unit of the SI. The SI does not have any base unit for measuring plane angles; however, we can document the radian as a base unit as long as we specify that we are referring to the classification of units in UCUM through the <gml:unitsSystem> element.
The <gml:identifier> element, along with its codeSpace attribute, allows us to reference the context in which the symbol or identifier of the unit we are documenting makes sense (in this case, s or rad). Therefore, we will use https://www.bipm.org to refer to SI units and https://www.ucum.org to refer to UCUM units.
<gml:ConventionalUnit gml:id="ConventionalUnit_1">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">h</gml:identifier>
<gml:conversionToPreferredUnit uom="s, https://ucum.org/ucum">
<gml:factor>3600</gml:factor>
</gml:conversionToPreferredUnit>
</gml:ConventionalUnit>
Just as we saw in the case of base units, the <gml:identifier> element with its codeSpace attribute allows us to reference the context in which the symbol or identifier of the unit we are documenting makes sense.
With the <gml:conversionToPreferredUnit> element, we define the conversion factor to apply to convert the conventional unit we want to document to a preferred unit (in this case, minutes: 1 h = 3600 s). When the conversion is not exact, we shall use the <gml:roughConversionToPreferredUnit> element. The uom attribute is of type UomIdentifier and is formed following the structure (UomSymbol, UomUri), in accordance with gml/units.xsd.
Ideally, the reference should be towards a base unit of the unit system. However, in practice, this can be quite complicated. Imagine if we wanted to document kPa: we would need a factor of 1000 to convert to Pa. Additionally, since Pa is not a base unit, we would need to convert to N/m². As N is also not a base unit, we would need to convert to kg·m/s². So, 1 kPa is actually 1000(kg·m/s²)/m². How would we document this? It's not impossible, but it's quite convoluted. Therefore, our interpretation is that this uom should actually be a reference to a unit already defined elsewhere.
In the provided example, minutes are not base units of the UCUM, but their conversion to seconds (which is a base unit) is clearly defined and can be found through the UomIdentifier. In other words, the previous example could have been documented in the following way because minutes are already described in the list of units defined by UCUM:
<gml:ConventionalUnit gml:id="ConventionalUnit_1">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">h</gml:identifier>
<gml:conversionToPreferredUnit uom="min, https://ucum.org/ucum">
<gml:factor>60</gml:factor>
</gml:conversionToPreferredUnit>
</gml:ConventionalUnit>
Here is an example where they refer to other units defined within the same document, which we believe is in line with what we are proposing: https://schemas.isotc211.org/schemas/19139/-/resources/uom/gmxUom.xml.
<gml:ConventionalUnit gml:id="ConventionalUnit_2">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">°C</gml:identifier>
<gml:conversionToPreferredUnit uom="K, https://ucum.org/ucum">
<gml:formula>°C-273.15</gml:formula>
</gml:conversionToPreferredUnit>
</gml:ConventionalUnit>
In this case, as Celsius degrees are not a base unit and their conversion to Kelvin is not based on a multiplicative factor, we use the <gml:formula> element to document the formula that allows for the corresponding conversion.
Note: The factor and formula are mutually exclusive elements, meaning we document one or the other, but not both simultaneously. This makes sense because any factor can be incorporated into the formula itself.
<gml:ConventionalUnit gml:id="ConventionalUnit_3">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">l</gml:identifier>
<gml:conversionToPreferredUnit uom="m, https://ucum.org/ucum">
<gml:factor>0.001</gml:factor>
</gml:conversionToPreferredUnit>
<gml:derivationUnitTerm uom="m,https://www.bipm.org" exponent="3"/>
</gml:ConventionalUnit>
Here we have that 1 liter (1 l) is equal to 1 cubic decimeter (1 dm³). As dm³ is not a base unit, we will use meters (m). To indicate that it is in m³, we use the <gml:derivationUnitTerm> element, where we have the exponent attribute, which is always an integer indicating the exponent to which the unit documented is raised in the uom attribute (as seen in previous examples). Thus, what we are saying here is that 1 liter is equal to 0.001 m³.
<gml:ConventionalUnit gml:id="ConventionalUnit_4">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">pH</gml:identifier>
<gml:conversionToPreferredUnit uom="mol/l, https://ucum.org/ucum">
<gml:formula> 10^-pH </gml:formula>
</gml:conversionToPreferredUnit>
<gml:derivationUnitTerm uom="mol, https://ucum.org/ucum " exponent="1"/>
<gml:derivationUnitTerm uom="l, https://ucum.org/ucum " exponent="-1"/>
</gml:ConventionalUnit>
In this case, the pH is defined as (- log X), where X is a concentration expressed in mol/l. Therefore, we need to document a conversion formula using the <gml:formula> element, and we need to document the two derived terms that form the preferred unit using the <gml:derivationUnitTerm> elements.
<gml:DerivedUnit gml:id="DerivedUnit_1">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">Hz</gml:identifier>
<gml:derivationUnitTerm uom="s,https://www.bipm.org" exponent="-1"/>
</gml:DerivedUnit>
In this case, besides the identifier of the unit that we have seen in the previous examples, we need to indicate from which known units the measurement we are documenting is derived. We do this through the <gml:derivationUnitTerm> element where we specify, as we have seen in conventional units, the uom and the corresponding exponent.
<gml:DerivedUnit gml:id="DerivedUnit_2">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">N</gml:identifier>
<gml:derivationUnitTerm uom="kg,https://www.bipm.org" exponent="1"/>
<gml:derivationUnitTerm uom="m,https://www.bipm.org" exponent="1"/>
<gml:derivationUnitTerm uom="s,https://www.bipm.org" exponent="-2"/>
</gml:DerivedUnit>
In this case, since the Newton is a combination of three different units, we need to list three <gml:derivationUnitTerm> elements with their respective uom and exponents.
<gml:DerivedUnit gml:id="DerivedUnit_3">
<gml:identifier codeSpace="urn:ogc:def:uom:UCUM">ppm</gml:identifier>
<gml:derivationUnitTerm uom="1" exponent="-6"/>
</gml:DerivedUnit>
Dimensionless units, such as percentages, parts per million, etc., appear in UCUM as derived units, and therefore, they would be documented following the previous example. Nevertheless, if documented as conventional units, the result would not be significantly different.