@mailwoman/registry 11.2.0 → 11.4.0

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.
Files changed (67) hide show
  1. package/README.md +3 -3
  2. package/data/manifests/artifacts.json +5 -0
  3. package/data/manifests/coverage.json +571 -0
  4. package/data/manifests/sources.lock.json +48 -0
  5. package/data/normalized/groupings.json +10902 -0
  6. package/definitions/groupings.json +222 -0
  7. package/docs/data-policy.md +15 -5
  8. package/docs/rgy1.md +5 -5
  9. package/lib/artifacts/groupings/groupings.fixture.json +1222 -0
  10. package/lib/artifacts/groupings/groupings.ts +77 -0
  11. package/lib/groupings.ts +127 -0
  12. package/lib/index.ts +19 -2
  13. package/lib/types.ts +90 -0
  14. package/out/artifacts/groupings/groupings.d.ts +28 -0
  15. package/out/artifacts/groupings/groupings.d.ts.map +1 -0
  16. package/out/artifacts/groupings/groupings.fixture.json +1222 -0
  17. package/out/artifacts/groupings/groupings.js +59 -0
  18. package/out/artifacts/groupings/groupings.js.map +1 -0
  19. package/out/groupings.d.ts +59 -0
  20. package/out/groupings.d.ts.map +1 -0
  21. package/out/groupings.js +92 -0
  22. package/out/groupings.js.map +1 -0
  23. package/out/index.d.ts +6 -2
  24. package/out/index.d.ts.map +1 -1
  25. package/out/index.js +3 -1
  26. package/out/index.js.map +1 -1
  27. package/out/sdk/fetch.js +2 -2
  28. package/out/sdk/fetch.js.map +1 -1
  29. package/out/sdk/sources.d.ts +55 -1
  30. package/out/sdk/sources.d.ts.map +1 -1
  31. package/out/sdk/sources.js +83 -0
  32. package/out/sdk/sources.js.map +1 -1
  33. package/out/tools/bench.run.js +2 -2
  34. package/out/tools/bench.run.js.map +1 -1
  35. package/out/tools/build-wasm.run.js +2 -2
  36. package/out/tools/build-wasm.run.js.map +1 -1
  37. package/out/tools/generate-sections.run.js +2 -2
  38. package/out/tools/generate-sections.run.js.map +1 -1
  39. package/out/tools/generate.run.js +62 -4
  40. package/out/tools/generate.run.js.map +1 -1
  41. package/out/tools/groupings.d.ts +101 -0
  42. package/out/tools/groupings.d.ts.map +1 -0
  43. package/out/tools/groupings.js +295 -0
  44. package/out/tools/groupings.js.map +1 -0
  45. package/out/tools/language-subtags.js +1 -1
  46. package/out/tools/language-subtags.js.map +1 -1
  47. package/out/tools/normalize.d.ts +17 -3
  48. package/out/tools/normalize.d.ts.map +1 -1
  49. package/out/tools/normalize.js +9 -4
  50. package/out/tools/normalize.js.map +1 -1
  51. package/out/tools/normalize.run.js +51 -4
  52. package/out/tools/normalize.run.js.map +1 -1
  53. package/out/types.d.ts +81 -0
  54. package/out/types.d.ts.map +1 -1
  55. package/out/types.js +29 -0
  56. package/out/types.js.map +1 -1
  57. package/package.json +4 -2
  58. package/sdk/fetch.ts +2 -2
  59. package/sdk/sources.ts +119 -0
  60. package/tools/bench.run.ts +2 -2
  61. package/tools/build-wasm.run.ts +2 -2
  62. package/tools/generate-sections.run.ts +2 -2
  63. package/tools/generate.run.ts +69 -4
  64. package/tools/groupings.ts +428 -0
  65. package/tools/language-subtags.ts +1 -1
  66. package/tools/normalize.run.ts +65 -5
  67. package/tools/normalize.ts +19 -5
