unitsdb 2.1.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +8 -1
- data/.gitignore +2 -0
- data/.gitmodules +4 -3
- data/.rubocop.yml +13 -8
- data/.rubocop_todo.yml +217 -100
- data/CLAUDE.md +55 -0
- data/Gemfile +4 -1
- data/README.adoc +283 -16
- data/data/dimensions.yaml +1864 -0
- data/data/prefixes.yaml +874 -0
- data/data/quantities.yaml +3715 -0
- data/data/scales.yaml +97 -0
- data/data/schemas/dimensions-schema.yaml +153 -0
- data/data/schemas/prefixes-schema.yaml +155 -0
- data/data/schemas/quantities-schema.yaml +117 -0
- data/data/schemas/scales-schema.yaml +106 -0
- data/data/schemas/unit_systems-schema.yaml +116 -0
- data/data/schemas/units-schema.yaml +215 -0
- data/data/unit_systems.yaml +78 -0
- data/data/units.yaml +14052 -0
- data/exe/unitsdb +7 -1
- data/lib/unitsdb/cli.rb +42 -15
- data/lib/unitsdb/commands/_modify.rb +40 -4
- data/lib/unitsdb/commands/base.rb +6 -2
- data/lib/unitsdb/commands/check_si/si_formatter.rb +488 -0
- data/lib/unitsdb/commands/check_si/si_matcher.rb +487 -0
- data/lib/unitsdb/commands/check_si/si_ttl_parser.rb +103 -0
- data/lib/unitsdb/commands/check_si/si_updater.rb +254 -0
- data/lib/unitsdb/commands/check_si.rb +54 -35
- data/lib/unitsdb/commands/get.rb +11 -10
- data/lib/unitsdb/commands/normalize.rb +21 -7
- data/lib/unitsdb/commands/qudt/check.rb +150 -0
- data/lib/unitsdb/commands/qudt/formatter.rb +194 -0
- data/lib/unitsdb/commands/qudt/matcher.rb +746 -0
- data/lib/unitsdb/commands/qudt/ttl_parser.rb +403 -0
- data/lib/unitsdb/commands/qudt/update.rb +126 -0
- data/lib/unitsdb/commands/qudt/updater.rb +189 -0
- data/lib/unitsdb/commands/qudt.rb +82 -0
- data/lib/unitsdb/commands/release.rb +12 -9
- data/lib/unitsdb/commands/search.rb +12 -11
- data/lib/unitsdb/commands/ucum/check.rb +42 -29
- data/lib/unitsdb/commands/ucum/formatter.rb +2 -1
- data/lib/unitsdb/commands/ucum/matcher.rb +23 -9
- data/lib/unitsdb/commands/ucum/update.rb +14 -13
- data/lib/unitsdb/commands/ucum/updater.rb +40 -6
- data/lib/unitsdb/commands/ucum/xml_parser.rb +0 -2
- data/lib/unitsdb/commands/ucum.rb +44 -4
- data/lib/unitsdb/commands/validate/identifiers.rb +2 -4
- data/lib/unitsdb/commands/validate/qudt_references.rb +111 -0
- data/lib/unitsdb/commands/validate/references.rb +36 -19
- data/lib/unitsdb/commands/validate/si_references.rb +3 -5
- data/lib/unitsdb/commands/validate/ucum_references.rb +105 -0
- data/lib/unitsdb/commands/validate.rb +67 -11
- data/lib/unitsdb/commands.rb +20 -0
- data/lib/unitsdb/database.rb +90 -52
- data/lib/unitsdb/dimension.rb +1 -4
- data/lib/unitsdb/dimension_details.rb +0 -1
- data/lib/unitsdb/dimensions.rb +0 -2
- data/lib/unitsdb/errors.rb +7 -0
- data/lib/unitsdb/prefix.rb +0 -4
- data/lib/unitsdb/prefix_reference.rb +0 -2
- data/lib/unitsdb/prefixes.rb +0 -1
- data/lib/unitsdb/quantities.rb +0 -2
- data/lib/unitsdb/quantity.rb +0 -6
- data/lib/unitsdb/qudt.rb +100 -0
- data/lib/unitsdb/root_unit_reference.rb +0 -3
- data/lib/unitsdb/scale.rb +0 -4
- data/lib/unitsdb/scale_reference.rb +0 -2
- data/lib/unitsdb/scales.rb +0 -2
- data/lib/unitsdb/si_derived_base.rb +0 -2
- data/lib/unitsdb/ucum.rb +14 -10
- data/lib/unitsdb/unit.rb +0 -10
- data/lib/unitsdb/unit_reference.rb +0 -2
- data/lib/unitsdb/unit_system.rb +1 -3
- data/lib/unitsdb/unit_system_reference.rb +0 -2
- data/lib/unitsdb/unit_systems.rb +0 -2
- data/lib/unitsdb/units.rb +0 -2
- data/lib/unitsdb/utils.rb +32 -21
- data/lib/unitsdb/version.rb +5 -1
- data/lib/unitsdb.rb +62 -14
- data/unitsdb.gemspec +6 -3
- metadata +52 -13
- data/lib/unitsdb/commands/si_formatter.rb +0 -485
- data/lib/unitsdb/commands/si_matcher.rb +0 -470
- data/lib/unitsdb/commands/si_ttl_parser.rb +0 -100
- data/lib/unitsdb/commands/si_updater.rb +0 -212
data/data/scales.yaml
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# yaml-language-server: $schema=schemas/scales-schema.yaml
|
|
2
|
+
---
|
|
3
|
+
schema_version: 2.0.0
|
|
4
|
+
scales:
|
|
5
|
+
- identifiers:
|
|
6
|
+
- id: continuous_ratio
|
|
7
|
+
type: unitsml
|
|
8
|
+
- id: s:continuous_ratio
|
|
9
|
+
type: unitsml
|
|
10
|
+
names:
|
|
11
|
+
- value: continuous ratio scale
|
|
12
|
+
lang: en
|
|
13
|
+
short: continuous_ratio
|
|
14
|
+
description:
|
|
15
|
+
- value: A measurement scale with continuous values and a true zero point, allowing
|
|
16
|
+
for ratio comparisons
|
|
17
|
+
lang: en
|
|
18
|
+
properties:
|
|
19
|
+
continuous: true
|
|
20
|
+
ordered: true
|
|
21
|
+
logarithmic: false
|
|
22
|
+
interval: true
|
|
23
|
+
ratio: true
|
|
24
|
+
- identifiers:
|
|
25
|
+
- id: continuous_interval
|
|
26
|
+
type: unitsml
|
|
27
|
+
- id: s:continuous_interval
|
|
28
|
+
type: unitsml
|
|
29
|
+
names:
|
|
30
|
+
- value: continuous interval scale
|
|
31
|
+
lang: en
|
|
32
|
+
short: continuous_interval
|
|
33
|
+
description:
|
|
34
|
+
- value: A measurement scale with continuous values but an arbitrary zero point,
|
|
35
|
+
allowing for interval but not ratio comparisons
|
|
36
|
+
lang: en
|
|
37
|
+
properties:
|
|
38
|
+
continuous: true
|
|
39
|
+
ordered: true
|
|
40
|
+
logarithmic: false
|
|
41
|
+
interval: true
|
|
42
|
+
ratio: false
|
|
43
|
+
- identifiers:
|
|
44
|
+
- id: logarithmic_ratio
|
|
45
|
+
type: unitsml
|
|
46
|
+
- id: s:logarithmic_ratio
|
|
47
|
+
type: unitsml
|
|
48
|
+
names:
|
|
49
|
+
- value: logarithmic ratio scale
|
|
50
|
+
lang: en
|
|
51
|
+
short: logarithmic_ratio
|
|
52
|
+
description:
|
|
53
|
+
- value: A scale where equal ratios appear as equal intervals, with a zero point
|
|
54
|
+
representing a reference value
|
|
55
|
+
lang: en
|
|
56
|
+
properties:
|
|
57
|
+
continuous: true
|
|
58
|
+
ordered: true
|
|
59
|
+
logarithmic: true
|
|
60
|
+
interval: true
|
|
61
|
+
ratio: true
|
|
62
|
+
- identifiers:
|
|
63
|
+
- id: logarithmic_field
|
|
64
|
+
type: unitsml
|
|
65
|
+
- id: s:logarithmic_field
|
|
66
|
+
type: unitsml
|
|
67
|
+
names:
|
|
68
|
+
- value: logarithmic field scale
|
|
69
|
+
lang: en
|
|
70
|
+
short: logarithmic_field
|
|
71
|
+
description:
|
|
72
|
+
- value: A logarithmic scale used for field quantities that uses natural logarithms
|
|
73
|
+
lang: en
|
|
74
|
+
properties:
|
|
75
|
+
continuous: true
|
|
76
|
+
ordered: true
|
|
77
|
+
logarithmic: true
|
|
78
|
+
interval: true
|
|
79
|
+
ratio: false
|
|
80
|
+
- identifiers:
|
|
81
|
+
- id: discrete
|
|
82
|
+
type: unitsml
|
|
83
|
+
- id: s:discrete
|
|
84
|
+
type: unitsml
|
|
85
|
+
names:
|
|
86
|
+
- value: discrete scale
|
|
87
|
+
lang: en
|
|
88
|
+
short: discrete
|
|
89
|
+
description:
|
|
90
|
+
- value: A scale consisting of discrete, countable values
|
|
91
|
+
lang: en
|
|
92
|
+
properties:
|
|
93
|
+
continuous: false
|
|
94
|
+
ordered: true
|
|
95
|
+
logarithmic: false
|
|
96
|
+
interval: true
|
|
97
|
+
ratio: true
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# yaml-language-server: $schema=http://json-schema.org/draft-06/schema
|
|
2
|
+
---
|
|
3
|
+
$schema: "http://json-schema.org/draft-06/schema#"
|
|
4
|
+
$id: "https://unitsml.org/schemas/dimensions-schema.yaml"
|
|
5
|
+
title: "Dimensions Database Schema"
|
|
6
|
+
description: "Schema for dimensions.yaml - defines fundamental physical dimensions"
|
|
7
|
+
|
|
8
|
+
type: object
|
|
9
|
+
required: ["schema_version", "dimensions"]
|
|
10
|
+
properties:
|
|
11
|
+
schema_version:
|
|
12
|
+
type: string
|
|
13
|
+
pattern: "^\\d+\\.\\d+\\.\\d+$"
|
|
14
|
+
description: "Semantic version of the schema"
|
|
15
|
+
dimensions:
|
|
16
|
+
type: array
|
|
17
|
+
description: "Array of dimension definitions"
|
|
18
|
+
items:
|
|
19
|
+
$ref: "#/definitions/Dimension"
|
|
20
|
+
|
|
21
|
+
definitions:
|
|
22
|
+
Dimension:
|
|
23
|
+
type: object
|
|
24
|
+
required: ["identifiers", "names", "short"]
|
|
25
|
+
properties:
|
|
26
|
+
identifiers:
|
|
27
|
+
type: array
|
|
28
|
+
description: "External identifiers for this dimension"
|
|
29
|
+
items:
|
|
30
|
+
$ref: "#/definitions/Identifier"
|
|
31
|
+
names:
|
|
32
|
+
type: array
|
|
33
|
+
description: "Multilingual names for this dimension"
|
|
34
|
+
items:
|
|
35
|
+
$ref: "#/definitions/Name"
|
|
36
|
+
short:
|
|
37
|
+
type: string
|
|
38
|
+
description: "Short identifier for the dimension"
|
|
39
|
+
dimensionless:
|
|
40
|
+
type: boolean
|
|
41
|
+
description: "Whether this is a dimensionless quantity"
|
|
42
|
+
length:
|
|
43
|
+
$ref: "#/definitions/DimensionComponent"
|
|
44
|
+
description: "Length dimension component"
|
|
45
|
+
mass:
|
|
46
|
+
$ref: "#/definitions/DimensionComponent"
|
|
47
|
+
description: "Mass dimension component"
|
|
48
|
+
time:
|
|
49
|
+
$ref: "#/definitions/DimensionComponent"
|
|
50
|
+
description: "Time dimension component"
|
|
51
|
+
electric_current:
|
|
52
|
+
$ref: "#/definitions/DimensionComponent"
|
|
53
|
+
description: "Electric current dimension component"
|
|
54
|
+
thermodynamic_temperature:
|
|
55
|
+
$ref: "#/definitions/DimensionComponent"
|
|
56
|
+
description: "Thermodynamic temperature dimension component"
|
|
57
|
+
amount_of_substance:
|
|
58
|
+
$ref: "#/definitions/DimensionComponent"
|
|
59
|
+
description: "Amount of substance dimension component"
|
|
60
|
+
luminous_intensity:
|
|
61
|
+
$ref: "#/definitions/DimensionComponent"
|
|
62
|
+
description: "Luminous intensity dimension component"
|
|
63
|
+
plane_angle:
|
|
64
|
+
$ref: "#/definitions/DimensionComponent"
|
|
65
|
+
description: "Plane angle dimension component"
|
|
66
|
+
references:
|
|
67
|
+
type: array
|
|
68
|
+
description: "External references and citations"
|
|
69
|
+
items:
|
|
70
|
+
$ref: "#/definitions/Reference"
|
|
71
|
+
|
|
72
|
+
Identifier:
|
|
73
|
+
type: object
|
|
74
|
+
required: ["type", "id"]
|
|
75
|
+
properties:
|
|
76
|
+
type:
|
|
77
|
+
type: string
|
|
78
|
+
enum: ["nist", "unitsml", "si-digital-framework"]
|
|
79
|
+
description: "Type of identifier system"
|
|
80
|
+
id:
|
|
81
|
+
type: string
|
|
82
|
+
description: "Identifier value within the system"
|
|
83
|
+
|
|
84
|
+
Name:
|
|
85
|
+
type: object
|
|
86
|
+
required: ["value", "lang"]
|
|
87
|
+
properties:
|
|
88
|
+
value:
|
|
89
|
+
type: string
|
|
90
|
+
description: "Name in the specified language"
|
|
91
|
+
lang:
|
|
92
|
+
type: string
|
|
93
|
+
pattern: "^[a-z]{2}(-[A-Z]{2})?$"
|
|
94
|
+
description: "Language code (ISO 639-1, optionally with ISO 3166-1 country)"
|
|
95
|
+
|
|
96
|
+
Symbol:
|
|
97
|
+
type: object
|
|
98
|
+
required: ["latex", "unicode", "ascii", "html", "id", "mathml"]
|
|
99
|
+
properties:
|
|
100
|
+
latex:
|
|
101
|
+
type: string
|
|
102
|
+
description: "LaTeX representation"
|
|
103
|
+
unicode:
|
|
104
|
+
type: string
|
|
105
|
+
description: "Unicode representation"
|
|
106
|
+
ascii:
|
|
107
|
+
type: string
|
|
108
|
+
description: "ASCII representation"
|
|
109
|
+
html:
|
|
110
|
+
type: string
|
|
111
|
+
description: "HTML representation"
|
|
112
|
+
id:
|
|
113
|
+
type: string
|
|
114
|
+
description: "Identifier for the symbol"
|
|
115
|
+
mathml:
|
|
116
|
+
type: string
|
|
117
|
+
description: "MathML representation"
|
|
118
|
+
|
|
119
|
+
DimensionComponent:
|
|
120
|
+
type: object
|
|
121
|
+
required: ["power", "symbol"]
|
|
122
|
+
properties:
|
|
123
|
+
power:
|
|
124
|
+
type: integer
|
|
125
|
+
description: "Exponent for this dimension component"
|
|
126
|
+
symbol:
|
|
127
|
+
type: string
|
|
128
|
+
description: "Symbol representing this dimension"
|
|
129
|
+
symbols:
|
|
130
|
+
type: array
|
|
131
|
+
description: "Mathematical and textual representations"
|
|
132
|
+
items:
|
|
133
|
+
$ref: "#/definitions/Symbol"
|
|
134
|
+
|
|
135
|
+
Reference:
|
|
136
|
+
type: object
|
|
137
|
+
required: ["type"]
|
|
138
|
+
properties:
|
|
139
|
+
type:
|
|
140
|
+
type: string
|
|
141
|
+
enum: ["informative", "normative"]
|
|
142
|
+
description: "Type of reference"
|
|
143
|
+
authority:
|
|
144
|
+
type: string
|
|
145
|
+
description: "Authoritative body or organization"
|
|
146
|
+
enum: ["si-digital-framework", "qudt", "ucum", "nist"]
|
|
147
|
+
uri:
|
|
148
|
+
type: string
|
|
149
|
+
format: "uri"
|
|
150
|
+
description: "URI to the reference"
|
|
151
|
+
title:
|
|
152
|
+
type: string
|
|
153
|
+
description: "Title of the reference"
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# yaml-language-server: $schema=http://json-schema.org/draft-06/schema
|
|
2
|
+
---
|
|
3
|
+
$schema: "http://json-schema.org/draft-06/schema"
|
|
4
|
+
$id: "https://unitsml.org/schemas/prefixes-schema.yaml"
|
|
5
|
+
title: "Prefixes Database Schema"
|
|
6
|
+
description: "Schema for prefixes.yaml - defines unit prefixes with their multipliers and symbols"
|
|
7
|
+
|
|
8
|
+
type: object
|
|
9
|
+
required: ["schema_version", "prefixes"]
|
|
10
|
+
properties:
|
|
11
|
+
schema_version:
|
|
12
|
+
type: string
|
|
13
|
+
pattern: "^\\d+\\.\\d+\\.\\d+$"
|
|
14
|
+
description: "Semantic version of the schema"
|
|
15
|
+
prefixes:
|
|
16
|
+
type: array
|
|
17
|
+
description: "Array of prefix definitions"
|
|
18
|
+
items:
|
|
19
|
+
$ref: "#/definitions/Prefix"
|
|
20
|
+
|
|
21
|
+
definitions:
|
|
22
|
+
Prefix:
|
|
23
|
+
type: object
|
|
24
|
+
required: ["identifiers", "names", "base", "power", "short", "symbols"]
|
|
25
|
+
properties:
|
|
26
|
+
identifiers:
|
|
27
|
+
type: array
|
|
28
|
+
description: "External identifiers for this prefix"
|
|
29
|
+
items:
|
|
30
|
+
$ref: "#/definitions/Identifier"
|
|
31
|
+
names:
|
|
32
|
+
type: array
|
|
33
|
+
description: "Multilingual names for this prefix"
|
|
34
|
+
items:
|
|
35
|
+
$ref: "#/definitions/Name"
|
|
36
|
+
base:
|
|
37
|
+
type: integer
|
|
38
|
+
description: "Base number for the prefix (e.g., 10 for decimal, 2 for binary)"
|
|
39
|
+
power:
|
|
40
|
+
type: integer
|
|
41
|
+
description: "Power/exponent for the prefix"
|
|
42
|
+
short:
|
|
43
|
+
type: string
|
|
44
|
+
description: "Short identifier for the prefix"
|
|
45
|
+
symbols:
|
|
46
|
+
type: array
|
|
47
|
+
description: "Mathematical and textual representations"
|
|
48
|
+
items:
|
|
49
|
+
$ref: "#/definitions/PrefixSymbol"
|
|
50
|
+
references:
|
|
51
|
+
type: array
|
|
52
|
+
description: "External references and citations"
|
|
53
|
+
items:
|
|
54
|
+
$ref: "#/definitions/Reference"
|
|
55
|
+
|
|
56
|
+
Identifier:
|
|
57
|
+
type: object
|
|
58
|
+
required: ["type", "id"]
|
|
59
|
+
properties:
|
|
60
|
+
type:
|
|
61
|
+
type: string
|
|
62
|
+
enum: ["nist", "unitsml", "ucum", "si-digital-framework"]
|
|
63
|
+
description: "Type of identifier system"
|
|
64
|
+
id:
|
|
65
|
+
type: string
|
|
66
|
+
description: "Identifier value within the system"
|
|
67
|
+
|
|
68
|
+
Name:
|
|
69
|
+
type: object
|
|
70
|
+
required: ["value", "lang"]
|
|
71
|
+
properties:
|
|
72
|
+
value:
|
|
73
|
+
type: string
|
|
74
|
+
description: "Name in the specified language"
|
|
75
|
+
lang:
|
|
76
|
+
type: string
|
|
77
|
+
pattern: "^[a-z]{2}(-[A-Z]{2})?$"
|
|
78
|
+
description: "Language code (ISO 639-1, optionally with ISO 3166-1 country)"
|
|
79
|
+
|
|
80
|
+
Symbol:
|
|
81
|
+
type: object
|
|
82
|
+
required: ["type"]
|
|
83
|
+
properties:
|
|
84
|
+
type:
|
|
85
|
+
type: string
|
|
86
|
+
enum: ["latex", "unicode", "ascii", "html", "id", "mathml"]
|
|
87
|
+
description: "Type of symbol representation"
|
|
88
|
+
value:
|
|
89
|
+
type: string
|
|
90
|
+
description: "Symbol value (required for most types)"
|
|
91
|
+
allOf:
|
|
92
|
+
- if:
|
|
93
|
+
properties:
|
|
94
|
+
type:
|
|
95
|
+
const: "id"
|
|
96
|
+
then:
|
|
97
|
+
not:
|
|
98
|
+
required: ["value"]
|
|
99
|
+
else:
|
|
100
|
+
required: ["value"]
|
|
101
|
+
|
|
102
|
+
PrefixSymbol:
|
|
103
|
+
type: object
|
|
104
|
+
required: ["latex", "unicode", "ascii", "html", "id", "mathml"]
|
|
105
|
+
properties:
|
|
106
|
+
latex:
|
|
107
|
+
type: string
|
|
108
|
+
description: "LaTeX representation"
|
|
109
|
+
unicode:
|
|
110
|
+
type: string
|
|
111
|
+
description: "Unicode representation"
|
|
112
|
+
ascii:
|
|
113
|
+
type: string
|
|
114
|
+
description: "ASCII representation"
|
|
115
|
+
html:
|
|
116
|
+
type: string
|
|
117
|
+
description: "HTML representation"
|
|
118
|
+
id:
|
|
119
|
+
type: string
|
|
120
|
+
description: "Identifier for the symbol"
|
|
121
|
+
mathml:
|
|
122
|
+
type: string
|
|
123
|
+
description: "MathML representation"
|
|
124
|
+
|
|
125
|
+
Multiplier:
|
|
126
|
+
type: object
|
|
127
|
+
required: ["base", "power"]
|
|
128
|
+
properties:
|
|
129
|
+
base:
|
|
130
|
+
type: integer
|
|
131
|
+
minimum: 2
|
|
132
|
+
description: "Base of the multiplier (typically 10)"
|
|
133
|
+
power:
|
|
134
|
+
type: integer
|
|
135
|
+
description: "Exponent for the multiplier"
|
|
136
|
+
|
|
137
|
+
Reference:
|
|
138
|
+
type: object
|
|
139
|
+
required: ["type"]
|
|
140
|
+
properties:
|
|
141
|
+
type:
|
|
142
|
+
type: string
|
|
143
|
+
enum: ["informative", "normative"]
|
|
144
|
+
description: "Type of reference"
|
|
145
|
+
authority:
|
|
146
|
+
type: string
|
|
147
|
+
description: "Authoritative body or organization"
|
|
148
|
+
enum: ["si-digital-framework", "qudt", "ucum", "nist"]
|
|
149
|
+
uri:
|
|
150
|
+
type: string
|
|
151
|
+
format: "uri"
|
|
152
|
+
description: "URI to the reference"
|
|
153
|
+
title:
|
|
154
|
+
type: string
|
|
155
|
+
description: "Title of the reference"
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# yaml-language-server: $schema=http://json-schema.org/draft-06/schema
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
$schema: "http://json-schema.org/draft-06/schema#"
|
|
5
|
+
$id: "https://unitsml.org/schemas/quantities-schema.yaml"
|
|
6
|
+
title: "Quantities Database Schema"
|
|
7
|
+
description: "Schema for quantities.yaml - defines physical quantities with their dimensional analysis"
|
|
8
|
+
|
|
9
|
+
type: object
|
|
10
|
+
required: ["schema_version", "quantities"]
|
|
11
|
+
properties:
|
|
12
|
+
schema_version:
|
|
13
|
+
type: string
|
|
14
|
+
pattern: "^\\d+\\.\\d+\\.\\d+$"
|
|
15
|
+
description: "Semantic version of the schema"
|
|
16
|
+
quantities:
|
|
17
|
+
type: array
|
|
18
|
+
description: "Array of quantity definitions"
|
|
19
|
+
items:
|
|
20
|
+
$ref: "#/definitions/Quantity"
|
|
21
|
+
|
|
22
|
+
definitions:
|
|
23
|
+
Quantity:
|
|
24
|
+
type: object
|
|
25
|
+
required: ["identifiers", "names", "dimension_reference", "quantity_type", "short"]
|
|
26
|
+
properties:
|
|
27
|
+
identifiers:
|
|
28
|
+
type: array
|
|
29
|
+
description: "External identifiers for this quantity"
|
|
30
|
+
items:
|
|
31
|
+
$ref: "#/definitions/Identifier"
|
|
32
|
+
names:
|
|
33
|
+
type: array
|
|
34
|
+
description: "Multilingual names for this quantity"
|
|
35
|
+
items:
|
|
36
|
+
$ref: "#/definitions/Name"
|
|
37
|
+
dimension_reference:
|
|
38
|
+
$ref: "#/definitions/DimensionReference"
|
|
39
|
+
description: "Reference to the dimension"
|
|
40
|
+
quantity_type:
|
|
41
|
+
type: string
|
|
42
|
+
enum: ["base", "derived"]
|
|
43
|
+
description: "Type of quantity (base or derived)"
|
|
44
|
+
short:
|
|
45
|
+
type: string
|
|
46
|
+
description: "Short identifier for the quantity"
|
|
47
|
+
references:
|
|
48
|
+
type: array
|
|
49
|
+
description: "External references and citations"
|
|
50
|
+
items:
|
|
51
|
+
$ref: "#/definitions/Reference"
|
|
52
|
+
|
|
53
|
+
Identifier:
|
|
54
|
+
type: object
|
|
55
|
+
required: ["type", "id"]
|
|
56
|
+
properties:
|
|
57
|
+
type:
|
|
58
|
+
type: string
|
|
59
|
+
description: "Type of identifier system"
|
|
60
|
+
id:
|
|
61
|
+
type: string
|
|
62
|
+
description: "Identifier value within the system"
|
|
63
|
+
|
|
64
|
+
Name:
|
|
65
|
+
type: object
|
|
66
|
+
required: ["value", "lang"]
|
|
67
|
+
properties:
|
|
68
|
+
value:
|
|
69
|
+
type: string
|
|
70
|
+
description: "Name in the specified language"
|
|
71
|
+
lang:
|
|
72
|
+
type: string
|
|
73
|
+
pattern: "^[a-z]{2}(-[A-Z]{2})?$"
|
|
74
|
+
description: "Language code (ISO 639-1, optionally with ISO 3166-1 country)"
|
|
75
|
+
|
|
76
|
+
DimensionReference:
|
|
77
|
+
type: object
|
|
78
|
+
required: ["type", "id"]
|
|
79
|
+
properties:
|
|
80
|
+
type:
|
|
81
|
+
type: string
|
|
82
|
+
const: "nist"
|
|
83
|
+
description: "Reference type indicator"
|
|
84
|
+
id:
|
|
85
|
+
type: string
|
|
86
|
+
description: "Dimension identifier"
|
|
87
|
+
|
|
88
|
+
Symbol:
|
|
89
|
+
type: object
|
|
90
|
+
required: ["type"]
|
|
91
|
+
properties:
|
|
92
|
+
type:
|
|
93
|
+
type: string
|
|
94
|
+
description: "Type of symbol representation"
|
|
95
|
+
value:
|
|
96
|
+
type: string
|
|
97
|
+
description: "Symbol value"
|
|
98
|
+
|
|
99
|
+
Reference:
|
|
100
|
+
type: object
|
|
101
|
+
required: ["type"]
|
|
102
|
+
properties:
|
|
103
|
+
type:
|
|
104
|
+
type: string
|
|
105
|
+
enum: ["informative", "normative"]
|
|
106
|
+
description: "Type of reference"
|
|
107
|
+
authority:
|
|
108
|
+
type: string
|
|
109
|
+
description: "Authoritative body or organization"
|
|
110
|
+
enum: ["si-digital-framework", "qudt", "ucum", "nist"]
|
|
111
|
+
uri:
|
|
112
|
+
type: string
|
|
113
|
+
format: "uri"
|
|
114
|
+
description: "URI to the reference"
|
|
115
|
+
title:
|
|
116
|
+
type: string
|
|
117
|
+
description: "Title of the reference"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# yaml-language-server: $schema=http://json-schema.org/draft-06/schema
|
|
2
|
+
---
|
|
3
|
+
$schema: "http://json-schema.org/draft-06/schema#"
|
|
4
|
+
$id: "https://unitsml.org/schemas/scales-schema.yaml"
|
|
5
|
+
title: "Scales Database Schema"
|
|
6
|
+
description: "Schema for scales.yaml - defines measurement scales with their mathematical properties"
|
|
7
|
+
|
|
8
|
+
type: object
|
|
9
|
+
required: ["schema_version", "scales"]
|
|
10
|
+
properties:
|
|
11
|
+
schema_version:
|
|
12
|
+
type: string
|
|
13
|
+
pattern: "^\\d+\\.\\d+\\.\\d+$"
|
|
14
|
+
description: "Semantic version of the schema"
|
|
15
|
+
scales:
|
|
16
|
+
type: array
|
|
17
|
+
description: "Array of scale definitions"
|
|
18
|
+
items:
|
|
19
|
+
$ref: "#/definitions/Scale"
|
|
20
|
+
|
|
21
|
+
definitions:
|
|
22
|
+
Scale:
|
|
23
|
+
type: object
|
|
24
|
+
required: ["identifiers", "names", "properties"]
|
|
25
|
+
properties:
|
|
26
|
+
identifiers:
|
|
27
|
+
type: array
|
|
28
|
+
description: "External identifiers for this scale"
|
|
29
|
+
items:
|
|
30
|
+
$ref: "#/definitions/Identifier"
|
|
31
|
+
names:
|
|
32
|
+
type: array
|
|
33
|
+
description: "Multilingual names for this scale"
|
|
34
|
+
items:
|
|
35
|
+
$ref: "#/definitions/Name"
|
|
36
|
+
properties:
|
|
37
|
+
$ref: "#/definitions/ScaleProperties"
|
|
38
|
+
description: "Mathematical properties of the scale"
|
|
39
|
+
references:
|
|
40
|
+
type: array
|
|
41
|
+
description: "External references and citations"
|
|
42
|
+
items:
|
|
43
|
+
$ref: "#/definitions/Reference"
|
|
44
|
+
|
|
45
|
+
Identifier:
|
|
46
|
+
type: object
|
|
47
|
+
required: ["type", "id"]
|
|
48
|
+
properties:
|
|
49
|
+
type:
|
|
50
|
+
type: string
|
|
51
|
+
description: "Type of identifier system"
|
|
52
|
+
id:
|
|
53
|
+
type: string
|
|
54
|
+
description: "Identifier value within the system"
|
|
55
|
+
|
|
56
|
+
Name:
|
|
57
|
+
type: object
|
|
58
|
+
required: ["value", "lang"]
|
|
59
|
+
properties:
|
|
60
|
+
value:
|
|
61
|
+
type: string
|
|
62
|
+
description: "Name in the specified language"
|
|
63
|
+
lang:
|
|
64
|
+
type: string
|
|
65
|
+
pattern: "^[a-z]{2}(-[A-Z]{2})?$"
|
|
66
|
+
description: "Language code (ISO 639-1, optionally with ISO 3166-1 country)"
|
|
67
|
+
|
|
68
|
+
ScaleProperties:
|
|
69
|
+
type: object
|
|
70
|
+
required: ["continuous", "ordered", "logarithmic", "interval", "ratio"]
|
|
71
|
+
properties:
|
|
72
|
+
continuous:
|
|
73
|
+
type: boolean
|
|
74
|
+
description: "Whether the scale is continuous"
|
|
75
|
+
ordered:
|
|
76
|
+
type: boolean
|
|
77
|
+
description: "Whether the scale has an ordering"
|
|
78
|
+
logarithmic:
|
|
79
|
+
type: boolean
|
|
80
|
+
description: "Whether the scale is logarithmic"
|
|
81
|
+
interval:
|
|
82
|
+
type: boolean
|
|
83
|
+
description: "Whether the scale has meaningful intervals"
|
|
84
|
+
ratio:
|
|
85
|
+
type: boolean
|
|
86
|
+
description: "Whether the scale has a meaningful zero point"
|
|
87
|
+
|
|
88
|
+
Reference:
|
|
89
|
+
type: object
|
|
90
|
+
required: ["type"]
|
|
91
|
+
properties:
|
|
92
|
+
type:
|
|
93
|
+
type: string
|
|
94
|
+
enum: ["informative", "normative"]
|
|
95
|
+
description: "Type of reference"
|
|
96
|
+
authority:
|
|
97
|
+
type: string
|
|
98
|
+
description: "Authoritative body or organization"
|
|
99
|
+
enum: ["si-digital-framework", "qudt", "ucum", "nist"]
|
|
100
|
+
uri:
|
|
101
|
+
type: string
|
|
102
|
+
format: "uri"
|
|
103
|
+
description: "URI to the reference"
|
|
104
|
+
title:
|
|
105
|
+
type: string
|
|
106
|
+
description: "Title of the reference"
|