pubid 2.0.54 → 2.0.56

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/data/parg/iho.json +1 -1
  3. data/data/parg/iho.parg +33 -26
  4. data/lib/pubid/adobe/urn.adoc +28 -0
  5. data/lib/pubid/amca/urn.adoc +29 -0
  6. data/lib/pubid/ansi/urn.adoc +45 -0
  7. data/lib/pubid/api/urn.adoc +34 -0
  8. data/lib/pubid/arxiv/urn.adoc +25 -0
  9. data/lib/pubid/ashrae/urn.adoc +33 -0
  10. data/lib/pubid/asme/urn.adoc +26 -0
  11. data/lib/pubid/astm/urn.adoc +52 -0
  12. data/lib/pubid/bipm/urn.adoc +72 -0
  13. data/lib/pubid/bsi/urn.adoc +79 -0
  14. data/lib/pubid/bsi_pfs/urn.adoc +20 -0
  15. data/lib/pubid/calconnect/urn.adoc +26 -0
  16. data/lib/pubid/calconnect_pfs/urn.adoc +15 -0
  17. data/lib/pubid/ccsds/urn.adoc +28 -0
  18. data/lib/pubid/cen_cenelec/urn.adoc +68 -0
  19. data/lib/pubid/cen_pfs/urn.adoc +18 -0
  20. data/lib/pubid/cie/urn.adoc +44 -0
  21. data/lib/pubid/csa/urn.adoc +53 -0
  22. data/lib/pubid/doi/urn.adoc +27 -0
  23. data/lib/pubid/doi_pfs/urn.adoc +26 -0
  24. data/lib/pubid/easc/urn.adoc +28 -0
  25. data/lib/pubid/ecma/urn.adoc +29 -0
  26. data/lib/pubid/etsi/urn.adoc +49 -0
  27. data/lib/pubid/etsi_pfs/urn.adoc +31 -0
  28. data/lib/pubid/eu/urn.adoc +28 -0
  29. data/lib/pubid/evs/urn.adoc +44 -0
  30. data/lib/pubid/gb/urn.adoc +30 -0
  31. data/lib/pubid/gost/urn.adoc +64 -0
  32. data/lib/pubid/iana/urn.adoc +27 -0
  33. data/lib/pubid/idf/urn.adoc +33 -0
  34. data/lib/pubid/iec/urn.adoc +78 -0
  35. data/lib/pubid/ieee/urn.adoc +128 -0
  36. data/lib/pubid/ietf/urn.adoc +31 -0
  37. data/lib/pubid/iho/CLAUDE.md +50 -26
  38. data/lib/pubid/iho/builder.rb +15 -15
  39. data/lib/pubid/iho/identifiers/base.rb +56 -9
  40. data/lib/pubid/iho/identifiers/bathymetric.rb +18 -0
  41. data/lib/pubid/iho/identifiers/capacity_building.rb +25 -0
  42. data/lib/pubid/iho/identifiers.rb +2 -2
  43. data/lib/pubid/iho/pubid_urn_schema.rb +7 -7
  44. data/lib/pubid/iho/renderer.rb +3 -3
  45. data/lib/pubid/iho/urn.adoc +35 -19
  46. data/lib/pubid/iho/urn_generator.rb +32 -85
  47. data/lib/pubid/iho/urn_parser.rb +23 -18
  48. data/lib/pubid/isbn/urn.adoc +26 -0
  49. data/lib/pubid/iso/urn.adoc +58 -0
  50. data/lib/pubid/itu/urn.adoc +90 -0
  51. data/lib/pubid/jcgm/urn.adoc +33 -0
  52. data/lib/pubid/jis/urn.adoc +35 -0
  53. data/lib/pubid/nist/urn.adoc +99 -0
  54. data/lib/pubid/oasis/urn.adoc +27 -0
  55. data/lib/pubid/ogc/urn.adoc +26 -0
  56. data/lib/pubid/oiml/urn.adoc +43 -0
  57. data/lib/pubid/omg/urn.adoc +27 -0
  58. data/lib/pubid/plateau/urn.adoc +43 -0
  59. data/lib/pubid/sae/urn.adoc +24 -0
  60. data/lib/pubid/tgpp/urn.adoc +28 -0
  61. data/lib/pubid/un/urn.adoc +27 -0
  62. data/lib/pubid/version.rb +1 -1
  63. data/lib/pubid/w3c/urn.adoc +37 -0
  64. data/lib/pubid/wmo/urn.adoc +28 -0
  65. data/lib/pubid/xsf/urn.adoc +25 -0
  66. metadata +59 -6
  67. data/lib/pubid/iho/identifiers/bibliographic.rb +0 -16
  68. data/lib/pubid/iho/identifiers/circular_letter.rb +0 -15
