Skip to content

Commit 2f7246d

Browse files
committed
chore: update paths and mark spec for unitsdb 1.0.0
1 parent b7cfd3d commit 2f7246d

19 files changed

+69
-200
lines changed

metanorma.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ metanorma:
33
source:
44
files:
55
- sources/asciiunits/document.adoc
6+
- sources/unitsdb/document.adoc
67
# - sources/unitsml-guide/document.adoc
78
# - sources/unitsml-incorporation/document.adoc
89
# - sources/unitsml-ubl-ndr-subset/document.adoc

sources/unitsdb-spec/sections/02-normrefs.adoc

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

sources/unitsdb-spec/sections/01-scope.adoc renamed to sources/unitsdb/sections/01-scope.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This document specifies the data models, structures, and normalization rules for
44
UnitsDB, the authoritative database of measurement units, quantities,
55
dimensions, and prefixes for the UnitsML framework.
66

7+
NOTE: This document applies to UnitsDB version 1.0.0.
8+
79
The specification defines:
810

911
* The overall architecture of UnitsDB
@@ -15,15 +17,16 @@ The specification defines:
1517
1618
This document:
1719

18-
* Does not specify the software implementation details for using UnitsDB in applications
20+
* Does not specify implementation details for using UnitsDB in applications
1921
* Does not define algorithms for unit conversions or dimensional analysis (though the data provided supports these operations)
2022
* Does not provide a comprehensive list of all units, quantities, dimensions, and prefixes (these are provided in the actual database)
2123
2224
This specification is intended for:
2325

2426
* Developers implementing UnitsML systems
25-
* Database administrators managing UnitsDB installations
27+
* Developers managing UnitsDB database instances
2628
* Contributors extending or modifying the UnitsDB database
2729
* Standards developers referencing UnitsDB
2830
29-
The specification enables interoperable representation of measurement units and related concepts across different applications, domains, and systems.
31+
The specification enables interoperable representation of measurement units and
32+
related concepts across different applications, domains, and systems.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[bibliography]
2+
== Normative references
3+
4+
* [[SI_Brochure,BIPM SI Brochure]], SI Brochure: The International System of Units (SI), 9th edition, 2019, BIPM

sources/unitsdb-spec/sections/05-architecture.adoc renamed to sources/unitsdb/sections/05-architecture.adoc

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
== Architecture
22

3+
34
=== General
45

56
The UnitsDB architecture follows a modular design that organizes
@@ -13,26 +14,27 @@ models.
1314

1415
=== File organization
1516

16-
UnitsDB is organized into five primary YAML files, each responsible for a different component of the measurement system:
17-
17+
UnitsDB is organized into five primary YAML files, each responsible for a
18+
different component of the measurement system.
1819

19-
*`dimensions.yaml`::
20+
`dimensions.yaml`::
2021
Contains definitions of physical dimensions (length, mass, time, etc.)
2122

22-
*`quantities.yaml`::
23+
`quantities.yaml`::
2324
Contains definitions of measurable quantities (length, velocity, force, etc.)
2425

25-
*`units.yaml`::
26+
`units.yaml`::
2627
Contains definitions of measurement units (meter, second, newton, etc.)
2728

28-
*`prefixes.yaml`::
29+
`prefixes.yaml`::
2930
Contains definitions of unit prefixes (kilo, milli, mega, etc.)
3031

31-
*`unit_systems.yaml`::
32+
`unit_systems.yaml`::
3233
Contains definitions of unit systems (SI, non-SI) and their categories
3334

3435
Each file contains entries that follow a consistent model structure as defined using the lutaml-model language.
3536

37+
3638
=== Entity relationships
3739

3840
The UnitsDB architecture establishes explicit relationships between different entities to create a coherent measurement system:
@@ -56,12 +58,16 @@ The UnitsDB architecture establishes explicit relationships between different en
5658
+----------------------------------------------------------------+
5759
----
5860

59-
The key relationships are:
61+
The key relationships are described below.
6062

6163
* Dimension ↔ Quantity: Each quantity has exactly one dimension, but multiple quantities can share the same dimension
64+
6265
* Quantity ↔ Unit: Each quantity can be measured by multiple units, and each unit can measure multiple quantities (many-to-many relationship)
66+
6367
* Unit ↔ Dimension: Each unit has exactly one dimension, which must match the dimension of the quantities it measures
68+
6469
* Prefix ↔ Unit: Prefixes can be applied to units to create new prefixed units
70+
6571
* UnitSystem ↔ Unit: Each unit belongs to a specific unit system
6672

6773
These relationships are implemented through cross-references between the different YAML files.
@@ -70,42 +76,40 @@ These relationships are implemented through cross-references between the differe
7076

7177
UnitsDB uses a consistent cross-reference mechanism to link entities across different files:
7278

