| 1 |
$schema: "https://json-schema.org/draft/2020-12/schema" |
| 2 |
$id: "https://schemas.optimade.org/meta/v1.2/optimade/unit_entity_definition" |
| 3 |
title: "OPTIMADE unit entity definition schema" |
| 4 |
description: "Meta-schema for definitions of physical units, constants, and prefixes." |
| 5 |
type: object |
| 6 |
required: ['$id', '$schema', 'x-optimade-definition'] |
| 7 |
allOf: |
| 8 |
- $ref: "#/$defs/unit_entity_definition_field" |
| 9 |
$defs: |
| 10 |
id_field: |
| 11 |
$$inherit: "/v1.2/common/id_field" |
| 12 |
symbol_list: |
| 13 |
$$inherit: "/v1.2/common/symbol_list" |
| 14 |
resource_list: |
| 15 |
$$inherit: "/v1.2/common/resource_list" |
| 16 |
unit_entity_definition_field: |
| 17 |
required: ['title', 'symbol', 'display-symbol','description'] |
| 18 |
additionalProperties: False |
| 19 |
patternProperties: |
| 20 |
"^_": {} |
| 21 |
properties: |
| 22 |
"$id": |
| 23 |
allOf: |
| 24 |
- $ref: "#/$defs/id_field" |
| 25 |
- description: |- |
| 26 |
A static IRI identifier that is a URN or URL representing the specific version of the definition. |
| 27 |
|
| 28 |
(If it is a URL, clients SHOULD NOT assign any interpretation to the response when resolving that URL.) |
| 29 |
It SHOULD NOT be changed as long as the definition functionally remains identical, and SHOULD be changed when the definition changes. |
| 30 |
For example, definitions SHOULD be regarded as the same if they only differ by, e.g.: |
| 31 |
|
| 32 |
- Additions or corrections of clarifying or historical notes to the `description` field. |
| 33 |
- Changes to the fields `deprecated` and `$comment` on any level. |
| 34 |
|
| 35 |
Note that this means that the version number part of the URL is *retained* even in newer releases of the OPTIMADE standard as long as the definition remains functionally identical. |
| 36 |
"$comment": |
| 37 |
type: string |
| 38 |
"$schema": |
| 39 |
description: |- |
| 40 |
A normalized URI for a meta-schema that validates the definition. |
| 41 |
approximate-relations: |
| 42 |
items: |
| 43 |
patternProperties: |
| 44 |
"^_": {} |
| 45 |
additionalProperties: False |
| 46 |
properties: |
| 47 |
base-units: |
| 48 |
allOf: |
| 49 |
- $ref: "#/$defs/symbol_list" |
| 50 |
- items: |
| 51 |
properties: |
| 52 |
id: |
| 53 |
description: "The IRI of one of the units referenced in the dimensional formula for the defining relation." |
| 54 |
symbol: |
| 55 |
description: "The symbol used to reference this unit in the dimensional formula." |
| 56 |
base-units-expression: |
| 57 |
type: string |
| 58 |
offset: |
| 59 |
patternProperties: |
| 60 |
"^_": {} |
| 61 |
additionalProperties: False |
| 62 |
properties: |
| 63 |
standard_uncertainty: |
| 64 |
type: number |
| 65 |
value: |
| 66 |
type: number |
| 67 |
required: |
| 68 |
- value |
| 69 |
type: object |
| 70 |
scale: |
| 71 |
patternProperties: |
| 72 |
"^_": {} |
| 73 |
additionalProperties: False |
| 74 |
properties: |
| 75 |
standard_uncertainty: |
| 76 |
type: number |
| 77 |
value: |
| 78 |
type: number |
| 79 |
required: |
| 80 |
- value |
| 81 |
type: object |
| 82 |
type: object |
| 83 |
type: array |
| 84 |
compatibility: |
| 85 |
type: array |
| 86 |
items: |
| 87 |
$ref: "#/$defs/id_field" |
| 88 |
defining-relation: |
| 89 |
description: |- |
| 90 |
A dictionary that encodes a defining relation to a unit or set of units, with the primary intended use of reproduce the definition of the entity in SI units, if such a relationship exists. |
| 91 |
Some units, e.g., the atomic mass unit (also known as dalton, commonly denoted `u`), only has an approximate relationship to SI units, in which case the `defining-relation` MUST be omitted or `null`. |
| 92 |
|
| 93 |
If the fields in `scale` are designated as `sn`, `sd`, and `se`; and the fields in `offset` are designated as `on`, `od`, and `oe`; and `base-units-expression` is designated as `b`, these fields state the following defining relation: a value `v` multiplied by the unit being defined is equal to the following expression `(v * (sn/sd) * 10**se + (on/od) * 10**oe)*b`, where `*` designates multiplication and `**` designates exponentiation. |
| 94 |
additionalProperties: False |
| 95 |
patternProperties: |
| 96 |
"^_": {} |
| 97 |
properties: |
| 98 |
base-units: |
| 99 |
allOf: |
| 100 |
- $ref: "#/$defs/symbol_list" |
| 101 |
- items: |
| 102 |
properties: |
| 103 |
id: |
| 104 |
description: "The IRI of one of the units referenced in the dimensional formula for the defining relation." |
| 105 |
symbol: |
| 106 |
description: "The symbol used to reference this unit in the dimensional formula." |
| 107 |
base-units-expression: |
| 108 |
description: |- |
| 109 |
A string expressing the base units part of the defining relation for the unit being defined. |
| 110 |
|
| 111 |
A compound unit expression is created by a sequence of constants, prefixes, and unit symbols separated by a single multiplication `*` symbol. |
| 112 |
Each unit symbol can also be suffixed by a single `^` symbol followed by a positive or negative integer to indicate the power of the preceding unit, e.g., `m^3` for cubic meter, `m^-3` for inverse cubic meter. |
| 113 |
(Positive integers MUST NOT be preceded by a plus sign.) |
| 114 |
Furthermore: |
| 115 |
|
| 116 |
- No whitespace, parenthesis, or other symbols than specified above are permitted. |
| 117 |
- The unit symbols MUST appear in alphabetical order. |
| 118 |
type: string |
| 119 |
scale: |
| 120 |
description: |- |
| 121 |
A dictionary specifying the scale in the defining relation. |
| 122 |
|
| 123 |
The four fields `numerator`, `denominator`, `base`, and `exponent` specify the value as the rational number `numerator` / `denominator`, multiplied by `base` to the power of `exponent`. |
| 124 |
If omitted or `null`, the defaults for the `numerator`, `denominator`, `base` and `exponent` are respectively 1, 1, 10, and 0. |
| 125 |
patternProperties: |
| 126 |
"^_": {} |
| 127 |
additionalProperties: False |
| 128 |
properties: |
| 129 |
denominator: |
| 130 |
type: integer |
| 131 |
numerator: |
| 132 |
type: integer |
| 133 |
exponent: |
| 134 |
type: integer |
| 135 |
base: |
| 136 |
type: integer |
| 137 |
standard_uncertainty: |
| 138 |
type: number |
| 139 |
type: object |
| 140 |
offset: |
| 141 |
description: |- |
| 142 |
The four fields `numerator`, `denominator`, `base`, and `exponent` specify the value as the rational number `numerator` / `denominator`, multiplied by `base` to the power of `exponent`. |
| 143 |
If omitted or `null`, the defaults for the `numerator`, `denominator`, `base` and `exponent` are respectively 0, 1, 10, and 0. |
| 144 |
patternProperties: |
| 145 |
"^_": {} |
| 146 |
additionalProperties: False |
| 147 |
properties: |
| 148 |
denominator: |
| 149 |
type: integer |
| 150 |
exponent: |
| 151 |
type: integer |
| 152 |
numerator: |
| 153 |
type: integer |
| 154 |
base: |
| 155 |
type: integer |
| 156 |
standard_uncertainty: |
| 157 |
type: number |
| 158 |
type: object |
| 159 |
type: object |
| 160 |
description: |
| 161 |
description: |- |
| 162 |
A human-readable multiline detailed description of the defined entity. |
| 163 |
type: string |
| 164 |
resources: |
| 165 |
$ref: "#/$defs/resource_list" |
| 166 |
standard: |
| 167 |
description: "This field is used to reference a preexisting standard for the defined entity." |
| 168 |
patternProperties: |
| 169 |
"^_": {} |
| 170 |
additionalProperties: False |
| 171 |
properties: |
| 172 |
name: |
| 173 |
description: "The abbreviated name of the standard being referenced." |
| 174 |
enum: |
| 175 |
- gnu units |
| 176 |
- ucum |
| 177 |
- qudt |
| 178 |
- si |
| 179 |
- codata |
| 180 |
- iso-iec-80000 |
| 181 |
type: string |
| 182 |
symbol: |
| 183 |
description: |- |
| 184 |
The symbol to use from the referenced standard, expressed according to that standard. |
| 185 |
The field MAY use mathematical expressions written to render correctly with the LaTeX mode of Mathjax 3.2. |
| 186 |
This field MAY be different from the symbol being defined via the definition if the unit will be referenced in `x-optimade-unit` fields using a different symbol than the one used in the standard or if the symbol is expressed in the standard in a way that requires mathematical notation. |
| 187 |
However, if possible, the `symbol` fields SHOULD be the same. |
| 188 |
type: string |
| 189 |
year: |
| 190 |
description: |- |
| 191 |
The year that the standards organization adopted the definition. |
| 192 |
type: integer |
| 193 |
category: |
| 194 |
description: |- |
| 195 |
The category that the standards organization have used for the definition. |
| 196 |
type: string |
| 197 |
version: |
| 198 |
description: |- |
| 199 |
A version string of the referenced standard. |
| 200 |
type: string |
| 201 |
required: |
| 202 |
- name |
| 203 |
- symbol |
| 204 |
type: object |
| 205 |
symbol: |
| 206 |
description: "Specifies the symbol to be used in `x-optimade-unit` to reference the defined entity." |
| 207 |
type: string |
| 208 |
pattern: ^[a-zA-Z_][a-zA-Z_0-9]*$ |
| 209 |
display-symbol: |
| 210 |
description: |- |
| 211 |
The suggested standard typographical symbolic representation of the defined entity. |
| 212 |
Formatting in the text SHOULD use Markdown in the CommonMark v0.3 format, with mathematical expressions written to render correctly with the LaTeX mode of Mathjax 3.2. |
| 213 |
type: string |
| 214 |
alternate-symbols: |
| 215 |
description: |- |
| 216 |
A list of other symbols often used for the defined entity. |
| 217 |
Formatting in the text SHOULD use Markdown in the CommonMark v0.3 format, with mathematical expressions written to render correctly with the LaTeX mode of Mathjax 3.2. |
| 218 |
type: array |
| 219 |
items: |
| 220 |
type: string |
| 221 |
title: |
| 222 |
description: "The standard human-readable name of the defined entity." |
| 223 |
type: string |
| 224 |
x-optimade-definition: |
| 225 |
$$inherit: "x-optimade-definition-field" |
| 226 |
|