@@ -0,0 +1,128 @@
1
+ [[urn-ieee]]
2
+ = IEEE URN schemes
3
+
4
+ This file is the single home of the IEEE (`ieee`) flavor's URN
5
+ documentation — the per-flavor split of the former `docs/URN-SCHEMES.adoc`
6
+ (owner ruling 2026-11-25: "for URN schemes how can we mix up different
7
+ flavors in 1 file? SPLIT THE FILE!"). The index that links every flavor's
8
+ file is `docs/URN-SCHEMES.adoc`.
9
+
10
+ Namespace: `urn:pubid:ieee:`. Schema: `lib/pubid/ieee/pubid_urn_schema.rb`.
11
+
12
+ Official URN: `urn:ieee:std:…`, IANA-registered, RFC 8069. Current `to_urn`:
13
+ 400 ids, 66 round-trip, 136 reshape, 198 do not re-parse, 3 colliding URNs.
14
+
15
+ pubid scheme: all 9,049 parseable pass ids (of 9,051) emit, round-trip by
16
+ `to_hash`, are path-safe, and give no collision (8,983 distinct URNs). The
17
+ longest URN is 264 characters, the median 78, and 10 are over 200. *A slug
18
+ used as a file name must be shortened or hashed:* 264 is above the 255-byte
19
+ limit that once made `relaton-data-ieee` lose crawl batches to
20
+ `Errno::ENAMETOOLONG`.
21
+
22
+ [cols="3,1",options="header"]
23
+ |===
24
+ | `_type` | token
25
+ | `pubid:ieee:standard` | `std`
26
+ | `pubid:ieee:project-draft-identifier` | `proj`
27
+ | `pubid:ieee:si-standard` | `si`
28
+ | `pubid:ieee:redlined-standard` | `redlined`
29
+ | `pubid:ieee:joint-development` | `joint`
30
+ | `pubid:ieee:iec-ieee-copublished` | `iecieee`
31
+ | `pubid:ieee:dual-identifier` | `dual`
32
+ | `pubid:ieee:dual-published` | `dualpub`
33
+ | `pubid:ieee:csa-dual-published` | `csadual`
34
+ | `pubid:ieee:multi-numbered-identifier` | `multi`
35
+ | `pubid:ieee:adopted-standard` | `adopted`
36
+ | `pubid:ieee:parenthetical-identifier` | `paren`
37
+ | `pubid:ieee:amendment` | `amd`
38
+ | `pubid:ieee:corrigendum` | `cor`
39
+ | `pubid:ieee:interpretation-identifier` | `int`
40
+ | `pubid:ieee:conformance-identifier` | `conf`
41
+ | `pubid:ieee:supplement-identifier` | `sup`
42
+ | `pubid:ieee:aiee` | `aiee`
43
+ | `pubid:ieee:ire` | `ire`
44
+ | `pubid:ieee:nesc-standard` | `nesc`
45
+ | `pubid:ieee:nesc-edition` | `nescedition`
46
+ | `pubid:ieee:nesc-handbook` | `nescbook`
47
+ | `pubid:ieee:nesc-draft` | `nescdraft`
48
+ | `pubid:ieee:nesc-preprint` | `nescpre`
49
+ | `pubid:ieee:nesc-redline` | `nescredline`
50
+ |===
51
+
52
+ Core: `number` (the bare digits, the relaton index key: `C37.09` is `37` with
53
+ `prefix-C`). Atoms, in the schema order: who (`pub`, `pubs`, `lead`, `co`,
54
+ `copubs`), what (`prefix`, `type`, `variant`), which part (`part` = `parts`,
55
+ `pt`, `subpart`), when (`year`, `month`, `day`, `date*`, `dateinfo`,
56
+ `iecyear`), which edition (`ed`, `edmonth`, `rev`, `reaff`), which state
57
+ (`stage`, `iter`, `isostage`, `ieeedraft`, `draft`, `draftinfo`,
58
+ `draftstatus`, `ts*` for a `typed_stage` that does not collapse to `stage`),
59
+ `lang`, `loc`, the IEEE flags (`project`, `redline`, `interp`, …), the
60
+ free-text designations (`nick`, `note`, `paren`, `rel` …), then the nested
61
+ identifiers. Facets: `sep`, `seps`, `revsep`, `yearsep`, `datesep`,
62
+ `format`, `langsrc`.
63
+
64
+ ----
65
+ IEEE Std 802.11-2016 urn:pubid:ieee:std:802:part-11:year-2016:stage-Std:f:0.sep-.
66
+ IEEE P802.1AS-2020/Cor. 1 urn:pubid:ieee:proj:802:type-P:part-1AS:year-2020:stage-P:project-true:cor:1:f:0.sep-.
67
+ 52 IRE 7.S2 urn:pubid:ieee:ire:7:part-S2:year-1952:f:0.sep-.
68
+ C2-2012-Preprint urn:pubid:ieee:nescpre:2:prefix-C:year-2012
69
+ IEEE Std 844.1-2017/CSA … urn:pubid:ieee:csadual:year-2017:stage-Std:ieeeid-(ieee:std:844:part-1:year-2017:stage-Std:f:0.sep-.)
70
+ ----
71
+
72
+ Rulings of this wave:
73
+
74
+ * *Wrappers keep their parent slot names.* `AdoptedStandard`,
75
+ `CsaDualPublished`, `DualPublished`, `DualIdentifier`, `MultiNumbered` and
76
+ `IecIeeeCopublished` name the wrapped document `ieee_identifier`,
77
+ `first_identifier`, `primary_identifier` …, not `base`. The codec builds the
78
+ root-first chain only along `base`, so these documents are nested atoms
79
+ (`ieeeid-(…)`, `first-(…)`) and the wrapper does *not* share the slug prefix
80
+ of the document it wraps. Renaming the slots to `base` changes `to_hash`
81
+ (`adopted_identifiers` is a key in 73 published `relaton-data-ieee` rows)
82
+ and needs a re-crawl, so it is a separate decision.
83
+ * *`typed_stage` needs no `to_hash` change.* `Ieee::Compaction` already
84
+ collapses it to the scalar `stage`; the 8 `si-standard` ids whose stage
85
+ does not collapse map their `abbr`, `stage_code` and `type_code` to `ts*`
86
+ atoms.
87
+ * *Nested ANSI and IEC nodes.* IEEE ids nest 36 `pubid:ansi:standard` and 3
88
+ `pubid:iec:international-standard` nodes. ANSI has only three types, so
89
+ ANSI landed whole with this wave (<<../ansi/urn.adoc#urn-ansi,ANSI>>). IEC has 26, so it has a
90
+ partial schema for the one type the corpus nests (<<../iec/urn.adoc#urn-iec,IEC>>). The GOST
91
+ wave added the IEC `TR`, `TS`, amendment and consolidated identifier, so
92
+ `IEEE Std 1234-2010 (IEC TR 62271-1)` and an `/AMD1:2011` now nest; any
93
+ other IEC type (a `CSV`, a fragment) still makes `#to_pubid_urn` raise
94
+ "no pubid URN schema" until IEC's own wave lands. None is in the corpus.
95
+ * *The IEEE base class has a token too* (`id`). The builder makes a bare
96
+ `Pubid::Ieee::Identifier` for a parenthetical inside a relationship; its
97
+ related ids are not serialized today, but one in any other slot still
98
+ emits.
99
+ * *The prefix `part` means the part sequence.* IEEE models its parts as the
100
+ list `parts` (`802.16.1` is `part-16,1`), so `part-` is that list, and the
101
+ rare scalar `part` attribute is `pt-`. In ANSI and IEC, `part-` is a
102
+ scalar, because that is the only part they have.
103
+ * *Cutting the facets merges nothing.* Over the corpus, the URN without its
104
+ `f` group is unique for every IEEE id (8,983 slugs, 0 shared). The ISO
105
+ figure is 6 groups, each the same document in two spellings (`(R)`/`(ru)`,
106
+ `Ed 13`/`Edition 13`).
107
+
108
+ Findings that the URN inherits, because it carries exactly what `to_hash`
109
+ carries (pinned in `spec/pubid/ieee/pubid_urn_spec.rb`):
110
+
111
+ * `to_hash` drops the CSA half of a CSA dual publication (`csa_identifier`
112
+ is a plain accessor): `IEEE Std 844.1-2017/CSA C22.2 No. 293.1-17` comes
113
+ back as `IEEE Std 844.1-2017/CSA `, through `from_hash` alone and so
114
+ through the URN. 4 corpus ids. Two such documents with the same IEEE half
115
+ share one hash and one URN.
116
+ * `to_hash` keeps one `separator` for all parts, so a mixed-separator number
117
+ (`IEEE Std 7-4.3.2-2016`, `C57.18-10`, `C95.1-2345`) comes back as
118
+ `7.4.3.2`. 14 corpus ids.
119
+ * `from_hash(to_hash)` is not idempotent for a supplement with a non-IEEE
120
+ publisher *nested* in an adoption (`IEEE Std 1234-2010 (ISO 1234/Amd
121
+ 1:2001)`): `SupplementIdentifier#to_hash` drops the delegated `publisher`
122
+ only on a top-level wrapper. The URN carries the first hash, the rebuilt
123
+ identifier re-encodes to a different one, and `Pubid.parse_urn` refuses
124
+ the URN as not canonical. Not in the corpus. The repair is in `to_hash`.
125
+ * 2 corpus ids (`IEC/IEEE P62582-6, FDIS May 2019`,
126
+ `ISO/IEC/IEEE P21840, DIS-2019`) raise `Parsanol::PARG::BindError` from
127
+ `parse`, not `Pubid::Errors::ParseError` — a leak in the parse-error
128
+ contract.
@@ -0,0 +1,31 @@
1
+ [[urn-ietf]]
2
+ = IETF URN schemes
3
+
4
+ This file is the single home of the IETF (`ietf`) flavor's URN
5
+ documentation — the per-flavor split of the former `docs/URN-SCHEMES.adoc`
6
+ (owner ruling 2026-11-25: "for URN schemes how can we mix up different
7
+ flavors in 1 file? SPLIT THE FILE!"). The index that links every flavor's
8
+ file is `docs/URN-SCHEMES.adoc`.
9
+
10
+ Namespace: `urn:pubid:ietf:` (the `_type` flavor segment).
11
+
12
+ Official URN: `urn:ietf:rfc:…`, IANA-registered, RFC 2648.
13
+
14
+ Current `to_urn` (≤400 sampled pass ids): 400 ids, 400 round-trip, 0 reshape, 0 do not re-parse, 0 raise, 0 empty, 0 colliding URNs.
15
+
16
+ Corpus: 2526 of 2526 pass ids parse.
17
+
18
+ [cols="3,1,1,1,4",options="header"]
19
+ |===
20
+ | `_type` | token | core | ids | example
21
+ | `pubid:ietf:bcp` | `bcp` | number | 236 | `BCP 3`
22
+ | `pubid:ietf:fyi` | `fyi` | number | 36 | `FYI 2`
23
+ | `pubid:ietf:identifier` | `id` | number | 0 | —
24
+ | `pubid:ietf:internet-draft` | `id2` | number | 2144 | `draft-3gpp-collaboration-01`
25
+ | `pubid:ietf:rfc` | `rfc` | number | 17 | `RFC 1`
26
+ | `pubid:ietf:std` | `std` | number | 93 | `STD 3`
27
+ |===
28
+
29
+ Atoms, canonical order: `v-` (`version`).
30
+
31
+ Landed (issue #670) as drafted; the internet-draft token is `id2` (the draft reserved `id` for the bare identifier), and a draft name (`draft-…`) escapes its first byte. All 2,526 corpus rows emit.
@@ -18,7 +18,7 @@ goes `Pubid::Parg::Model.bound(:iho, ...)` — the artifact's
18
18
  attribute-named scalar, and `Builder` dispatches the series letter to
19
19
  its concrete class and resolves two grammar-level aliases (the S-100
20
20
  `v1`/`v5.1` shorthand pads `edition` to `1.0.0`/`5.1.0`; the S-158
21
- draft-era part faces rebind onto `checks_for`). The artifact is baked
21
+ draft-era part faces rebind onto `product`). The artifact is baked
22
22
  from `grammars/iho.parg` in pubid-grammar; the vendored twin
23
23
  `data/parg/iho.parg` is the embedded source's provenance copy and must
24
24
  move together with `data/parg/iho.json` (the ISO pattern).
@@ -38,7 +38,7 @@ never a string suffix. All of them live flat on `Pubid::Iho::Identifier`
38
38
  | component | attribute | canonical face | parse-only aliases |
39
39
  |-------------|--------------------|-------------------|------------------------------|
40
40
  | edition | `edition` | `1.0.0` (bare) | `v1`/`v5.1` (padded) |
41
- | checks member | `checks_for` | `:102` (the S-158 colon designator) | `Part S-102`, `S-158-S-102`, `Part 102` (the draft-era faces; `checks_for_face` keeps the spelling) |
41
+ | S-158 member | `product` | `:102` (the S-158 colon designator) | `Part S-102`, `S-158-S-102`, `Part 102` (the draft-era faces; `product_face` keeps the spelling) |
42
42
  | supplement | `supplement` | `Sup 1` | `Suppl 1` |
43
43
  | part | `part` | `Part A`/`Part 1` | `S-5-B`, `S-100-1` (compact) |
44
44
  | annex | `annex` | `Annex A` | — |
@@ -85,14 +85,14 @@ never a string suffix. All of them live flat on `Pubid::Iho::Identifier`
85
85
  :102 Bathymetric Surface), S-158:98 (interoperability), S-158:128
86
86
  (catalogue) — each a publication of its own with its own edition
87
87
  stream. The colon designator `S-158:102` is the PRIMARY form and
88
- binds the typed `checks_for` component; the draft-era spellings
88
+ binds the typed `product` component; the draft-era spellings
89
89
  (`S-158 Part S-102`, `S-158-S-102`, `S-158 Part 102`) are
90
90
  NON-NORMALIZED ALIASES of the same identity — facets-spelling-only
91
- (the render keeps the Part face through `checks_for_face`;
91
+ (the render keeps the Part face through `product_face`;
92
92
  equality/URN use the canonical shape), and the edition that follows
93
93
  the part face is the BASE edition (the parted- mis-bind of #775 is
94
94
  fixed). A series-reference-shaped part face rebinds only while
95
- checks_for is UNBOUND: `S-158:100 Part 2` keeps a genuine part. The
95
+ product is UNBOUND: `S-158:100 Part 2` keeps a genuine part. The
96
96
  member designator rides the S-158 anchor only (`S-44:5` rejects).
97
97
  Lettered/compound part values on other series are untouched
98
98
  (`S-100-1` stays Part 1).
@@ -134,8 +134,8 @@ Section 400` ≡ `IHO S-4 B-400` (one identity, two spellings).
134
134
  spelled section becomes `spec` alone, and beside a citation it only
135
135
  cross-checks the citation's derived section — "Section 500, B-401"
136
136
  raises) and the BARE `B-401` (implicit S-4 anchor; B only — bare
137
- C-x stays the Circular Letter series, and the 3-digit `[1-6]xx`
138
- shape keeps the B Bibliographic series (B-12) on the main branch).
137
+ C-x stays the C Capacity Building series, and the 3-digit `[1-6]xx`
138
+ shape keeps the B Bathymetric series (B-12) on the main branch).
139
139
  `IHO B-401` (publisher + bare) parses to the spec too.
140
140
  - **The anchor is load-bearing**: a spec citation requires the S-4
141
141
  anchor (series S number 4 — the builder raises otherwise), a
@@ -179,16 +179,24 @@ The full scheme documentation lives in `lib/pubid/iho/urn.adoc` (the
179
179
  per-flavor home of the former `docs/URN-SCHEMES.adoc` iho section; the
180
180
  owner's per-flavor split ruling of 2026-11-25). The laws:
181
181
 
182
- - **The S/P/M emission is the IHO MRN guidance form**
183
- (`urn:mrn:iho:pub:<type>:<name>[:<edition>][:trailing...]`):
184
- `spec` (S), `per` (P), `reg` (M); the name is the lowercase
185
- `sNNN` (the guidance's own s57/s98 spelling); the dotted edition is
186
- the bare canonical 4th segment; the S-158 member joins the name
187
- hyphenated (`s158-102`, the fleet extension for compound publication
188
- numbers). The B/C series have no guidance type code and keep the
189
- legacy emission until IHO assigns one.
190
- - **The legacy positional `urn:iho:` grammar is decode-only for S/P/M**
191
- (the B/C emission): marker segments, positional `ed-`/`year-`, the
182
+ - **The emission of every series is the IHO MRN guidance form**
183
+ (`urn:mrn:iho:pub:<type>:<name>[:<edition>][:trailing...]`); the
184
+ five series bind 1:1 onto the guidance's five publication type
185
+ codes — `spec` (S), `per` (P), `reg` (M), `bathy` (B Bathymetric
186
+ Publications), `cb` (C Capacity Building Publications). The B/C
187
+ bindings cite IHO S-11 Part C Ed 1.0.0 section 1.2, which arranges
188
+ the IHO publications under five groups ("B - Bathymetric
189
+ Publications (Mainly related to GEBCO)", "C - Capacity Building
190
+ Publications", M - Miscellaneous Publications (including Basic
191
+ Documents), P - Periodic Publications, S - Standards and
192
+ Specifications) — the five groups onto the guidance's five codes.
193
+ The name is the lowercase `sNNN`/`bNNN`/`cNNN` (the guidance's own
194
+ s57/s98 spelling); the dotted edition is the bare canonical 4th
195
+ segment; the S-158 member joins the name hyphenated (`s158-102`,
196
+ the fleet extension for compound publication numbers).
197
+ - **The legacy positional `urn:iho:` grammar is decode-only for every
198
+ series, emitted by none** (all five series carry a guidance type
199
+ code): marker segments, positional `ed-`/`year-`, the
192
200
  bare appendix-subnumber atom, and the further bare digit segment
193
201
  binding the S-158 member. The legacy 2.0.x spellings (dotted keys,
194
202
  bare `a.b.c` editions, `y.`) stay decodable, never emitted.
@@ -202,19 +210,35 @@ owner's per-flavor split ruling of 2026-11-25). The laws:
202
210
  IHO S-158 Part S-102 0.2.0 -> urn:mrn:iho:pub:spec:s158-102:0.2.0 (order-stable)
203
211
  IHO M-2 Sup 1 -> urn:mrn:iho:pub:reg:m2:sup-1
204
212
  IHO P-1 Vol. 30 (2) -> urn:mrn:iho:pub:per:p1:vol-30:issue-2
205
- IHO B-4 2.19.0 -> urn:iho:b:4:ed-2.19.0 (legacy, no guidance code)
213
+ IHO B-12 3.0.0 -> urn:mrn:iho:pub:bathy:b12:3.0.0 (CSB Guidance)
214
+ IHO C-51 6.0.0 -> urn:mrn:iho:pub:cb:c51:6.0.0 (Manual on Hydrography)
206
215
 
207
216
  **Breaking URN migrations this scheme carries** (legacy forms stay
208
217
  decodable, never emitted): the official-URN namespace moved to the
209
- guidance form (`urn:mrn:iho:pub:...`) for S/P/M; the S-158 member
218
+ guidance form (`urn:mrn:iho:pub:...`) — first for S/P/M, then for the
219
+ B/C rows too (the legacy `urn:iho:b:/c:` emission is dead); the S-158
220
+ member
210
221
  moved to the `s158-NNN` name encoding (issue #774) with the draft-era
211
- part spellings rebinding onto `checks_for` (#775's parted- mis-bind
222
+ part spellings rebinding onto `product` (#775's parted- mis-bind
212
223
  fixed); the dotted keys (`part.4a`, `suppl.1`, `ap.A`, `annex.A`,
213
224
  `vol.30`, `issue.2`, `appendix.D-2`) and the bare a.b.c edition segment
214
225
  stay decode-only; the #635/#637 `y.2024` tag decodes into the
215
- **volume**. relaton-data-iho needs a re-crawl (it is already legacy
216
- pre-pubid-2 shape); the frozen testsuite corpus rows are re-frozen in
217
- the coupled corpus round.
226
+ **volume**. The wire-type names are honest (the B/C rows were
227
+ misnomers): `pubid:iho:bibliographic` -> `pubid:iho:bathymetric`
228
+ (`Identifiers::Bathymetric`), `pubid:iho:circular-letter` ->
229
+ `pubid:iho:capacity_building` (`Identifiers::CapacityBuilding`) — a
230
+ clean rename of the model (no attribute/face alias kept; the S-158
231
+ checks_for->product precedent); the pubid-scheme slugs `b`/`cl` are
232
+ unchanged. The PRE-RENAME `_type` wire names stay DECODABLE (decode-only,
233
+ never emitted — the LEGACY pattern of this wave): stored rows (the
234
+ relaton-data-iho v2 index, snapshots crawled before the rename) still
235
+ carry them, and the relaton index loader rejects a file whose `_type`
236
+ fails to route — `polymorphic_type_map` merges the two aliases and
237
+ `from_hash` re-tags a legacy `_type` onto the renamed wire name, so a
238
+ decoded row equals a parsed query under `==` (which reads `_type`).
239
+ Removable once relaton-data-iho is re-crawled. relaton-data-iho needs a
240
+ re-crawl (it is already legacy pre-pubid-2 shape); the frozen
241
+ testsuite corpus rows are re-frozen in the coupled corpus round.
218
242
 
219
243
  ## Fixtures run through the classify pipeline
220
244
 
@@ -240,15 +264,15 @@ pubid pin moves in step with the relaton-data-iho re-key.
240
264
  `lib/pubid/iho/pubid_urn_schema.rb`; rulings in the flavor's
241
265
  `lib/pubid/iho/urn.adoc`. The atoms follow the containment order of
242
266
  the official URN — the S-158 member designator rides the document code
243
- (`checks-102`, issue #774) before the document's `ed-`/`year-`, then
267
+ (`product-102`, issue #774) before the document's `ed-`/`year-`, then
244
268
  each component with its own edition/year right after it (`sup-`,
245
269
  `part-`, `parted-`, `appendix-`, `appsub-`, `vol-`, `issue-` …). Case
246
270
  is preserved (`part-A`); the yearbook year is a volume (`vol-2024`, no
247
271
  `year-` value — the legacy `y.` marker stays decodable in the official
248
272
  URN parser, never emitted). The draft-era part-faceted S-158 emission
249
273
  (`part-S-102`, `parted-`) is dead: the `from_hash` unification
250
- redirects it onto the `checks_for` identity, so the legacy URN fails
251
- the canonical gate. The official URN of the S/P/M series is the
274
+ redirects it onto the `product` identity, so the legacy URN fails
275
+ the canonical gate. The official URN of every series is the
252
276
  adopted IHO MRN guidance form (`urn:mrn:iho:pub:...`); the
253
277
  `urn:pubid:iho:` scheme is pubid's own and is not governed by the
254
278
  guidance.
@@ -6,7 +6,7 @@ module Pubid
6
6
  #
7
7
  # Parse goes through {Pubid::Parg::Model.bound} — the artifact's
8
8
  # `bindings identifier` block delivers every component as an
9
- # attribute-named scalar (type, number, checks_for, part, annex,
9
+ # attribute-named scalar (type, number, product, part, annex,
10
10
  # appendix, appendix_subnumber, supplement, edition,
11
11
  # edition_shorthand, year, volume, issue) — so the builder dispatches
12
12
  # the series letter to its concrete class and resolves two
@@ -15,11 +15,11 @@ module Pubid
15
15
  # dotted x.y.z edition ("1" -> "1.0.0", "5.1" -> "5.1.0");
16
16
  # - the S-158 draft-era spellings of the series-member designator
17
17
  # (`S-158 Part S-102`, `S-158-S-102`, `S-158 Part 102`) rebind onto
18
- # `checks_for` — the model of issue #774, where the colon form
18
+ # `product` — the model of issue #774, where the colon form
19
19
  # `S-158:102` is the primary designator and the member is a
20
20
  # publication of its own, not a part.
21
21
  class Builder
22
- ATTRIBUTES = %i[number checks_for appendix appendix_subnumber part
22
+ ATTRIBUTES = %i[number product appendix appendix_subnumber part
23
23
  annex supplement year volume issue
24
24
  part_edition part_year supplement_edition
25
25
  supplement_year annex_edition annex_year
@@ -32,11 +32,11 @@ module Pubid
32
32
  # ruling on the two publication modes).
33
33
  COMPONENT_EDITIONS = %i[part_edition supplement_edition annex_edition
34
34
  appendix_edition volume_edition].freeze
35
- # The S-158 series anchor: the only series the checks_for member
35
+ # The S-158 series anchor: the only series the product member
36
36
  # designator rides (issue #774 — the colon form `S-158:102` is the
37
37
  # S-158 series device; `S-44:5` has no such meaning and rejects).
38
38
  CHECKS_SERIES = "158"
39
- # The draft-era part-face spellings that rebind onto checks_for:
39
+ # The draft-era part-face spellings that rebind onto product:
40
40
  # the expanded series reference ("Part S-102") and the bare member
41
41
  # number ("Part 102"). A lettered or compound part value ("Part A",
42
42
  # "Part 4a") is a genuine part face and never rebinds.
@@ -74,7 +74,7 @@ module Pubid
74
74
  # The alias unification {Builder#build} applies at parse time also
75
75
  # runs on the deserialization path ({Identifier.from_hash}), so a
76
76
  # stored row or a legacy URN carrying the draft-era part model
77
- # decodes to the checks_for identity (issue #774). Pure function:
77
+ # decodes to the product identity (issue #774). Pure function:
78
78
  # returns the given hash untouched when it carries no draft-era
79
79
  # part face, a normalized copy otherwise. The spelling face is
80
80
  # NOT restored here — a deserialized identifier renders the
@@ -85,7 +85,7 @@ module Pubid
85
85
 
86
86
  part = data["part"] || data[:part]
87
87
  number = data["number"] || data[:number]
88
- checks = data["checks_for"] || data[:checks_for]
88
+ checks = data["product"] || data[:product]
89
89
  type_key = data["_type"] || data[:_type]
90
90
  return data unless part && number == CHECKS_SERIES && !checks
91
91
  return data unless standard_type?(type_key)
@@ -107,7 +107,7 @@ module Pubid
107
107
  hash.delete(:part_edition)
108
108
  hash.delete("part_year")
109
109
  hash.delete(:part_year)
110
- hash["checks_for"] = digits
110
+ hash["product"] = digits
111
111
  hash["edition"] ||= edition if edition
112
112
  hash["year"] ||= year if year
113
113
  hash
@@ -134,17 +134,17 @@ module Pubid
134
134
 
135
135
  private
136
136
 
137
- # The S-158 alias unification (issue #774). A bound checks_for
137
+ # The S-158 alias unification (issue #774). A bound product
138
138
  # must ride the S-158 anchor. Otherwise a draft-era part face on
139
139
  # the S-158 family — a series reference ("Part S-102") or the
140
- # bare member number ("Part 102") — rebinds onto checks_for: the
140
+ # bare member number ("Part 102") — rebinds onto product: the
141
141
  # member is a publication of its own, not a part. The edition
142
142
  # that follows the part face is the BASE edition (the parted-
143
143
  # mis-bind fix of issue #775), and the spelling face records the
144
144
  # part value as written so the render keeps the input's spelling
145
145
  # (facets-spelling-only; equality/URN use the canonical shape).
146
146
  def resolve_checks_alias!(attrs, type)
147
- return assert_checks_anchor!(attrs, type) if attrs[:checks_for]
147
+ return assert_checks_anchor!(attrs, type) if attrs[:product]
148
148
 
149
149
  return unless type == S4_TYPE && attrs[:number] == CHECKS_SERIES
150
150
 
@@ -164,8 +164,8 @@ module Pubid
164
164
  "duplicate year: the base year #{attrs[:year]} and the " \
165
165
  "member year #{year} cannot both ride S-158:#{digits}"
166
166
  end
167
- attrs[:checks_for] = digits
168
- attrs[:checks_for_face] = attrs.delete(:part)
167
+ attrs[:product] = digits
168
+ attrs[:product_face] = attrs.delete(:part)
169
169
  attrs[:edition] ||= edition
170
170
  attrs[:year] ||= year
171
171
  end
@@ -177,8 +177,8 @@ module Pubid
177
177
  return if type == S4_TYPE && attrs[:number] == CHECKS_SERIES
178
178
 
179
179
  raise ArgumentError,
180
- "the checks_for member designator is the S-158 series " \
181
- "device: #{type}-#{attrs[:number]}:#{attrs[:checks_for]} " \
180
+ "the product member designator is the S-158 series " \
181
+ "device: #{type}-#{attrs[:number]}:#{attrs[:product]} " \
182
182
  "cannot carry it"
183
183
  end
184
184
 
@@ -57,14 +57,14 @@ module Pubid
57
57
  # each a publication of its own with its own edition stream. The
58
58
  # value is the S-100 product number whose checks the member
59
59
  # specifies; the colon form `S-158:102` is the primary designator.
60
- attribute :checks_for, :string
60
+ attribute :product, :string
61
61
  # The spelling face of the member designator (facets-spelling-only,
62
62
  # equality-ignored): the parse records the draft-era part value as
63
63
  # written ("S-102", "102") so the render keeps the input's
64
64
  # spelling; the canonical colon form renders when this is nil.
65
65
  # Deserialization (from_hash) restores no face — equality/URN use
66
66
  # the canonical shape.
67
- attribute :checks_for_face, :string
67
+ attribute :product_face, :string
68
68
  attribute :publisher, :string, default: "IHO"
69
69
  # The official IHO edition is the dotted x.y.z (a plain string — the
70
70
  # ~16 string-edition flavors precede this). `IHO S-100 1.0.0` is
@@ -118,7 +118,7 @@ module Pubid
118
118
  # (facets-spelling-only): `S-158 Part S-102 0.2.0` and
119
119
  # `S-158:102 0.2.0` are one document, so `==`, `hash`, `eql?` and
120
120
  # the subset match skip the face; only the render reads it.
121
- equality_ignored :checks_for_face
121
+ equality_ignored :product_face
122
122
 
123
123
  # Polymorphic type map for lutaml::Model key_value serialization: maps
124
124
  # each subclass's polymorphic_name to its class name so `from_hash` can
@@ -127,10 +127,29 @@ module Pubid
127
127
  "pubid:iho:standard" => "Pubid::Iho::Identifiers::Standard",
128
128
  "pubid:iho:publication" => "Pubid::Iho::Identifiers::Publication",
129
129
  "pubid:iho:miscellaneous" => "Pubid::Iho::Identifiers::Miscellaneous",
130
- "pubid:iho:bibliographic" => "Pubid::Iho::Identifiers::Bibliographic",
131
- "pubid:iho:circular-letter" => "Pubid::Iho::Identifiers::CircularLetter",
130
+ "pubid:iho:bathymetric" => "Pubid::Iho::Identifiers::Bathymetric",
131
+ "pubid:iho:capacity_building" =>
132
+ "Pubid::Iho::Identifiers::CapacityBuilding",
132
133
  }.freeze
133
134
 
135
+ # The polymorphic ROUTE table for {from_hash}: the base derives it from
136
+ # the concrete classes' `polymorphic_name`s; the PRE-RENAME B/C wire
137
+ # names (`bibliographic`/`circular-letter` — the rows were misnomered
138
+ # before the bathy/cb rename) merge in beside them as decode-only
139
+ # aliases (class-valued, the route table's own shape). Stored rows —
140
+ # the relaton-data-iho v2 index, any snapshot crawled before the
141
+ # rename — still carry them; `Pubid.from_hash` routes through this
142
+ # map on the raw hash. Decode-only, never emitted: the emission side
143
+ # writes the renamed `polymorphic_name`. Removable once
144
+ # relaton-data-iho is re-crawled.
145
+ def self.polymorphic_type_map
146
+ @polymorphic_type_map ||= super.merge(
147
+ "pubid:iho:bibliographic" => Pubid::Iho::Identifiers::Bathymetric,
148
+ "pubid:iho:circular-letter" =>
149
+ Pubid::Iho::Identifiers::CapacityBuilding,
150
+ )
151
+ end
152
+
134
153
  # The base Pubid::Identifier no longer auto-maps attributes, so each
135
154
  # flavor's top class must declare its own key_value mapping. IHO
136
155
  # attributes are plain strings, so they map directly. `publisher` is
@@ -139,7 +158,7 @@ module Pubid
139
158
  key_value do
140
159
  map "_type", to: :_type, polymorphic_map: IHO_TYPE_MAP
141
160
  map "number", to: :number
142
- map "checks_for", to: :checks_for
161
+ map "product", to: :product
143
162
  map "edition", to: :edition
144
163
  map "year", to: :year
145
164
  map "supplement", to: :supplement
@@ -170,11 +189,39 @@ module Pubid
170
189
  # The deserialization path applies the same S-158 alias
171
190
  # unification the parse path applies (Builder.normalize_checks_alias):
172
191
  # a stored row or a legacy URN carrying the draft-era part model
173
- # (part: "S-102", part_edition: "0.2.0") decodes to the checks_for
192
+ # (part: "S-102", part_edition: "0.2.0") decodes to the product
174
193
  # identity (issue #774), so no construction path yields the
175
194
  # two-identity disease of issue #775.
195
+ # The pre-rename B/C wire names decode onto the RENAMED canonical tag:
196
+ # a stored row's `_type` is re-tagged beside the class route
197
+ # ({polymorphic_type_map}), so a decoded legacy row reads and compares
198
+ # as the renamed type (`==` compares `_type`; the relaton index
199
+ # matcher rebuilds both sides through from_hash — a row left carrying
200
+ # `pubid:iho:bibliographic` would never equal a parsed
201
+ # `pubid:iho:bathymetric` query). Pure function; the hash without a
202
+ # legacy `_type` passes through untouched.
203
+ LEGACY_TYPE_RETAG = {
204
+ "pubid:iho:bibliographic" => "pubid:iho:bathymetric",
205
+ "pubid:iho:circular-letter" => "pubid:iho:capacity_building",
206
+ }.freeze
207
+
176
208
  def self.from_hash(data, options = {})
177
- super(Builder.normalize_checks_alias(data), options)
209
+ super(Builder.normalize_checks_alias(normalize_legacy_type(data)),
210
+ options)
211
+ end
212
+
213
+ # Pure function: retags a legacy `_type` (string or symbol key) onto
214
+ # the renamed wire name. Removable once relaton-data-iho is re-crawled.
215
+ def self.normalize_legacy_type(data)
216
+ return data unless data.is_a?(::Hash)
217
+
218
+ canonical = LEGACY_TYPE_RETAG[(data["_type"] || data[:_type]).to_s]
219
+ return data unless canonical
220
+
221
+ data.dup.tap do |hash|
222
+ hash["_type"] = canonical if hash.key?("_type")
223
+ hash[:_type] = canonical if hash.key?(:_type)
224
+ end
178
225
  end
179
226
 
180
227
  # The volume/issue and appendix/subnumber pairs are scalar clusters:
@@ -265,7 +312,7 @@ module Pubid
265
312
  def base_code
266
313
  code = +"#{self.class.type[:short]}-#{number}"
267
314
  # the S-158 member designator rides the code (the colon form)
268
- code << ":#{checks_for}" if checks_for
315
+ code << ":#{product}" if product
269
316
  code
270
317
  end
271
318
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iho
5
+ module Identifiers
6
+ # IHO Bathymetric Publication (B series; S-11 Part C Ed 1.0.0
7
+ # section 1.2: "B - Bathymetric Publications (Mainly related to
8
+ # GEBCO)" — the MRN guidance's `bathy` publication type).
9
+ # Example: IHO B-4 2.19.0.
10
+ class Bathymetric < Identifier
11
+ def self.type
12
+ { key: :bathymetric, title: "Bathymetric Publication",
13
+ short: "B" }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iho
5
+ module Identifiers
6
+ # IHO Capacity Building Publication (C series; S-11 Part C Ed 1.0.0
7
+ # section 1.2: "C - Capacity Building Publications" — the MRN
8
+ # guidance's `cb` publication type).
9
+ # Example: IHO C-13 1.0.0 (the Manual on Hydrography).
10
+ class CapacityBuilding < Identifier
11
+ def self.type
12
+ { key: :capacity_building, title: "Capacity Building Publication",
13
+ short: "C" }
14
+ end
15
+
16
+ # The auto-derived name kebab-cases to "capacity-building"; the
17
+ # wire type keeps the underscore spelling (the domain term, the
18
+ # type key's own shape) — the bsi_pfs hard-return precedent.
19
+ def self.polymorphic_name
20
+ "pubid:iho:capacity_building"
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -3,8 +3,8 @@
3
3
  module Pubid
4
4
  module Iho
5
5
  module Identifiers
6
- autoload :Bibliographic, "#{__dir__}/identifiers/bibliographic"
7
- autoload :CircularLetter, "#{__dir__}/identifiers/circular_letter"
6
+ autoload :Bathymetric, "#{__dir__}/identifiers/bathymetric"
7
+ autoload :CapacityBuilding, "#{__dir__}/identifiers/capacity_building"
8
8
  autoload :Miscellaneous, "#{__dir__}/identifiers/miscellaneous"
9
9
  autoload :Publication, "#{__dir__}/identifiers/publication"
10
10
  autoload :Standard, "#{__dir__}/identifiers/standard"
@@ -8,11 +8,11 @@ module Pubid
8
8
  # IHO S-100 5.0.0 Part 2 (2024) ->
9
9
  # urn:pubid:iho:std:100:ed-5.0.0:year-2024:part-2
10
10
  # IHO S-158:102 1.0.0 ->
11
- # urn:pubid:iho:std:158:checks-102:ed-1.0.0
11
+ # urn:pubid:iho:std:158:product-102:ed-1.0.0
12
12
  #
13
13
  # The atoms follow the containment order of the official URN: the
14
- # S-158 member designator rides the document code (the checks_for
15
- # component is the series member itself — `checks-<NNN>`, issue
14
+ # S-158 member designator rides the document code (the product
15
+ # component is the series member itself — `product-<NNN>`, issue
16
16
  # #774), then the document's edition and year, then each component
17
17
  # with its own edition/year right after it — supplement, part,
18
18
  # annex, appendix (the two-level Appendix D-2 keeps the subnumber as
@@ -27,8 +27,8 @@ module Pubid
27
27
  # scheme is pubid's own and is not governed by the guidance.
28
28
  PubidUrnSchema = Pubid::PubidUrn.define("iho") do
29
29
  # The S-158 series member (issue #774): rides the document code,
30
- # before the edition — `urn:pubid:iho:std:158:checks-102:ed-1.0.0`.
31
- atom "checks_for", "checks"
30
+ # before the edition — `urn:pubid:iho:std:158:product-102:ed-1.0.0`.
31
+ atom "product", "product"
32
32
  atom "edition", "ed"
33
33
  atom "year", "year"
34
34
  atom "supplement", "sup"
@@ -55,8 +55,8 @@ module Pubid
55
55
  atom "volume_edition", "voled"
56
56
  atom "volume_year", "voly"
57
57
 
58
- type "pubid:iho:bibliographic", "b"
59
- type "pubid:iho:circular-letter", "cl"
58
+ type "pubid:iho:bathymetric", "b"
59
+ type "pubid:iho:capacity_building", "cl"
60
60
  type "pubid:iho:identifier", "id"
61
61
  type "pubid:iho:miscellaneous", "m"
62
62
  type "pubid:iho:publication", "pub"
@@ -66,7 +66,7 @@ module Pubid
66
66
  # part-face spelling keeps its own face (` Part S-102`) through
67
67
  # the part slot below — facets-spelling-only: the render keeps
68
68
  # the input's spelling, equality/URN use the canonical shape.
69
- rendered << ":#{id.checks_for}" if id.checks_for && !id.checks_for_face
69
+ rendered << ":#{id.product}" if id.product && !id.product_face
70
70
  FACES.each do |component, face|
71
71
  value = face_value(id, component)
72
72
  rendered << (face % value) if value
@@ -79,7 +79,7 @@ module Pubid
79
79
  # nil = the face does not print. The citation face replaces the
80
80
  # Part face (same containment slot: the citation letter IS the
81
81
  # part), and it prints only on a spec citation. The S-158
82
- # member's draft-era part face (`checks_for_face`, the part value
82
+ # member's draft-era part face (`product_face`, the part value
83
83
  # as written) takes the Part slot the same way.
84
84
  def face_value(id, component)
85
85
  if component == :spec
@@ -88,7 +88,7 @@ module Pubid
88
88
  return spec_citation(id)
89
89
  end
90
90
  return nil if component == :part && id.spec
91
- return id.checks_for_face if component == :part && id.checks_for_face
91
+ return id.product_face if component == :part && id.product_face
92
92
 
93
93
  id.public_send(component)
94
94
  end