73-
* References to dimensions use the format `#NISTdX` (e.g., `#NISTd1` for length)
74-
* References to quantities use the format `#NISTqX` (e.g., `#NISTq1` for length)
75-
* References to units use the format `#NISTuX` (e.g., `#NISTu1` for meter)
76-
* References to prefixes use the format `#NISTpX_Y` (e.g., `#NISTp10_3` for kilo)
79+
* References to dimensions use the format `#NISTdX` (e.g., `#NISTd1` for length).
80+
* References to quantities use the format `#NISTqX` (e.g., `#NISTq1` for length).
81+
* References to units use the format `#NISTuX` (e.g., `#NISTu1` for meter).
82+
* References to prefixes use the format `#NISTpX_Y` (e.g., `#NISTp10_3` for kilo).
7783

78-
These cross-references create a web of relationships that maintain the integrity and coherence of the measurement system.
84+
These cross-references create a web of relationships that maintain the integrity
85+
and coherence of the measurement system.
7986

80-
=== Lutaml-model language
87+
=== Information models
8188

82-
UnitsDB uses the lutaml-model language to define the structure of each data model. The lutaml-model language provides a human-readable way to define class-like structures with attributes and relationships.
89+
UnitsDB defines five primary classes.
8390

84-
The general pattern for a lutaml-model class definition is:
91+
`Dimension`::
92+
Represents the mathematical concept of a physical dimension
8593

86-
[source,lutaml]
87-
----
88-
class ClassName {
89-
attribute attributeName, AttributeType {
90-
definition "Description of the attribute"
91-
}
92-
// Additional attributes...
93-
}
94-
----
94+
`Quantity`::
95+
Represents a measurable property with a specific dimension
96+
97+
`Unit`::
98+
Represents a reference for measuring quantities
9599

96-
UnitsDB defines five primary classes using lutaml-model:
100+
`Prefix`::
101+
Represents a multiplier for units
97102

98-
* `Dimension`: Represents the mathematical concept of a physical dimension
99-
* `Quantity`: Represents a measurable property with a specific dimension
100-
* `Unit`: Represents a reference for measuring quantities
101-
* `Prefix`: Represents a multiplier for units
102-
* `UnitSystem`: Represents a system of units (e.g., SI, non-SI)
103+
`UnitSystem`::
104+
Represents a system of units (e.g., SI, non-SI)
103105

104-
Each class definition specifies the attributes that should be present in the corresponding YAML files.
106+
Each class definition specifies the attributes that should be present in the
107+
corresponding YAML files.
105108

106109
=== Inheritance hierarchies
107110

108-
UnitsDB does not use formal inheritance hierarchies, but it does establish conceptual hierarchies through relationships:
111+
UnitsDB does not use formal inheritance hierarchies, but it does establish
112+
conceptual hierarchies through relationships:
109113

110114
* Base dimensions vs. derived dimensions: Derived dimensions are composed of combinations of base dimensions
111115
* Base quantities vs. derived quantities: Derived quantities reference dimensions that are combinations of base dimensions
@@ -127,7 +131,10 @@ These extension points allow UnitsDB to evolve while maintaining backward compat
127131

128132
=== Model mapping to YAML
129133

130-
The lutaml-model class definitions are mapped to YAML structures in the database files. For example, the `Unit` class defined in lutaml-model:
134+
The lutaml-model class definitions are mapped to YAML structures in the database
135+
files.
136+
137+
For example, the `Unit` class defined in lutaml-model:
131138

132139
[source,lutaml]
133140
----

sources/unitsdb-spec/sections/11-normalization.adoc renamed to sources/unitsdb/sections/11-normalization.adoc

Lines changed: 7 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,14 @@
22

33
=== General
44

5-
Data file normalization in UnitsDB refers to the process of organizing and structuring the YAML files that make up the database to ensure consistency, non-redundancy, and integrity. These rules help maintain the quality and reliability of the data while facilitating its use in various applications.
5+
Data file normalization in UnitsDB refers to the process of organizing and
6+
structuring the YAML files that make up the database to ensure consistency,
7+
non-redundancy, and integrity. These rules help maintain the quality and
8+
reliability of the data while facilitating its use in various applications.
69

710
=== Normalization principles model
811

9-
==== General
10-
11-
The normalization principles model defines the fundamental rules that govern how data is organized and referenced throughout the UnitsDB database.
12-
13-
==== Key normalization principles
14-
15-
[source,lutaml]
16-
----
17-
class NormalizationPrinciple {
18-
attribute principle_type, String {
19-
definition "Type of normalization principle"
20-
}
21-
attribute description, String {
22-
definition "Description of the principle"
23-
}
24-
attribute examples, Array {
25-
definition "Examples demonstrating the principle"
26-
}
27-
}
28-
----
29-
30-
===== Unique identifiers
12+
==== Unique identifiers
3113

3214
All model instances within UnitsDB (dimensions, quantities, units, prefixes, etc.) must have unique identifiers. These identifiers follow a consistent pattern:
3315

