Units¶
Units are recorded as a standard unit string on the unit field (for example, "Gram").
TetraScience standardizes unit spelling on QUDT 1.1 plus the Allotrope QUDT extension. The standard unit string is the fragment after the # in the unit’s QUDT URI. For example, the URI http://qudt.org/vocab/unit#SecondTime yields the unit name SecondTime (not Second), so SecondTime is what you record on the unit field.
Note that the unit field is a free-form string and is not restricted by the schema itself; using a standard unit is a modeling convention you are responsible for following, so that units stay consistent and are recognized by downstream tooling.
Special unit values¶
Use ArbitraryUnit when there should be a unit, but the unit doesn’t mean anything outside of instrument scope. For example, light absorbance.
Use Unitless for quantities which are unitless. For example, ratios or pH values.
Use null when there should be a unit, but it is not available in the raw file.
Example
{
"ph": {
"value": 7.1,
"unit": "Unitless"
},
"weight": {
"value": 2.3,
"unit": "Gram"
},
"numerical_variable_with_unknown_unit": {
"value": 102,
"unit": null
}
}
Finding the right unit — ts-lib-unit¶
For the curated set of units, how to look up the correct spelling for a given unit, and related conventions, refer to ts-lib-unit. This library contains the units curated by TetraScience and is the source of truth for unit standardization.
Its documentation is also published at ids.tetrascience.com/ts-lib-units/main/index.html.
If you need a unit that is not available in ts-lib-unit, do two things in parallel:
Capture the raw unit provided in the source data verbatim and document it alongside your IDS in the meantime. Do not invent your own unit name.
Issue a support ticket to request that the unit be added to
ts-lib-unit.