pubid 2.0.51 → 2.0.53

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.
data/data/parg/iho.parg CHANGED
@@ -1,9 +1,10 @@
1
1
  # Port of lib/pubid/iho/parser.rb — IHO identifiers: letter series
2
- # (S/P/M/B/C), a number with an optional suffix, and the full component
3
- # tail (edition, supplement, part, annex, appendix + subnumber, volume,
4
- # issue, year qualifier).
2
+ # (S/P/M/B/C), a number with the optional S-158 series-member designator,
3
+ # and the full component tail (edition, supplement, part, annex, appendix
4
+ # + subnumber, volume, issue, year qualifier).
5
5
  #
6
- # == Component model (owner rulings, 2026-11-03)
6
+ # == Component model (owner rulings, 2026-11-03; the S-158 series model,
7
+ # issue #774, 2026-11-25)
7
8
  #
8
9
  # Every component below is a first-class semantic component: its own
9
10
  # named capture, its own typed binding, independently addressable in
@@ -16,11 +17,26 @@
16
17
  # x.y.0 — official IHO
17
18
  # edition is dotted
18
19
  # x.y.z WITHOUT a year)
20
+ # checks_for S-158:102 checks_for string (the S-158
21
+ # series member: the
22
+ # S-100 product number
23
+ # whose validation
24
+ # checks the member
25
+ # specifies; the colon
26
+ # form is the PRIMARY
27
+ # designator since
28
+ # S-158 Ed 1.0.0)
19
29
  # supplement Sup N (Suppl N) supplement string
20
- # part Part X / Part S-102 part string (letter,
21
- # number, or SERIES
22
- # REFERENCE)
23
- # part -X / -S-102 (short) part string (hyphenated)
30
+ # part Part X part string (letter,
31
+ # number, or compound
32
+ # "4a"; on the S-158
33
+ # family a digit or
34
+ # SERIES-REFERENCE
35
+ # value is the draft-era
36
+ # checks spelling and
37
+ # REBINDS to checks_for)
38
+ # part -X / -S-102 (short) part string (hyphenated;
39
+ # same S-158 rebind)
24
40
  # annex Annex A annex string
25
41
  # appendix Appendix B appendix string
26
42
  # appendix Appendix D-2 appendix_subnumber string (the -2)
@@ -56,23 +72,46 @@
56
72
  # In the URN the ed- segment attaches to the node it follows, so the
57
73
  # same positional slot records both modes.
58
74
  #
75
+ # == The S-158 series model (issue #774; S-158 Ed 1.0.0 clause 2.1)
76
+ #
77
+ # S-158 "Validation Checks — Introduction and Structure" is a framework
78
+ # publication defining a SERIES of separate publications, each a
79
+ # publication of its own with its own edition stream: S-158:100 (generic
80
+ # checks), S-158:1xx (one product-specific check specification per S-100
81
+ # product; :101 = S-101 ENC, :102 = S-102 Bathymetric Surface),
82
+ # S-158:98 (interoperability) and S-158:128 (catalogue). `:NNN` is the
83
+ # official IHO product number whose checks the member specifies — NOT a
84
+ # part and NOT a "profile".
85
+ #
86
+ # The colon form is the PRIMARY designator since Ed 1.0.0:
87
+ # `S-158:102 [edition]` binds number=158 and checks_for=102 as two
88
+ # typed components. The draft-era spellings are NON-NORMALIZED ALIASES
89
+ # of the same identity (facets-spelling-only: each spelling keeps its
90
+ # render, equality/URN use the canonical shape):
91
+ #
92
+ # S-158 Part S-102 the expanded draft-era part face (the builder
93
+ # rebinds the part value onto checks_for and the
94
+ # edition that follows it onto the BASE edition —
95
+ # the parted- mis-bind of issue #775)
96
+ # S-158-S-102 the compact hyphenated face (same rebind)
97
+ # S-158 Part 102 the bare-number draft-era part face
98
+ #
99
+ # A series-reference-shaped part face rebinds only while checks_for is
100
+ # UNBOUND: `S-158:100 Part 2` keeps a genuine part on the member
101
+ # publication. A lettered part face on S-158 is unattested and stays a
102
+ # plain part. The colon form on any other anchor (S-44:5) is rejected
103
+ # by the builder: the member designator is the S-158 series device.
104
+ #
59
105
  # The part has a COMPACT face, hyphenated onto the code — `IHO S-5-B`
