-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathschema.json
More file actions
316 lines (316 loc) · 9.3 KB
/
schema.json
File metadata and controls
316 lines (316 loc) · 9.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
{
"title": "Systems Schema",
"description": "A validation schema for systems.json",
"type": "object",
"required": true,
"additionalProperties": false,
"properties": {
"systems": {
"description": "A set of different systems of units in the form of a flattened tree",
"type": "object",
"required": true,
"additionalProperties": false,
"patternProperties": {
".+": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "A formal name for the unit system",
"type": "string",
"minLength": 1,
"required": true
},
"inherits": {
"description": "The key of the system it inherits from, if any",
"type": "string",
"minLength": 1,
"required": false
},
"category": {
"description": "True if a category of systems and not a system in its own right, else false. Defaults to false",
"type": "boolean",
"required": false
},
"historical": {
"description": "True if the unit system is not in current usage, else false",
"type": "boolean",
"required": false
},
"notes": {
"description": "Addtional notes as required",
"type": "string",
"required": false
}
}
}
}
},
"dimensions": {
"description": "A set of types of recognized physical dimensions that can be measured",
"type": "object",
"required": true,
"additionalProperties": false,
"patternProperties": {
".+": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "The common name of the dimension",
"type": "string",
"minLength": 1,
"required": true
},
"otherNames": {
"description": "Other names that are used to describe the dimension",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"symbol": {
"description": "The standard symbol of the dimension",
"type": "string",
"minLength": 1,
"required": true
},
"otherSymbols": {
"description": "Other symbols that are used to signify the dimension",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"baseUnit": {
"description": "The key of the unit that is other units can convert to/from",
"type": "string",
"minLength": 1,
"required": true
},
"derived": {
"description": "Describes how this dimension is derived from base dimensions. Multiple dimensions or a placeholder ('1') may be used, separated my * (multiplication) or / (division) symbols",
"type": "string",
"required": false
},
"dimensionless": {
"description": "True if the dimension is dimensionless, else false. Defaults to false.",
"type": "boolean",
"required": false
},
"vector": {
"description": "True if the dimension should be represented as a vector, else false if it should be a scalar",
"type": "boolean",
"required": true
},
"notes": {
"description": "Additional notes as required",
"type": "string",
"required": false
},
"inheritedUnits": {
"description": "The name of another dimension to inherit the units from.",
"type": "string",
"required": false
},
"units": {
"description": "A set of units that can be used to describe the dimension",
"type": "object",
"required": true,
"additionalProperties": false,
"patternProperties": {
".+": {
"type": "object",
"required": true,
"additionalProperties": false,
"properties": {
"name": {
"description": "The standard name of the unit",
"type": "string",
"minLength": 1,
"required": true
},
"plural": {
"description": "The plural form of the standard name of the unit",
"type": "string",
"minLength": 1,
"required": false
},
"otherNames": {
"description": "A set of other names that the unit is known by",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"symbol": {
"description": "The standard symbol of the dimension. Only optional if unit does not have a symbol",
"type": "string",
"minLength": 1,
"required": false
},
"otherSymbols": {
"description": "Other symbols used to signify the unit",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"symbolFirst": {
"description": "Determines if the symbol should appear before the value. Defaults to false",
"type": "boolean",
"required": false
},
"type": {
"description": "An enum describing the type of a unit and how it should be treated. range, fractional, whole may be added later",
"type": "string",
"required": true,
"enum": ["customary", "si", "binary"]
},
"systems": {
"description": "A set of unit systems that use this unit",
"type": "array",
"required": true,
"uniqueItems": true,
"description": "required needs to be set to true!",
"items": {
"type": "string"
}
},
"excludedSystems": {
"description": "A set of unit systems that are not allowed to use this unit. Useful for excluding specific systems classified lower in the system tree",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"tags": {
"description": "A set of tags to describe additional properties of a unit",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string",
"enum": ["dry-only", "fluid-only", "cooking"]
}
},
"multiplier": {
"description": "A scale factor to multiply by when converting from the base unit to this unit. Default is 1",
"type": "number",
"required": false
},
"uncertainty": {
"description": "The absolute uncertainty within a conversion between this unit and the base unit.",
"type": "number",
"required": false
},
"offset": {
"description": "A constant offset to add when converting from base unit to this unit",
"type": "number",
"required": false
},
"estimation": {
"description": "True if the multiplier and/or offset are estimated or not exact",
"type": "boolean",
"required": false
},
"rare": {
"description": "True if the unit rarely used within the unit systems it is part of, else false. Defaults to false",
"type": "boolean",
"required": false
},
"acceptedPrefixes": {
"description": "A set of the names of acceptable prefixes to apply to this unit",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"excludedPrefixes": {
"description": "A set of names of unacceptable prefixes to apply to this unit",
"type": "array",
"required": false,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"prefixName": {
"description": "The prefix already applied to this unit.",
"type": "string",
"required": false
},
"prefixFreeName": {
"description": "The name of the unit without prefix applied.",
"type": "string",
"required": false
},
"notes": {
"description": "Additional notes as required",
"type": "string",
"required": false
}
}
}
}
}
}
}
}
},
"prefixes": {
"type": "object",
"required": true,
"additionalProperties": false,
"patternProperties": {
".+": {
"type": "object",
"additionalProperties": false,
"properties": {
"symbol": {
"type": "string",
"required": true
},
"type": {
"type": "string",
"enum": ["si", "siBinary", "siUnofficial"],
"required": true
},
"base": {
"type": "number",
"required": false
},
"power": {
"type": "number",
"required": false
},
"multiplier": {
"type": "number",
"required": false
},
"rare": {
"type": "boolean",
"required": false
},
"notes": {
"type": "string",
"required": false
}
}
}
}
}
}
}