@@ -38,7 +20,7 @@ All model instances within UnitsDB (dimensions, quantities, units, prefixes, etc
3820

3921
Where `X` and `Y` are numeric values.
4022

41-
===== References
23+
==== References
4224

4325
References between entities must use consistent paths:
4426

@@ -48,7 +30,7 @@ References between entities must use consistent paths:
4830

4931
These references create a web of relationships that maintain the integrity of the database.
5032

51-
===== Hierarchical organization
33+
==== Hierarchical organization
5234

5335
The data is organized in a hierarchical manner that reflects the logical relationship between entities:
5436

@@ -59,27 +41,6 @@ The data is organized in a hierarchical manner that reflects the logical relatio
5941

6042
=== File normalization model
6143

62-
==== General
63-
64-
The file normalization model defines specific rules for each YAML file in the UnitsDB database to ensure internal consistency and proper structure.
65-
66-
[source,lutaml]
67-
----
68-
class FileNormalization {
69-
attribute file_name, String {
70-
definition "Name of the YAML file"
71-
}
72-
attribute entity_type, String {
73-
definition "Type of entity contained in the file"
74-
}
75-
attribute rules, Array {
76-
definition "Normalization rules specific to this file"
77-
}
78-
}
79-
----
80-
81-
==== File-specific normalization rules
82-
8344
===== dimensions.yaml
8445

8546
* Each dimension entry must have a unique identifier.
@@ -122,30 +83,6 @@ class FileNormalization {
12283

12384
=== Cross-file normalization model
12485

125-
==== General
126-
127-
The cross-file normalization model defines rules that govern relationships between entities across different files in the UnitsDB database.
128-
129-
[source,lutaml]
130-
----
131-
class CrossFileNormalization {
132-
attribute relationship_type, String {
133-
definition "Type of relationship between entities"
134-
}
135-
attribute source_entity, String {
136-
definition "Source entity type"
137-
}
138-
attribute target_entity, String {
139-
definition "Target entity type"
140-
}
141-
attribute rules, Array {
142-
definition "Normalization rules for this relationship"
143-
}
144-
}
145-
----
146-
147-
==== Cross-file normalization rules
148-
14986
===== Dimension-quantity relationships
15087

15188
* Each quantity must reference a valid dimension.
@@ -225,84 +162,3 @@ When updating the UnitsDB data files, the following rules should be applied:
225162
* When an entity needs to be deprecated, it should be marked as such rather than removed.
226163
* Major structural changes to the data format should be accompanied by a version increment and appropriate documentation.
227164

228-
=== Normalized data examples
229-
230-
==== General
231-
232-
These examples demonstrate how properly normalized data should appear across the different UnitsDB files.
233-
234-
==== Example of normalized data
235-
236-
Here is an example of how normalized data should appear across the different files:
237-
238-
.dimensions.yaml (excerpt)
239-
[source,yaml]
240-
----
241-
NISTd1:
242-
length:
243-
powerNumerator: 1
244-
symbol: L
245-
dim_symbols:
246-
- id: dim_L
247-
ascii: L
248-
html: "𝖫"
249-
mathml: "<mi mathvariant='sans-serif'>L</mi>"
250-
latex: "\\ensuremath{\\mathsf{L}}"
251-
unicode: "\U0001D5AB"
252-
----
253-
254-
.quantities.yaml (excerpt)
255-
[source,yaml]
256-
----
257-
NISTq1:
258-
dimension_url: "#NISTd1"
259-
quantity_type: base
260-
quantity_name:
261-
- length
262-
unit_reference:
263-
- name: meter
264-
url: "#NISTu1"
265-
----
266-
267-
.units.yaml (excerpt)
268-
[source,yaml]
269-
----
270-
NISTu1:
271-
dimension_url: "#NISTd1"
272-
short: meter
273-
root: true
274-
unit_system:
275-
type: SI_base
276-
name: SI
277-
unit_name:
278-
- meter
279-
unit_symbols:
280-
- id: m
281-
ascii: m
282-
html: m
283-
mathml: "<mi mathvariant='normal'>m</mi>"
284-
latex: "\\ensuremath{\\mathrm{m}}"
285-
unicode: m
286-
root_units:
287-
- unit: meter
288-
power_numerator: 1
289-
quantity_reference:
290-
- name: length
291-
url: "#NISTq1"
292-
----
293-
294-
.prefixes.yaml (excerpt)
295-
[source,yaml]
296-
----
297-
NISTp10_3:
298-
name: kilo
299-
symbol:
300-
ascii: k
301-
html: k
302-
latex: k
303-
unicode: k
304-
base: 10
305-
power: 3
306-
----
307-
308-
This example demonstrates the proper normalization of data across the files, with consistent identifiers, references, and structured data.

0 commit comments

Comments
 (0)