60
- # (lettered part), `IHO S-100-1` (numbered part), `IHO S-158-S-102`
61
- # (series-reference part) — which both parses and renders; the
62
- # canonical expanded face stays `IHO S-100 x.y.z Part 1`. Gluing a part
63
- # onto the code without a separator (S-5A) is DISALLOWED as a form: it
64
- # cannot extend to numbered parts without ambiguity (S-1001 = series
65
- # 1001 vs series 100 part 1). The four lettered bases the corpus
66
- # records (S-5A, S-5B, S-8A, S-8B) are LEGACY data spellings: they
67
- # still parse as aliases (S-5A == S-5 Part A) but are never rendered;
68
- # the owner rules later whether to reject them outright.
69
- #
70
- # Series-reference parts: a check standard applied to another IHO
71
- # series cites the applied series as its part — `IHO S-158 0.2.0 Part
72
- # S-102` (the wild glued `S-158-102` spelling is a legacy alias whose
73
- # normalization to Part S-102 needs an IHO series table; the syntax
74
- # alone cannot tell it from S-100-1 = Part 1, so it currently parses
75
- # as the plain number part).
106
+ # (lettered part), `IHO S-100-1` (numbered part) — which both parses
107
+ # and renders; the canonical expanded face stays `IHO S-100 x.y.z
108
+ # Part 1`. Gluing a part onto the code without a separator (S-5A) is
109
+ # DISALLOWED as a form: it cannot extend to numbered parts without
110
+ # ambiguity (S-1001 = series 1001 vs series 100 part 1). The four
111
+ # lettered bases the corpus records (S-5A, S-5B, S-8A, S-8B) are LEGACY
112
+ # data spellings: they still parse as aliases (S-5A == S-5 Part A) but
113
+ # are never rendered; the owner rules later whether to reject them
114
+ # outright.
76
115
  #
77
116
  # Two main syntaxes per the owner ruling: `IHO S-100 1.0.0` (dated =
78
117
  # edition-specific) and `IHO S-100` (undated = edition-non-specific).
@@ -92,7 +131,45 @@
92
131
  # (S-5A, parse-only), "S-100 v1..v5.1" (edition shorthand), "Issue N"
93
132
  # (canonical (N)), the bare year (canonical Vol. N).
94
133
  #
95
- # == URN segment grammar (positional, containment-ordered)
134
+ # == URN emission — the IHO MRN guidance (owner adoption, 2026-11-25)
135
+ #
136
+ # The flavor emits the IHO MRN guidance form (S-100WG4, "MRN Guidelines
137
+ # for IHO") for the series the guidance gives a publication type:
138
+ #
139
+ # urn:mrn:iho:pub:<type>:<name>[:<edition>][:<trailing atoms>...]
140
+ # <type> spec (S series) | per (P series) | reg (M series)
141
+ # <name> sNNN — the lowercase series letter + number (the guidance's
142
+ # own "s57"/"s98" name form; the dotted edition is the
143
+ # canonical 4th segment, per IHO's printed S-98 metadata
144
+ # urn:mrn:iho:pub:spec:s98:1.0.0)
145
+ # <edition> the bare dotted x.y.z — NOT ed-prefixed
146
+ #
147
+ # The S-158 member joins the name segment hyphenated — the fleet
148
+ # extension of the guidance for compound publication numbers — so the
149
+ # edition stays in its canonical 4th position:
150
+ #
151
+ # S-158 1.0.0 -> urn:mrn:iho:pub:spec:s158:1.0.0
152
+ # S-158:102 1.0.0 -> urn:mrn:iho:pub:spec:s158-102:1.0.0
153
+ #
154
+ # The trailing atoms carry the components the guidance's tail slots do
155
+ # not model, in the containment order below, lowercase marker tokens,
156
+ # RFC 3986-safe, values case-preserved (identity law: part-A and part-a
157
+ # are distinct documents); a component's own edition rides as ed- right
158
+ # after it (the duality law), the Appendix subnumber hyphen-joins its
159
+ # appendix (appendix-D-2):
160
+ #
161
+ # [:year-<yyyy>][:sup-<n>[:ed-<x.y.z>][:year-<yyyy>]]
162
+ # [:part-<X>[...]][:spec-<n>[:specsub-<n>][:specvar-<X>]]
163
+ # [:annex-<A>[...]][:appendix-<B>[-<sub>][...]]
164
+ # [:vol-<n>[:issue-<n>][...]]
165
+ #
166
+ # The guidance's bare correction/clarification slots (the s57:3:1 form)
167
+ # are not modeled faces and reject. The B (Bibliographic) and C
168
+ # (Circular Letter) series have no guidance publication type code —
169
+ # until IHO assigns one they keep the legacy positional emission below.
170
+ #
171
+ # == Legacy positional segment grammar (decode-only for S/P/M, the
172
+ # emission of the B/C series)
96
173
  #
