Foreword
This part defines what a conversion IS in this stack — the UnitsML 1.0 linear equation with its exactness and digit metadata — and the law of its application: exact rational arithmetic, offset cancellation on differences, precedence of definitions, and refusal of non-linear forms. The register carries the data (CalConnect 36814; this part carries the semantics.
Introduction
Conversions are where metrology data most easily lies: an exact tenth routed through a binary double, an offset applied to a temperature difference, a WSDL round-trip smuggled in as a linear factor. Each clause below closes one of those doors, and every door has a vector in Annex A.
1 Scope
This document specifies: the conversion equation and its attributes; exactness discipline; the difference application law and affine legality; definition resolution and application precedence; and refusal semantics for non-linear conversions.
Quantity resolution and gating are CalConnect 36815; the register’s conversion data is CalConnect 36814.
2 Normative references
The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
UnitsML 1.0 XSD Float64ConversionFromType, (the data syntax)
JCGM 100:2008, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION, ORGANISATION INTERNATIONALE DE NORMALISATION (ISO), INTERNATIONAL ELECTROTECHNICAL COMMISSION, COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE (IEC), INTERNATIONAL ORGANIZATION OF LEGAL METROLOGY, ORGANISATION INTERNATIONALE DE MÉTROLOGIE LÉGALE (OIML), INTERNATIONAL UNION OF PURE AND APPLIED CHEMISTRY, UNION INTERNATIONALE DE CHIMIE PURE ET APPLIQUÉE (IUPAC), INTERNATIONAL UNION OF PURE AND APPLIED PHYSICS, UNION INTERNATIONALE DE PHYSIQUE PURE ET APPLIQUÉE (IUPAP), INTERNATIONAL FEDERATION OF CLINICAL CHEMISTRY AND LABORATORY MEDICINE, FÉDÉRATION INTERNATIONALE DE CHIMIE CLINIQUE ET DE BIOLOGIE MOLÉCULAIRE (IFCC), INTERNATIONAL LABORATORY ACCREDITATION COOPERATION, COOPÉRATION INTERNATIONALE D’ACCRÉDITATION DES LABORATOIRES (ILAC), and BUREAU INTERNATIONAL DES POIDS ET MESURES (BIPM). Guide to the expression of uncertainty in measurement. Report no. JCGM 100:2008. First edition. Paris: International Bureau of Weights and Measures, Bureau international des poids et mesures; International Organization for Standardization, Organisation internationale de normalisation; International Electrotechnical Commission, Commission électrotechnique internationale, 2008. Available from: https://www.bipm.org/documents/20126/2071204/JCGM_100_2008_E.pdf/cb0ef43f-baa5-11cf-3f85-4dcd86f77bd6.
3 Terms and definitions
No terms and definitions are listed in this document.
linear conversion
a mapping of the form y = d + (b/c)(x + a) between two units.
affine unit
a unit whose conversion to its canonical anchor has a nonzero offset (degree Celsius, degree Fahrenheit).
difference conversion
the conversion of a Diff-typed quantity: factor-only (CalConnect 36815, I4).
refusal
a typed error identifying a conversion that this part does not permit to be approximated.
4 Conventions
Requirement language per CalConnect 36812. Attribute names are written as in the XSD (initialAddend, multiplicand, divisor, finalAddend, exact). All example factors are exact rationals serialized per CalConnect 36813.
5 The conversion equation
A linear conversion from unit x to unit y is
where a = initialAddend, b = multiplicand, c = divisor, d = finalAddend; defaults 0, 1, 1, 0. The inverse is x = (c/b)(y − d) − a. The equation is legal at power 1 of a single absolute unit only.
EXAMPLE
Expected outcome. Degree Celsius to kelvin: a = 0, b = 1, c = 1, d = 273.15, exact. 0 °C → 273.15 K; 100 °C → 373.15 K — exact rationals serialized "273.15" and "373.15".
6 Exactness and digit metadata
exact="true" conversions are computed in exact rational arithmetic (CalConnect 36813, with their lexical decimal attributes parsed exactly; an implementation never routes them through binary floating point. exact="false" or absent: the declared precision travels, and the result is never presented as exact. Digit metadata — multiplicandDigits, divisorDigits, initialAddendDecimalPlace, finalAddendDecimalPlace — are carried by data layers and never discarded on import.
EXAMPLE
Expected outcome. Degree Fahrenheit carries factor 5/9 and offset 229835/900 in the register: 32 °F → K is exactly 273.15, and the round-trip returns "32"-class exact values. Percent per degree carries the declared 0.5729577951308232087679815481 without an exact marker; its results are published at declared precision, never labelled exact.
7 Difference application and affine legality
The difference law of CalConnect 36815 Clause 9 governs application: absolutes convert affinely; differences (including uncertainty magnitudes and interval-endpoint distances) convert by the factor b/c alone. Affine units never appear inside composite expressions nor at powers ≠ 1; each is a specified error.
EXAMPLE
Expected outcome. (20 °C − 15 °C) → K is 5 K; an uncertainty magnitude 0.2 °C → K is 0.2 K; degC^2 and (degC)·(s) are specified errors. The canonical register entries encode the same law structurally — factor with offset only for the affine unit at power 1.
8 Definition resolution and precedence
When more than one definition exists, application order is:
caller-supplied conversion definition;
document-local <Conversions> resolved against the enclosing document;
the register canonical path (CalConnect 36814).
initialUnit and target references resolve by document fragment (#xml:id), SI Digital Framework URI, or IEC IRDI (via the register’s reference URIs and alias seeds); an unresolvable reference is a typed error naming it. When a local definition and the register disagree, the disagreement is reported as a diagnostic; the two paths are never applied in sequence (no double conversion), and the register is never silently overridden.
EXAMPLE
Expected outcome. An IEC 62720 payload converting percent to one (b = 0.01, exact) is recognized as agreeing with the register’s percent canonical entry; a disagreeing payload produces a diagnostic naming both factors, and the register value stands unless the maintainer intervenes.
9 Refusal semantics
SpecialConversionFrom and WSDLConversionFrom are refused with typed errors naming the conversion and its kind. Approximating a non-linear conversion by a linear factor is non-conforming. Logarithmic units without canonical data (dB, Np, B) refuse conversion the same way (“no derivation path”).
EXAMPLE
Expected outcome. Attempting dBm → W yields a typed refusal citing the logarithmic class; no numeric result is produced in any output format.
10 Known engine defect (normative test target)
The composition rule in reference implementations applies the base power twice: a sub-factor already raised to the base power is exponentiated again at the composition site. The red vector is ft²: (0.3048 m)² = 0.09290304 m²; an implementation returning 0.3048⁴ violates this part. CalConnect 36819 Annex B carries the vector; the fix rides unitsml-ruby#92.
11 Conformance
Conformance class quantity-conversion includes this part. Annex A defines the vector table; CalConnect 36819 Annex B freezes and replays it byte-identically across the reference implementation and parity runtimes.
Annex A
(normative)
Annex A (normative): conversion vectors
The conversion vector table is given in Table A.1; its final rows are the typed refusals, also replayed from CalConnect 36819, Annex B.
| Vector | Expected |
|---|---|
| 0 °C → K · 100 °C → K | 273.15 · 373.15 (exact rationals) |
| 32 °F → K → °F round-trip | 273.15 · exact identity |
| 1 mi → m | 1609.344 (exact) |
| 1 bar → Pa · 2 bar → Pa | 100 000 · 200 000 (register canonical) |
| percent → one (IEC 62720 import path) | 0.01 exact |
| percent per degree (non-exact) | declared-precision decimal 0.5729577951308232087679815481, never marked exact |
| (20 °C − 15 °C) → K | 5 K (offset cancels — CalConnect 36815 I1) |
| u = 0.2 °C → K | 0.2 K (factor-only — I4) |
| degC² · (degC)·(s) composites | specified errors (affine at power ≠ 1 / in composite) |
| ft² | 0.09290304 m² (double-power defect red/green) |
| SpecialConversionFrom · WSDLConversionFrom | typed refusal naming the conversion |
| unresolvable initialUnit | typed error naming the reference |
Bibliography
[1] unitsml/unitsdb, — #130 (data), #134 (corpus import), #139 (reading rules); UnitsML 1.0 XSD
[2] unitsml/unitsml-ruby#92, (application; double-power defect comment)