@@ -0,0 +1,222 @@
1
+ {
2
+ "$comment": "The country groupings the registry answers. An organization reads its members from Wikidata through `property` (P463 'member of' on the member, P527 'has part(s)' on the organization, or `both` for an organization whose statements are split between them), and the normalizer cross-checks the other property. A classification reads its members from its publisher's list. The normalizer, the generator and the TypeScript reader read this file.",
3
+ "schemaVersion": 1,
4
+ "groupings": [
5
+ {
6
+ "id": "g7",
7
+ "name": "Group of Seven",
8
+ "kind": "organization",
9
+ "source": { "type": "wikidata", "item": "Q1764511", "property": "P463" }
10
+ },
11
+ {
12
+ "id": "g20",
13
+ "name": "G20",
14
+ "kind": "organization",
15
+ "source": { "type": "wikidata", "item": "Q19771", "property": "P463" }
16
+ },
17
+ {
18
+ "id": "eu",
19
+ "name": "European Union",
20
+ "kind": "organization",
21
+ "source": { "type": "wikidata", "item": "Q458", "property": "P463" }
22
+ },
23
+ {
24
+ "id": "eurozone",
25
+ "name": "Eurozone",
26
+ "kind": "organization",
27
+ "source": { "type": "wikidata", "item": "Q8268", "property": "P527" }
28
+ },
29
+ {
30
+ "id": "schengen",
31
+ "name": "Schengen Area",
32
+ "kind": "organization",
33
+ "source": { "type": "wikidata", "item": "Q1969730", "property": "P463" }
34
+ },
35
+ {
36
+ "id": "eea",
37
+ "name": "European Economic Area",
38
+ "kind": "organization",
39
+ "source": { "type": "wikidata", "item": "Q8932", "property": "P463" }
40
+ },
41
+ {
42
+ "id": "efta",
43
+ "name": "European Free Trade Association",
44
+ "kind": "organization",
45
+ "source": { "type": "wikidata", "item": "Q166546", "property": "P463" }
46
+ },
47
+ {
48
+ "id": "council-of-europe",
49
+ "name": "Council of Europe",
50
+ "kind": "organization",
51
+ "source": { "type": "wikidata", "item": "Q8908", "property": "P463" }
52
+ },
53
+ {
54
+ "id": "oecd",
55
+ "name": "Organisation for Economic Co-operation and Development",
56
+ "kind": "organization",
57
+ "source": { "type": "wikidata", "item": "Q41550", "property": "P463" }
58
+ },
59
+ {
60
+ "id": "nato",
61
+ "name": "NATO",
62
+ "kind": "organization",
63
+ "source": { "type": "wikidata", "item": "Q7184", "property": "P463" }
64
+ },
65
+ {
66
+ "id": "un",
67
+ "name": "United Nations",
68
+ "kind": "organization",
69
+ "source": { "type": "wikidata", "item": "Q1065", "property": "P463" }
70
+ },
71
+ {
72
+ "id": "wto",
73
+ "name": "World Trade Organization",
74
+ "kind": "organization",
75
+ "source": { "type": "wikidata", "item": "Q7825", "property": "P463" }
76
+ },
77
+ {
78
+ "id": "commonwealth",
79
+ "name": "Commonwealth of Nations",
80
+ "kind": "organization",
81
+ "source": { "type": "wikidata", "item": "Q7785", "property": "P463" }
82
+ },
83
+ {
84
+ "id": "brics",
85
+ "name": "BRICS",
86
+ "kind": "organization",
87
+ "source": { "type": "wikidata", "item": "Q243630", "property": "P463" }
88
+ },
89
+ {
90
+ "id": "apec",
91
+ "name": "Asia-Pacific Economic Cooperation",
92
+ "kind": "organization",
93
+ "source": { "type": "wikidata", "item": "Q170481", "property": "P463" }
94
+ },
95
+ {
96
+ "id": "asean",
97
+ "name": "Association of Southeast Asian Nations",
98
+ "kind": "organization",
99
+ "source": { "type": "wikidata", "item": "Q7768", "property": "P463" }
100
+ },
101
+ {
102
+ "id": "mercosur",
103
+ "name": "Mercosur",
104
+ "kind": "organization",
105
+ "source": { "type": "wikidata", "item": "Q4264", "property": "P463" }
106
+ },
107
+ {
108
+ "id": "andean-community",
109
+ "name": "Andean Community",
110
+ "kind": "organization",
111
+ "source": { "type": "wikidata", "item": "Q471690", "property": "P463" }
112
+ },
113
+ {
114
+ "id": "caricom",
115
+ "name": "Caribbean Community",
116
+ "kind": "organization",
117
+ "source": { "type": "wikidata", "item": "Q205995", "property": "P463" }
118
+ },
119
+ {
120
+ "id": "oas",
121
+ "name": "Organization of American States",
122
+ "kind": "organization",
123
+ "source": { "type": "wikidata", "item": "Q123759", "property": "P463" }
124
+ },
125
+ {
126
+ "id": "african-union",
127
+ "name": "African Union",
128
+ "kind": "organization",
129
+ "source": { "type": "wikidata", "item": "Q7159", "property": "P463" }
130
+ },
131
+ {
132
+ "id": "ecowas",
133
+ "name": "Economic Community of West African States",
134
+ "kind": "organization",
135
+ "source": { "type": "wikidata", "item": "Q193272", "property": "P463" }
136
+ },
137
+ {
138
+ "id": "sadc",
139
+ "name": "Southern African Development Community",
140
+ "kind": "organization",
141
+ "source": { "type": "wikidata", "item": "Q816706", "property": "P463" }
142
+ },
143
+ {
144
+ "id": "arab-league",
145
+ "name": "Arab League",
146
+ "kind": "organization",
147
+ "source": { "type": "wikidata", "item": "Q7172", "property": "P463" }
148
+ },
149
+ {
150
+ "id": "gcc",
151
+ "name": "Gulf Cooperation Council",
152
+ "kind": "organization",
153
+ "source": { "type": "wikidata", "item": "Q217172", "property": "both" }
154
+ },
155
+ {
156
+ "id": "opec",
157
+ "name": "Organization of the Petroleum Exporting Countries",
158
+ "kind": "organization",
159
+ "source": { "type": "wikidata", "item": "Q7795", "property": "P463" }
160
+ },
161
+ {
162
+ "id": "cis",
163
+ "name": "Commonwealth of Independent States",
164
+ "kind": "organization",
165
+ "source": { "type": "wikidata", "item": "Q7779", "property": "P463" }
166
+ },
167
+ {
168
+ "id": "imf-advanced",
169
+ "name": "IMF advanced economies",
170
+ "kind": "classification",
171
+ "source": {
172
+ "type": "wikipedia-imf-advanced",
173
+ "$comment": "The names the article spells differently from the ISO record's Wikidata label, mapped to the record's alpha-2 code. A name in neither the records nor this table blocks the grouping.",
174
+ "aliases": { "Czechia": "CZ", "Netherlands": "NL" }
175
+ }
176
+ },
177
+ {
178
+ "id": "wb-high-income",
179
+ "name": "World Bank high income",
180
+ "kind": "classification",
181
+ "source": { "type": "worldbank-income", "level": "HIC" }
182
+ },
183
+ {
184
+ "id": "wb-upper-middle-income",
185
+ "name": "World Bank upper middle income",
186
+ "kind": "classification",
187
+ "source": { "type": "worldbank-income", "level": "UMC" }
188
+ },
189
+ {
190
+ "id": "wb-lower-middle-income",
191
+ "name": "World Bank lower middle income",
192
+ "kind": "classification",
193
+ "source": { "type": "worldbank-income", "level": "LMC" }
194
+ },
195
+ {
196
+ "id": "wb-low-income",
197
+ "name": "World Bank low income",
198
+ "kind": "classification",
199
+ "source": { "type": "worldbank-income", "level": "LIC" }
200
+ }
201
+ ],
202
+ "entities": {
203
+ "$comment": "Wikidata items that hold a membership for an ISO 3166-1 entry whose code sits on another item, mapped to that entry's alpha-2 code. The Netherlands country item holds the EU seat while NL sits on the Kingdom of the Netherlands; the Danish Realm holds the UN and NATO seats while DK sits on Denmark; West Germany's UN seat continued as Germany's; Taiwan holds WTO and APEC seats under two names.",
204
+ "Q55": "NL",
205
+ "Q756617": "DK",
206
+ "Q713750": "DE",
207
+ "Q10915215": "TW",
208
+ "Q216923": "TW"
209
+ },
210
+ "roles": {
211
+ "$comment": "Wikidata P2868 ('subject has role') values on a membership statement. `member` counts as membership. A name role, such as Chinese Taipei, is the name a member holds its seat under. A value outside this table blocks its grouping until it is classified here.",
212
+ "Q160016": "member",
213
+ "Q15140392": "member",
214
+ "Q6688521": "member",
215
+ "Q26234937": "member",
216
+ "Q10915215": "member",
217
+ "Q216923": "member",
218
+ "Q47165448": "associate",
219
+ "Q15978655": "other",
220
+ "Q381160": "other"
221
+ }
222
+ }
@@ -6,8 +6,8 @@ source update moves through the repository.
6
6
 