97
174
  # The URN mirrors the containment tree, one semantic atom per segment:
98
175
  # Part contains Annexes; Annex contains Appendices; a D-2 subnumber is
@@ -203,7 +280,7 @@
203
280
  # reference-built rules as the matched text, so the v2 tree is the v1
204
281
  # tree plus named leaves for non-captured structure.
205
282
 
206
- grammar PubidIho version "0.3.0" edition 2 {
283
+ grammar PubidIho version "0.4.0" edition 2 {
207
284
  digit = %x30-39
208
285
  upper = %x41-5A
209
286
  lower = %x61-7A
@@ -213,14 +290,20 @@ grammar PubidIho version "0.3.0" edition 2 {
213
290
  dot = "."
214
291
 
215
292
  series = ("S" / "P" / "M" / "B" / "C") as type
216
- number_suffix = (":" 1*digit)
217
- number = (1*digit [number_suffix]) as number
293
+ number = (1*digit) as number
294
+ # The S-158 series-member designator (issue #774): the colon form
295
+ # "S-158:102" binds the member number as its own typed component
296
+ # (the S-100 product number whose checks the member specifies),
297
+ # never a glued number suffix. The builder restricts the designator
298
+ # to the S-158 anchor (S-44:5 rejects).
299
+ checks_for = ":" (1*digit) as checks_for
218
300
  # The compact part face, hyphenated onto the code: S-5-B (lettered),
219
- # S-100-1 (numbered) and S-158-S-102 (series reference) — the dash
220
- # replaces the old bare-glued suffix, so a number like S-1001 stays a
221
- # whole number (the dash is what makes the part unambiguous). The
222
- # dash is an inlined literal: a named dash ref here collides with the
223
- # sequence's own dash node in the edition-2 tree.
301
+ # S-100-1 (numbered) and the draft-era S-158-S-102 (series reference,
302
+ # rebound to checks_for by the builder) — the dash replaces the old
303
+ # bare-glued suffix, so a number like S-1001 stays a whole number
304
+ # (the dash is what makes the part unambiguous). The dash is an
305
+ # inlined literal: a named dash ref here collides with the sequence's
306
+ # own dash node in the edition-2 tree.
224
307
  compact_part = "-" ((("S" / "P" / "M" / "B" / "C") dash (1*digit)) / (1*digit [*letter]) / upper) as part
225
308
  # LEGACY glued lettered bases (S-5A, S-5B, S-8A, S-8B in the corpus):
226
309
  # parse-only aliases, never rendered. Kept because the records exist;
@@ -353,6 +436,7 @@ grammar PubidIho version "0.3.0" edition 2 {
353
436
  series
354
437
  dash
355
438
  number
439
+ [checks_for]
356
440
  [compact_part]
357
441
  [glued]
358
442
  [volume_short]
@@ -410,11 +494,16 @@ grammar PubidIho version "0.3.0" edition 2 {
410
494
  accept "IHO S-100 1.0.0 (2024) Part A"
411
495
  accept "IHO S-53 Ap. 1 1.0.0"
412
496
  accept "IHO S-98 Part A 1.0.0"
497
+ # --- the S-158 series model (issue #774) ---
413
498
  accept "IHO S-158:100 1.0.0"
414
499
  accept "IHO S-158:100 Part 2 1.0.0"
500
+ accept "IHO S-158:102"
501
+ accept "IHO S-158:102 1.0.0"
502
+ accept "IHO S-158:128"
415
503
  accept "IHO S-1001"
416
504
  accept "IHO S-158 Part S-102 0.2.0"
417
505
  accept "IHO S-158-S-102 0.2.0"
506
+ accept "IHO S-158 Part 102"
418
507
  accept "IHO P-6 1.0.0 Vol. 2"
419
508
  accept "IHO P-6 Vol. 2 1.0.1"
420
509
  accept "IHO S-98 1.0.0 Annex A"
@@ -441,11 +530,15 @@ grammar PubidIho version "0.3.0" edition 2 {
441
530
  reject "nonsense"
442
531
  reject "IHO B-12 3.0"
443
532
  reject "IHO P-5 1850"
533
+ # --- the S-158 series model: malformed colon forms (issue #774) ---
534
+ reject "IHO S-158:"
535
+ reject "IHO S-158:abc"
444
536
  }
445
537
 
446
538
  bindings identifier_entry {
447
539
  type -> type (string)
448
540
  number -> number (string)
541
+ checks_for -> checks_for (string)
449
542
  part -> part (string)
450
543
  part_edition -> part_edition (string)
451
544
  part_year -> part_year (string)
@@ -16,6 +16,7 @@ code at all (see "Codeless publications" below).
16
16
  | Series | Type | Numbering | Example |
17
17
  |--------|------|-----------|---------|
18
18
  | S | Standard | 4 digits, zero-padded | `IALA S1070 Ed 2.0` |
19
+ | S-2xx | Product Specification | the IHO-granted S-201..S-299 range, hyphenated (`S-201`), dotted x.y.z edition, bare face | `S-201 2.0.0` |
19
20
  | R | Recommendation | 4 digits, zero-padded | `IALA R0126 Ed 2.0` |
20
21
  | G | Guideline | 4 digits, zero-padded | `IALA G1015 Ed 2.2` |
21
22
  | C | Model Course | 4 digits + `-` part | `IALA C0103-1 Ed 3.0` |
@@ -24,7 +25,7 @@ code at all (see "Codeless publications" below).
24
25
  | L | Letter | dotted + dashed, verbatim | `IALA L2.1.11 Ed 2` |
25
26
  | X | Report (reserved) | 4 digits | `IALA X0123` |
26
27
  | P | Resolution/Council publication (reserved) | 4 digits | `IALA P0123` |
27
- | — | Annex wrapper over any base | bare or lettered | `IALA G1128 ANNEX A Ed 1.6` |
28
+ | — | Annex wrapper over any base | bare or lettered (letter takes a sub-number, `ANNEX B2`) | `IALA G1128 ANNEX A Ed 1.6`, `S-201 ANNEX B2` |
28
29
  | — | Publication (no code) | product-URL slug | `IALA arctic-seminar-report (E)` |
29
30
 
30
31
  The A letter is GeneralAssembly's legacy session form, not a separate
@@ -36,9 +37,41 @@ through to_s and the URN; there is no Advice type.
36
37
 
37
38
  The Annex class has no prefix of its own: it wraps a base identifier of
38
39
  another series and preserves the annex marker case (`Annex` vs `ANNEX`).
40
+ Its letter takes an optional trailing digit (the S-201 package's
41
+ sub-numbered annexes "Annex B2"/"Annex D1" on iala.int).
39
42
  X and P are reserved for future numbered series — today's reports and
40
43
  Council publications carry no code, and parse as `Publication`.
41
44
 
45
+ ## S-100-family product specifications (`Identifiers::ProductSpecification`)
46
+
47
+ IHO granted IALA the S-200 domain's product-spec numbering, S-201 to
48
+ S-299 (iala.int, "IALA S-200 Product Specification and Development
49
+ Status": compliant with the IHO S-100 standard; the dev-status pages
50
+ name S-201, S-210, S-211, S-212, S-230, S-240, S-245, S-246, S-247).
51
+
52
+ - **The lexical form is hyphenated** (`S-201`) — unlike the legacy
53
+ zero-padded S series (`S1010`), and the edition is the S-100 dotted
54
+ x.y.z on the **bare face** (`S-201 2.0.0`, iala.int's own citation
55
+ form). `IALA S-201 2.0.0`, `Ed 2.0.0`, `:ed2.0.0` and the lower-case
56
+ code spelling are normalizing aliases.
57
+ - **The designation carries no publisher token** (`publisher_prefixes`
58
+ is `[]`, the WMO S-100 rule), so `to_s(with_publisher:)` is the
59
+ identity. The `publisher` attribute stays "IALA" (the default) for
60
+ the hash.
61
+ - **The grant bounds the grammar**: the hundreds digit is fixed to 2
62
+ and `S-200` is excluded ("spans from S-201"), so WMO's S-4xx and
63
+ IHO's S-1xx never parse here. Routing reclaims the bare S-2xx strings
64
+ the WMO flavor's generic S-rule used to capture (`S-201 2.0.0` was
65
+ `urn:mrn:wmo:pub:s-201:ed2.0.0` on pubid 2.0.51) via the exact
66
+ round trip; WMO keeps S-411/S-412. This is the pubid#469/#763
67
+ dual-perspective law: the lexical form leads no prefix, each org
68
+ assigns its own identifier.
69
+ - **The annex wrapper rides the same class** (`S-201 ANNEX B2` → Annex
70
+ over ProductSpecification); the annex edition face follows the base's
71
+ family (bare for S-100, `Ed` for the legacy series).
72
+ - `type[:short]` is nil (no letter table entry — "S" would collide with
73
+ Standard's); the renderer and the URN generator branch on the class.
74
+
42
75
  ## Codeless publications (`Identifiers::Publication`)
43
76
 
44
77
  iala.int lists reports and proceedings, the style guide, history books,
@@ -91,18 +124,30 @@ that no pubid parse covers.
91
124
  ## MRN URN scheme
92
125
 
93
126
  IALA publications are named in the `mrn` URN tree as assigning
94
- authority `iala`, sub-namespace `pub`:
127
+ authority `iala`, sub-namespace `pub`. The scheme is the official MRN
128
+ of IALA Recommendation R1023 (Maritime Resource Names; its own cover
129
+ prints `urn:mrn:iala:pub:r1023:ed1.0`), Guideline G1143 (Unique
130
+ Identifiers for Maritime Resources — the ABNF, the lowercase
131
+ case-insensitive face, Annex A4's `urn:mrn:iala:pub:<managed name
132
+ spaces>`) and Guideline G1164 (Management of MRN Organisation
133
+ Identifiers — IALA's org id and the OID rules); all three are on the
134
+ MRN portal (https://www.iala.int/technical/data-modelling-mrn/). The
135
+ full per-flavor URN record, with the segment table and the divergence
136
+ audit, is `lib/pubid/iala/urn.adoc`.
95
137
 
96
138
  ```
97
- urn:mrn:iala:pub:<code>[:annex[-<letter>]][:ed<x.x>][:<lang>]
139
+ urn:mrn:iala:pub:<code>[:annex[-<letter>]][:ed<edition>][:<lang>]
98
140
  ```
99
141
 
100
142
  - `<code>` — the lowercased series prefix + number (`s1070`,
101
143
  `c0103-1`, `ga01.01`, `l2.1.11`, `a12-01`, and the reserved `x0123`,
102
- `p0123`)
144
+ `p0123`), plus the S-100-family codes hyphenated (`s-201` … `s-299`)
103
145
  - `annex` / `annex-<letter>` — the Annex wrapper (lettered form for
104
- `ANNEX A`-style, bare for `Annex` without a letter)
105
- - `ed<x.x>` — edition, lowercase marker, no separator dot
146
+ `ANNEX A`-style, bare for `Annex` without a letter; the letter takes
147
+ a sub-number, `annex-b2`)
148
+ - `ed<x.y>` — edition, lowercase marker, no separator dot; the digits
149
+ are verbatim, so an S-100-family edition carries all three segments
150
+ (`ed2.0.0`, the form of IALA S-201 Edition 2.0.0)
106
151
  - `<lang>` — single lowercase language letter
107
152
 
108
153
  The authoritative pattern for published documents is the IALA Style
@@ -124,6 +169,10 @@ generator/parser pair.
124
169
  separator dot. Both malformed variants printed in the published R1026
125
170
  PDF (`…r1026:Ed1.0`, `…r1026:ed.1.0`) parse and normalize to the
126
171
  canonical `ed1.0`.
172
+ - The S-100-family faces normalize: the prefixed spellings (`IALA
173
+ S-201 2.0.0`, `Ed 2.0.0`, the compact `:ed2.0.0`) and the lower-case
174
+ code (`s-201`) all render as the bare `S-201 2.0.0`; the URN round
175
+ goes through the grammar's `Ed` alias and restores the bare face.
127
176
  - Short inputs are zero-padded to the canonical form (`M1` → `M0001`,
128
177
  `GA1.1` → `GA01.01`); L-series numbering is preserved verbatim.
129
178
 
@@ -8,6 +8,7 @@ module Pubid
8
8
  class Builder
9
9
  def build(parsed)
10
10
  return build_annex(parsed) if parsed[:annex_marker]
11
+ return build_product_spec(parsed) if parsed[:s100_number]
11
12
  return build_publication(parsed) if parsed[:slug]
12
13
 
13
14
  type_letter = stringify(parsed[:type_letter])&.upcase
@@ -28,6 +29,21 @@ module Pubid
28
29
 
29
30
  private
30
31
 
32
+ # Build an S-100-family product specification: the grammar's
33
+ # s100_number capture (the digits after "S-", e.g. "201") is the
34
+ # whole identity; the hyphen and the S are the code face the
35
+ # renderer and the URN generator add. The edition is the S-100
36
+ # dotted x.y.z, carried verbatim.
37
+ def build_product_spec(hash)
38
+ attrs = {
39
+ number: stringify(hash[:s100_number]),
40
+ edition: stringify(hash[:edition_value]),
41
+ language: stringify(hash[:language])&.upcase,
42
+ }.compact
43
+
44
+ Identifiers::ProductSpecification.new(**attrs)
45
+ end
46
+
31
47
  # Build a codeless publication: the slug is its whole identity and
32
48
  # goes into `number`, verbatim (no padding applies).
33
49
  def build_publication(hash)
@@ -46,9 +62,16 @@ module Pubid
46
62
  # harvest hoists them to the top level and this branch reads the
47
63
  # same flat keys as the plain identifier.
48
64
  def build_annex(hash)
49
- base_type = stringify(hash[:type_letter])&.upcase
50
- base_klass = Iala.identifier_klass_for_type_letter(base_type)
51
- base = base_klass.new(number: build_number(hash, base_klass))
65
+ base =
66
+ if hash[:s100_number]
67
+ Identifiers::ProductSpecification.new(
68
+ number: stringify(hash[:s100_number]),
69
+ )
70
+ else
71
+ base_type = stringify(hash[:type_letter])&.upcase
72
+ base_klass = Iala.identifier_klass_for_type_letter(base_type)
73
+ base_klass.new(number: build_number(hash, base_klass))
74
+ end
52
75
 
53
76
  attrs = {
54
77
  base: base,
@@ -49,18 +49,23 @@ module Pubid
49
49
  attribute :edition, :string # "2.0", "1.3", nil
50
50
  attribute :language, :string # "E", "F", "S", "C", "A", "R", nil
51
51
 
52
+ # The polymorphic _type → class table (one entry per line, the
53
+ # WMO style — the product-specification entry does not fit the
54
+ # padded-column alignment).
52
55
  IALA_TYPE_MAP = {
53
- "pubid:iala:standard" => "Pubid::Iala::Identifiers::Standard",
54
- "pubid:iala:recommendation" => "Pubid::Iala::Identifiers::Recommendation",
55
- "pubid:iala:guideline" => "Pubid::Iala::Identifiers::Guideline",
56
- "pubid:iala:manual" => "Pubid::Iala::Identifiers::Manual",
57
- "pubid:iala:model-course" => "Pubid::Iala::Identifiers::ModelCourse",
58
- "pubid:iala:general-assembly" => "Pubid::Iala::Identifiers::GeneralAssembly",
59
- "pubid:iala:letter" => "Pubid::Iala::Identifiers::Letter",
60
- "pubid:iala:annex" => "Pubid::Iala::Identifiers::Annex",
61
- "pubid:iala:report" => "Pubid::Iala::Identifiers::Report",
62
- "pubid:iala:resolution" => "Pubid::Iala::Identifiers::Resolution",
63
- "pubid:iala:publication" => "Pubid::Iala::Identifiers::Publication",
56
+ "pubid:iala:standard" => "Pubid::Iala::Identifiers::Standard",
57
+ "pubid:iala:product-specification" =>
58
+ "Pubid::Iala::Identifiers::ProductSpecification",
59
+ "pubid:iala:recommendation" => "Pubid::Iala::Identifiers::Recommendation",
60
+ "pubid:iala:guideline" => "Pubid::Iala::Identifiers::Guideline",
61
+ "pubid:iala:manual" => "Pubid::Iala::Identifiers::Manual",
62
+ "pubid:iala:model-course" => "Pubid::Iala::Identifiers::ModelCourse",
63
+ "pubid:iala:general-assembly" => "Pubid::Iala::Identifiers::GeneralAssembly",
64
+ "pubid:iala:letter" => "Pubid::Iala::Identifiers::Letter",
65
+ "pubid:iala:annex" => "Pubid::Iala::Identifiers::Annex",
66
+ "pubid:iala:report" => "Pubid::Iala::Identifiers::Report",
67
+ "pubid:iala:resolution" => "Pubid::Iala::Identifiers::Resolution",
68
+ "pubid:iala:publication" => "Pubid::Iala::Identifiers::Publication",
64
69
  }.freeze
65
70
 
66
71
  key_value do
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iala
5
+ module Identifiers
6
+ # IALA S-100-family product specifications — the S-201..S-299 range
7
+ # IHO granted IALA (iala.int, "IALA S-200 Product Specification and
8
+ # Development Status": "This range, which spans from S-201 to S-299,
9
+ # is compliant with the IHO S-100 standard"). The lexical form is
10
+ # hyphenated ("S-201"), unlike the legacy zero-padded S series
11
+ # (S1010); the edition is the S-100 dotted x.y.z on the bare face
12
+ # ("IALA S-201 2.0.0", the form iala.int cites). "Ed 2.0.0" and the
13
+ # compact ":ed2.0.0" parse as normalizing aliases.
14
+ #
15
+ # WMO publishes its own S-100 specifications in the same lexical
16
+ # shape ("S-411 1.2.1") — the hundreds digit is each org's grant:
17
+ # 2 is IALA's, so this class never captures another org's S-series
18
+ # (pubid#763's dual-perspective ruling: the lexical form leads no
19
+ # prefix; each org assigns its own identifier).
20
+ class ProductSpecification < Identifier
21
+ # No type letter: the "S" of "S-201" is part of the hyphenated
22
+ # code face, rendered by the Renderer/UrnGenerator directly. A
23
+ # short here would collide with Standard's "S" in the
24
+ # per-letter class table.
25
+ def self.type
26
+ { key: :product_specification, title: "Product Specification",
27
+ short: nil }
28
+ end
29
+
30
+ # The hyphenated S-number is a designation, not a publisher
31
+ # token: the canonical face is bare ("S-201 2.0.0", iala.int's
32
+ # own citation form), so there is no publisher prefix for
33
+ # with_publisher to cut (the WMO S-100 rule).
34
+ def publisher_prefixes
35
+ []
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -5,6 +5,8 @@ module Pubid
5
5
  module Identifiers
6
6
  autoload :Annex, "#{__dir__}/identifiers/annex"
7
7
  autoload :Standard, "#{__dir__}/identifiers/standard"
8
+ autoload :ProductSpecification,
9
+ "#{__dir__}/identifiers/product_specification"
8
10
  autoload :Recommendation, "#{__dir__}/identifiers/recommendation"
9
11
  autoload :Guideline, "#{__dir__}/identifiers/guideline"
10
12
  autoload :Manual, "#{__dir__}/identifiers/manual"
@@ -20,6 +20,7 @@ module Pubid
20
20
  type "pubid:iala:letter", "letter"
21
21
  type "pubid:iala:manual", "manual"
22
22
  type "pubid:iala:model-course", "mc"
23
+ type "pubid:iala:product-specification", "ps"
23
24
  type "pubid:iala:publication", "pub"
24
25
  type "pubid:iala:recommendation", "rec"
25
26
  type "pubid:iala:report", "rpt"
@@ -9,11 +9,13 @@ module Pubid
9
9
  # "IALA S1070 Ed 2.0"
10
10
  # "IALA R1016 Ed 2.0 (F)"
11
11
  # "IALA arctic-seminar-report (E)"
12
+ # "S-201 2.0.0" (the S-100-family bare designation face)
12
13
  class Renderer < ::Pubid::Renderers::Base
13
14
  def render(context: nil, **_opts)
14
15
  id = @id
15
16
 
16
17
  return render_annex(id) if id.is_a?(Identifiers::Annex)
18
+ return render_product_spec(id) if id.is_a?(Identifiers::ProductSpecification)
17
19
 
18
20
  # A codeless Publication has no type letter: "IALA <slug>".
19
21
  rendered = "#{id.publisher} #{id.type_letter}#{id.number}"
@@ -22,14 +24,30 @@ module Pubid
22
24
  rendered
23
25
  end
24
26
 
27
+ # The S-100-family face: the hyphenated designation and the bare
28
+ # dotted edition, no publisher token — the S-100 lexical law IALA's
29
+ # own S-201 citation form follows ("S-201 2.0.0"), the same
30
+ # designation-not-publisher rule as the WMO-published S-100 specs.
31
+ def render_product_spec(id)
32
+ rendered = "S-#{id.number}"
33
+ rendered << " #{id.edition}" if id.edition
34
+ rendered << " (#{id.language})" if id.language
35
+ rendered
36
+ end
37
+
25
38
  # Render an Annex wrapper. The base identifier is rendered first, then
26
39
  # the marker form is preserved verbatim ("Annex" vs "ANNEX"), then the
27
- # optional letter, edition, and language.
40
+ # optional letter, edition, and language. The edition face follows the
41
+ # base's family: bare for an S-100-family base, "Ed" for the legacy
42
+ # series.
28
43
  def render_annex(id)
29
44
  base_str = id.base.to_s
45
+ s100_base = id.base.is_a?(Identifiers::ProductSpecification)
30
46
  rendered = "#{base_str} #{id.annex_form}"
31
47
  rendered << " #{id.letter}" if id.letter
32
- rendered << " Ed #{id.edition}" if id.edition
48
+ if id.edition
49
+ rendered << (s100_base ? " #{id.edition}" : " Ed #{id.edition}")
50
+ end
33
51
  rendered << " (#{id.language})" if id.language
34
52
  rendered
35
53
  end