7
7
  ## Profiles
8
8
 
9
- A profile is a set of pinned sources with an identifier such as `open-2026-11`. An artifact's header states its profile, and every
10
- predicate in this package answers for one profile. The built profile is `open-2026-11`.
9
+ A profile is a set of pinned sources with an identifier such as `open-2026-11`. An artifact's header states
10
+ its profile, and every predicate in this package answers for one profile. The built profile is `open-2026-11`.
11
11
 
12
12
  | Profile | Sources | Where |
13
13
  | ------------------- | ------------------------------------------------------ | ------------------------------------ |
@@ -26,9 +26,11 @@ marker the server stated, and the publisher's statement of terms with the page i
26
26
  | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
27
27
  | Wikidata (SPARQL) | Structured data under CC0 1.0 (https://www.wikidata.org/wiki/Wikidata:Licensing) | yes |
28
28
  | OurAirports | "All data is released to the Public Domain, and comes with no guarantee of accuracy or fitness for use." (https://ourairports.com/data/) | yes |
29
+ | World Bank country API | Datasets under CC BY 4.0, attributed as "The World Bank: Dataset name: Data source (if known)." (https://www.worldbank.org/ext/en/legal/terms-conditions/datasets) | yes |
30
+ | Wikipedia, one revision | The IMF advanced-economy list in "Developed country" is read as a list of facts. The article's prose is CC BY-SA 4.0 and stays out of every artifact. | yes |
29
31
  | UN Statistics Division M49 | "personal, non-commercial use, without any right to resell or redistribute them or to compile or create derivative works therefrom" (https://www.un.org/en/about-us/terms-of-use) | no |
30
32
 
31
- The UN crosswalk is recorded under `$notElected` in the lock. The repository's rule
33
+ The lock records the UN crosswalk under `$notElected`. The repository's rule
32
34
  (`packages/corpus/AGENTS.md`, "License election") is that a grant enumerates its rights and an omission
33
35
  is neither permission nor prohibition. Here the terms refuse redistribution and derivative works in their
34
36
  own words, so the source stays unpinned and the compiler reads the two elected sources only.
@@ -51,8 +53,16 @@ pinned bytes. At the pinned publication:
51
53
  when the code is a current alpha-2 entry, `source-extension` for a code such as `XK`, `unstated` when
52
54
  the column is empty. The `airport-located-in-country` relation holds only the first kind.
53
55
 
54
- A miss means `not-found-in-snapshot`: the source holds no such code. It isn't a claim that the issuing
55
- authority never assigned it.
56
+ - `country-grouping`: the groupings `definitions/groupings.json` declares. An organization's members are
57
+ Wikidata statements through P463 ("member of") or P527 ("has part(s)"), with their role, start and end
58
+ qualifiers, read by two pinned queries. The World Bank income groups come from the World Bank country API, and
59
+ the IMF advanced economies from a pinned Wikipedia revision whose section cites the IMF World Economic Outlook
60
+ statistical appendix. `data/manifests/coverage.json` records, per grouping, the statements without a role or a
61
+ start, the Wikidata members with no ISO record, and the codes on which P463 and P527 disagree. A defect there is
62
+ corrected on Wikidata and repinned.
63
+
64
+ A miss means `not-found-in-snapshot`: the source holds no such code. It doesn't claim that the issuing
65
+ authority never assigned the code.
56
66
 
57
67
  OurAirports and Wikidata disagree on the country list in a way the coverage declaration records rather
58
68
  than hides: OurAirports lists `XK`, `XP` and `ZZ`, which are not ISO codes, and lists no entry for `AX`,
package/docs/rgy1.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # RGY1: the registry artifact layout
2
2
 
3
- RGY1 is the binary container `@mailwoman/registry` ships its lookup tables in. This document is the
4
- normative layout. The Rust writer in `crates/registry-build`, the Rust reader in `crates/registry-core`
5
- and the TypeScript reader in `lib/rgy1/reader.ts` follow it, and `lib/rgy1/layout.test.ts` walks the
6
- committed fixture artifacts with its own byte reader against `test/fixtures/layout.json`, so agreement
7
- between the writer and a reader is never the only check.
3
+ RGY1 is the binary container that `@mailwoman/registry` uses for its lookup tables. This document defines
4
+ the normative layout. The Rust writer in `crates/registry-build`, the Rust reader in
5
+ `crates/registry-core` and the TypeScript reader in `lib/rgy1/reader.ts` follow it. The independent byte
6
+ reader in `lib/rgy1/layout.test.ts` walks the committed fixture artifacts against
7
+ `test/fixtures/layout.json`, so the writer and a reader agreeing is never the only check.
8
8
 
9
9
  RGY1 is inspired by PIX1 (`docs/engineering/reference/pix1.ksy`) and shares no bytes with it. PIX1 sorts
10
10
  tuples by UTF-16 code units. RGY1 orders every table by a numeric key computed from the code's spelling, so