pubid 2.0.54 → 2.0.55
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.
- checksums.yaml +4 -4
- data/data/parg/iho.json +1 -1
- data/data/parg/iho.parg +9 -9
- data/lib/pubid/adobe/urn.adoc +28 -0
- data/lib/pubid/amca/urn.adoc +29 -0
- data/lib/pubid/ansi/urn.adoc +45 -0
- data/lib/pubid/api/urn.adoc +34 -0
- data/lib/pubid/arxiv/urn.adoc +25 -0
- data/lib/pubid/ashrae/urn.adoc +33 -0
- data/lib/pubid/asme/urn.adoc +26 -0
- data/lib/pubid/astm/urn.adoc +52 -0
- data/lib/pubid/bipm/urn.adoc +72 -0
- data/lib/pubid/bsi/urn.adoc +79 -0
- data/lib/pubid/bsi_pfs/urn.adoc +20 -0
- data/lib/pubid/calconnect/urn.adoc +26 -0
- data/lib/pubid/calconnect_pfs/urn.adoc +15 -0
- data/lib/pubid/ccsds/urn.adoc +28 -0
- data/lib/pubid/cen_cenelec/urn.adoc +68 -0
- data/lib/pubid/cen_pfs/urn.adoc +18 -0
- data/lib/pubid/cie/urn.adoc +44 -0
- data/lib/pubid/csa/urn.adoc +53 -0
- data/lib/pubid/doi/urn.adoc +27 -0
- data/lib/pubid/doi_pfs/urn.adoc +26 -0
- data/lib/pubid/easc/urn.adoc +28 -0
- data/lib/pubid/ecma/urn.adoc +29 -0
- data/lib/pubid/etsi/urn.adoc +49 -0
- data/lib/pubid/etsi_pfs/urn.adoc +31 -0
- data/lib/pubid/eu/urn.adoc +28 -0
- data/lib/pubid/evs/urn.adoc +44 -0
- data/lib/pubid/gb/urn.adoc +30 -0
- data/lib/pubid/gost/urn.adoc +64 -0
- data/lib/pubid/iana/urn.adoc +27 -0
- data/lib/pubid/idf/urn.adoc +33 -0
- data/lib/pubid/iec/urn.adoc +78 -0
- data/lib/pubid/ieee/urn.adoc +128 -0
- data/lib/pubid/ietf/urn.adoc +31 -0
- data/lib/pubid/iho/CLAUDE.md +8 -8
- data/lib/pubid/iho/builder.rb +15 -15
- data/lib/pubid/iho/identifiers/base.rb +6 -6
- data/lib/pubid/iho/pubid_urn_schema.rb +5 -5
- data/lib/pubid/iho/renderer.rb +3 -3
- data/lib/pubid/iho/urn.adoc +7 -7
- data/lib/pubid/iho/urn_generator.rb +2 -2
- data/lib/pubid/iho/urn_parser.rb +6 -6
- data/lib/pubid/isbn/urn.adoc +26 -0
- data/lib/pubid/iso/urn.adoc +58 -0
- data/lib/pubid/itu/urn.adoc +90 -0
- data/lib/pubid/jcgm/urn.adoc +33 -0
- data/lib/pubid/jis/urn.adoc +35 -0
- data/lib/pubid/nist/urn.adoc +99 -0
- data/lib/pubid/oasis/urn.adoc +27 -0
- data/lib/pubid/ogc/urn.adoc +26 -0
- data/lib/pubid/oiml/urn.adoc +43 -0
- data/lib/pubid/omg/urn.adoc +27 -0
- data/lib/pubid/plateau/urn.adoc +43 -0
- data/lib/pubid/sae/urn.adoc +24 -0
- data/lib/pubid/tgpp/urn.adoc +28 -0
- data/lib/pubid/un/urn.adoc +27 -0
- data/lib/pubid/version.rb +1 -1
- data/lib/pubid/w3c/urn.adoc +37 -0
- data/lib/pubid/wmo/urn.adoc +28 -0
- data/lib/pubid/xsf/urn.adoc +25 -0
- metadata +57 -4
data/lib/pubid/iho/builder.rb
CHANGED
|
@@ -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,
|
|
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
|
-
# `
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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["
|
|
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["
|
|
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
|
|
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
|
|
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[:
|
|
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[:
|
|
168
|
-
attrs[:
|
|
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
|
|
181
|
-
"device: #{type}-#{attrs[:number]}:#{attrs[:
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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
|
|
@@ -139,7 +139,7 @@ module Pubid
|
|
|
139
139
|
key_value do
|
|
140
140
|
map "_type", to: :_type, polymorphic_map: IHO_TYPE_MAP
|
|
141
141
|
map "number", to: :number
|
|
142
|
-
map "
|
|
142
|
+
map "product", to: :product
|
|
143
143
|
map "edition", to: :edition
|
|
144
144
|
map "year", to: :year
|
|
145
145
|
map "supplement", to: :supplement
|
|
@@ -170,7 +170,7 @@ module Pubid
|
|
|
170
170
|
# The deserialization path applies the same S-158 alias
|
|
171
171
|
# unification the parse path applies (Builder.normalize_checks_alias):
|
|
172
172
|
# 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
|
|
173
|
+
# (part: "S-102", part_edition: "0.2.0") decodes to the product
|
|
174
174
|
# identity (issue #774), so no construction path yields the
|
|
175
175
|
# two-identity disease of issue #775.
|
|
176
176
|
def self.from_hash(data, options = {})
|
|
@@ -265,7 +265,7 @@ module Pubid
|
|
|
265
265
|
def base_code
|
|
266
266
|
code = +"#{self.class.type[:short]}-#{number}"
|
|
267
267
|
# the S-158 member designator rides the code (the colon form)
|
|
268
|
-
code << ":#{
|
|
268
|
+
code << ":#{product}" if product
|
|
269
269
|
code
|
|
270
270
|
end
|
|
271
271
|
|
|
@@ -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:
|
|
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
|
|
15
|
-
# component is the series member itself — `
|
|
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:
|
|
31
|
-
atom "
|
|
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"
|
data/lib/pubid/iho/renderer.rb
CHANGED
|
@@ -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.
|
|
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 (`
|
|
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.
|
|
91
|
+
return id.product_face if component == :part && id.product_face
|
|
92
92
|
|
|
93
93
|
id.public_send(component)
|
|
94
94
|
end
|
data/lib/pubid/iho/urn.adoc
CHANGED
|
@@ -53,7 +53,7 @@ series the guidance types:
|
|
|
53
53
|
|
|
54
54
|
S-158 is a framework publication defining a series of separate check
|
|
55
55
|
specifications (`S-158:100` generic, `S-158:1xx` product-specific,
|
|
56
|
-
`S-158:98` interoperability, `S-158:128` catalogue; the `
|
|
56
|
+
`S-158:98` interoperability, `S-158:128` catalogue; the `product`
|
|
57
57
|
component carries the member number). The member joins the name segment
|
|
58
58
|
hyphenated — the documented fleet extension of the guidance for
|
|
59
59
|
compound publication numbers — so the edition stays in its canonical
|
|
@@ -132,7 +132,7 @@ emission of the B/C series (no guidance type code). Its laws:
|
|
|
132
132
|
|
|
133
133
|
Both decode paths build through `Builder.build` — the S-158 alias
|
|
134
134
|
unification (a draft-era `part-S-102` URN resolves to the
|
|
135
|
-
`
|
|
135
|
+
`product` identity) and every other semantic validation is shared
|
|
136
136
|
with the text parse.
|
|
137
137
|
|
|
138
138
|
== The pubid-scheme URN (`urn:pubid:iho:`)
|
|
@@ -143,21 +143,21 @@ pubid's own lossless codec (issue #670;
|
|
|
143
143
|
(`Pubid.parse_urn(id.to_pubid_urn).to_hash == id.to_hash`).
|
|
144
144
|
|
|
145
145
|
urn:pubid:iho:std:100:ed-5.0.0:year-2024:part-2 IHO S-100 5.0.0 Part 2 (2024)
|
|
146
|
-
urn:pubid:iho:std:158:
|
|
146
|
+
urn:pubid:iho:std:158:product-102:ed-1.0.0 IHO S-158:102 1.0.0
|
|
147
147
|
urn:pubid:iho:std:122:ed-1.0.0:appendix-D:appsub-2 IHO S-122 1.0.0 Appendix D-2
|
|
148
148
|
urn:pubid:iho:pub:5:vol-2024 IHO P-5 Vol. 2024
|
|
149
149
|
|
|
150
150
|
Types: `std` (S), `pub` (P), `m` (M), `b` (B), `cl` (C), `id`.
|
|
151
|
-
Atoms, canonical order: `
|
|
151
|
+
Atoms, canonical order: `product-` (the S-158 member, riding the
|
|
152
152
|
document code before the edition — issue #774), `ed-`, `year-`,
|
|
153
153
|
`sup-`/`suped-`/`supyear-`, `part-`/`parted-`/`party-`, `spec-`/
|
|
154
154
|
`specsub-`/`specvar-`, `annex-`/`anned-`/`annyear-`, `appendix-`/
|
|
155
155
|
`appsub-`/`apped-`/`appyear-`, `vol-`/`issue-`/`voled-`/`voly-`. Case
|
|
156
156
|
is preserved (`part-A`); the yearbook year is a volume (`vol-2024`, no
|
|
157
|
-
`year-` value). The S-158 member emits the typed `
|
|
157
|
+
`year-` value). The S-158 member emits the typed `product-<NNN>` atom —
|
|
158
158
|
the draft-era part-faceted emission (`part-S-102`, `parted-`) is dead:
|
|
159
159
|
the `from_hash` unification redirects the legacy form onto the
|
|
160
|
-
`
|
|
160
|
+
`product` identity, so the legacy URN fails the canonical gate.
|
|
161
161
|
|
|
162
162
|
== relaton-side follow-ups (not this repo)
|
|
163
163
|
|
|
@@ -166,4 +166,4 @@ the S-158 member shape changed (`s158-102`, not `s:158:100` or the
|
|
|
166
166
|
part form): relaton-data-iho needs a re-crawl when this gem ships, and
|
|
167
167
|
the frozen testsuite corpus rows are re-frozen in the coupled corpus
|
|
168
168
|
round. The pubid-scheme slugs changed for S-158 identities
|
|
169
|
-
(`iho/std/158/
|
|
169
|
+
(`iho/std/158/product-102/...`).
|
|
@@ -89,7 +89,7 @@ module Pubid
|
|
|
89
89
|
# The guidance-form trailing atoms in containment order — the same
|
|
90
90
|
# order the legacy scheme prints them. The Appendix subnumber is
|
|
91
91
|
# handled inline (it hyphen-joins its appendix, one compound
|
|
92
|
-
# segment); the
|
|
92
|
+
# segment); the product member rides the name segment.
|
|
93
93
|
MRN_SEGMENTS = [
|
|
94
94
|
[:year, "year"],
|
|
95
95
|
[:supplement, "sup"], [:supplement_edition, "ed"],
|
|
@@ -149,7 +149,7 @@ module Pubid
|
|
|
149
149
|
# canonical 4th position: s158-102.
|
|
150
150
|
def mrn_name
|
|
151
151
|
name = +"#{identifier.class.type[:short].downcase}#{identifier.number}"
|
|
152
|
-
name << "-#{identifier.
|
|
152
|
+
name << "-#{identifier.product}" if identifier.product
|
|
153
153
|
name
|
|
154
154
|
end
|
|
155
155
|
|
data/lib/pubid/iho/urn_parser.rb
CHANGED
|
@@ -33,7 +33,7 @@ module Pubid
|
|
|
33
33
|
#
|
|
34
34
|
# Segment discipline (mirrors the ISO URN parser's strictness):
|
|
35
35
|
# - the docnumber occupies the first bare number segment; a further
|
|
36
|
-
# bare digit segment binds
|
|
36
|
+
# bare digit segment binds product — the S-158 member number as
|
|
37
37
|
# its own segment ("urn:iho:s:158:100"), never glued into the
|
|
38
38
|
# number (issue #774);
|
|
39
39
|
# - every other component is a marker-prefixed segment validated
|
|
@@ -58,7 +58,7 @@ module Pubid
|
|
|
58
58
|
# which decodes into the two components).
|
|
59
59
|
#
|
|
60
60
|
# Both paths build through Builder.build — the S-158 alias
|
|
61
|
-
# unification (a draft-era part-S-102 URN decodes to the
|
|
61
|
+
# unification (a draft-era part-S-102 URN decodes to the product
|
|
62
62
|
# identity) and every other semantic validation is shared with the
|
|
63
63
|
# text parse.
|
|
64
64
|
#
|
|
@@ -187,7 +187,7 @@ module Pubid
|
|
|
187
187
|
attrs = { number: match[2] }
|
|
188
188
|
# the member designator rides the S-158 anchor; another series
|
|
189
189
|
# rejects through the builder's anchor assert
|
|
190
|
-
attrs[:
|
|
190
|
+
attrs[:product] = match[3] if match[3]
|
|
191
191
|
attrs
|
|
192
192
|
end
|
|
193
193
|
|
|
@@ -215,7 +215,7 @@ module Pubid
|
|
|
215
215
|
# part-S-102 decode renders the canonical colon designator.
|
|
216
216
|
def build_identifier(hash, urn)
|
|
217
217
|
identifier = Builder.build(hash)
|
|
218
|
-
identifier.
|
|
218
|
+
identifier.product_face = nil
|
|
219
219
|
identifier
|
|
220
220
|
rescue ArgumentError => e
|
|
221
221
|
raise Pubid::Errors::UrnParseError,
|
|
@@ -237,7 +237,7 @@ module Pubid
|
|
|
237
237
|
end
|
|
238
238
|
|
|
239
239
|
# The first bare number segment is the docnumber; the next bare
|
|
240
|
-
# digit segment binds the S-158 member number (
|
|
240
|
+
# digit segment binds the S-158 member number (product — the
|
|
241
241
|
# member as its own segment, never glued into the number), and
|
|
242
242
|
# anything else ends the number run (the segment loop below
|
|
243
243
|
# decides whether it is a legal marker).
|
|
@@ -250,7 +250,7 @@ module Pubid
|
|
|
250
250
|
|
|
251
251
|
attrs = { number: number }
|
|
252
252
|
if segments.first&.match?(CHECKS_SEGMENT_RE)
|
|
253
|
-
attrs[:
|
|
253
|
+
attrs[:product] = segments.shift
|
|
254
254
|
end
|
|
255
255
|
attrs
|
|
256
256
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[[urn-isbn]]
|
|
2
|
+
= ISBN URN schemes
|
|
3
|
+
|
|
4
|
+
This file is the single home of the ISBN (`isbn`) 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:isbn:` (the `_type` flavor segment).
|
|
11
|
+
|
|
12
|
+
Official URN: `urn:isbn:…`, IANA-registered (formal template `isbn`).
|
|
13
|
+
|
|
14
|
+
Current `to_urn` (≤400 sampled pass ids): 4 ids, 0 round-trip, 0 reshape, 4 do not re-parse, 0 raise, 0 empty, 1 colliding URNs.
|
|
15
|
+
Corpus: 4 of 4 pass ids parse.
|
|
16
|
+
|
|
17
|
+
[cols="3,1,1,1,4",options="header"]
|
|
18
|
+
|===
|
|
19
|
+
| `_type` | token | core | ids | example
|
|
20
|
+
| `pubid:isbn:book` | `book` | — | 4 | `ISBN 0-306-40615-2`
|
|
21
|
+
| `pubid:isbn:identifier` | `id` | — | 0 | —
|
|
22
|
+
|===
|
|
23
|
+
|
|
24
|
+
Atoms, canonical order: `hyphenated-` (`hyphenated`), `raw-` (`raw`).
|
|
25
|
+
|
|
26
|
+
Landed (issue #670) as drafted, with no core: both spellings are optional atoms. All 4 corpus rows emit.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[[urn-iso]]
|
|
2
|
+
= ISO URN schemes
|
|
3
|
+
|
|
4
|
+
This file is the single home of the ISO (`iso`) 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:iso:`. Schema: `lib/pubid/iso/pubid_urn_schema.rb`.
|
|
11
|
+
|
|
12
|
+
Official URN: `urn:iso:std:…`, IANA-registered, RFC 5141. Current `to_urn`:
|
|
13
|
+
400 ids, 72 round-trip, 326 reshape, 2 do not re-parse, 8 colliding URNs.
|
|
14
|
+
|
|
15
|
+
pubid scheme: all 7,647 pass ids emit, round-trip by `to_hash`, are
|
|
16
|
+
path-safe, and give no collision.
|
|
17
|
+
|
|
18
|
+
[cols="3,1",options="header"]
|
|
19
|
+
|===
|
|
20
|
+
| `_type` | token
|
|
21
|
+
| `pubid:iso:international-standard` | `is`
|
|
22
|
+
| `pubid:iso:technical-report` | `tr`
|
|
23
|
+
| `pubid:iso:technical-specification` | `ts`
|
|
24
|
+
| `pubid:iso:guide` | `guide`
|
|
25
|
+
| `pubid:iso:pas` | `pas`
|
|
26
|
+
| `pubid:iso:recommendation` | `r`
|
|
27
|
+
| `pubid:iso:international-standardized-profile` | `isp`
|
|
28
|
+
| `pubid:iso:international-workshop-agreement` | `iwa`
|
|
29
|
+
| `pubid:iso:technology-trends-assessments` | `tta`
|
|
30
|
+
| `pubid:iso:data` | `data`
|
|
31
|
+
| `pubid:iso:tc-document` | `tcdoc`
|
|
32
|
+
| `pubid:iso:directives` | `dir`
|
|
33
|
+
| `pubid:iso:directives-supplement` | `dirsup`
|
|
34
|
+
| `pubid:iso:amendment` | `amd`
|
|
35
|
+
| `pubid:iso:corrigendum` | `cor`
|
|
36
|
+
| `pubid:iso:addendum` | `add`
|
|
37
|
+
| `pubid:iso:extract` | `ext`
|
|
38
|
+
| `pubid:iso:supplement` | `sup`
|
|
39
|
+
| `pubid:iso:all-parts` | `all`
|
|
40
|
+
| `pubid:iso:bundled-identifier` | `bundle`
|
|
41
|
+
|===
|
|
42
|
+
|
|
43
|
+
Core: `number`. Atoms, canonical order: `pub-`, `co-` (list), `part-`,
|
|
44
|
+
`subpart-`, `year-`, `month-`, `day-`, `undated-` (bool), `ed-`
|
|
45
|
+
(`edition.number`), `stage-`, `iter-` (`stage_iteration`), `v-`
|
|
46
|
+
(`supplement_version`), `lang-` (`languages.*.code`, list), `loc-`;
|
|
47
|
+
`tcdoc` adds `tctype-`, `tc-`, `sctype-`, `sc-`, `wgtype-`, `wg-`; `dir`
|
|
48
|
+
adds `subgroup-`; `all` adds `ids-(…)`; `bundle` adds `sups-(…)`. Facets:
|
|
49
|
+
`langsrc` (`languages.*.original_code`), `edsrc` (`edition.original_text`).
|
|
50
|
+
|
|
51
|
+
----
|
|
52
|
+
ISO 9001 urn:pubid:iso:is:9001
|
|
53
|
+
ISO/IEC/IEEE 8802-3:2021 urn:pubid:iso:is:8802:co-IEC,IEEE:part-3:year-2021
|
|
54
|
+
ISO/DIS 9001 urn:pubid:iso:is:9001:stage-dis
|
|
55
|
+
ISO 9001:2015(E) urn:pubid:iso:is:9001:year-2015:lang-en:f:0.langsrc-E
|
|
56
|
+
ISO 9001:2015/Amd 1:2016/Cor 1:2017 urn:pubid:iso:is:9001:year-2015:amd:1:year-2016:cor:1:year-2017
|
|
57
|
+
ISO 9001 (all parts) urn:pubid:iso:all:ids-(iso:is:9001)
|
|
58
|
+
----
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[[urn-itu]]
|
|
2
|
+
= ITU URN schemes
|
|
3
|
+
|
|
4
|
+
This file is the single home of the ITU (`itu`) 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:itu:`. Schema: `lib/pubid/itu/pubid_urn_schema.rb`.
|
|
11
|
+
|
|
12
|
+
Official URN: `urn:itu:…`, IANA-registered (formal template `itu`). Current
|
|
13
|
+
`to_urn`: 400 ids, 299 round-trip, 84 reshape, 17 do not re-parse, 0
|
|
14
|
+
colliding URNs.
|
|
15
|
+
|
|
16
|
+
pubid scheme: all 2,758 pass ids emit, round-trip by `to_hash`, are
|
|
17
|
+
path-safe, and give 2,756 distinct URNs. The two shared URNs are not
|
|
18
|
+
collisions: `ITU-T OB.1096` and `ITU OB No. 1096` (with and without a date)
|
|
19
|
+
are one document each since #696. The longest URN is 160 characters.
|
|
20
|
+
|
|
21
|
+
[cols="3,1",options="header"]
|
|
22
|
+
|===
|
|
23
|
+
| `_type` | token
|
|
24
|
+
| `pubid:itu:recommendation` | `rec`
|
|
25
|
+
| `pubid:itu:report` | `rpt`
|
|
26
|
+
| `pubid:itu:resolution` | `res`
|
|
27
|
+
| `pubid:itu:combined-identifier` | `comb`
|
|
28
|
+
| `pubid:itu:question` | `q`
|
|
29
|
+
| `pubid:itu:handbook` | `hb`
|
|
30
|
+
| `pubid:itu:radio-regulations` | `rr`
|
|
31
|
+
| `pubid:itu:special-publication` | `sp`
|
|
32
|
+
| `pubid:itu:contribution` | `c`
|
|
33
|
+
| `pubid:itu:identifier` | `id`
|
|
34
|
+
| `pubid:itu:annex` | `annex`
|
|
35
|
+
| `pubid:itu:annex-of-recommendation` | `anx`
|
|
36
|
+
| `pubid:itu:appendix-of-recommendation` | `app`
|
|
37
|
+
| `pubid:itu:supplement` | `sup`
|
|
38
|
+
| `pubid:itu:amendment` | `amd`
|
|
39
|
+
| `pubid:itu:corrigendum` | `cor`
|
|
40
|
+
| `pubid:itu:addendum` | `add`
|
|
41
|
+
| `pubid:itu:errata` | `err`
|
|
42
|
+
|===
|
|
43
|
+
|
|
44
|
+
Core: `number` (of a supplement, its ordinal). Atoms, in the schema order:
|
|
45
|
+
`sector-`, `series-`, `seriesword-` and `seriesdash-` (bool), `imp-`
|
|
46
|
+
(`imp_marker`, the `Imp` of an implementer's guide), `subseries-`,
|
|
47
|
+
`part-` (`parts`, list), `suffix-` (`series_suffix`), `qualifier-`,
|
|
48
|
+
`rangeend-`, `attachment-` (bool), the second designations of a joint
|
|
49
|
+
Recommendation (`combseries-`, `combnumber-`, `combsubseries-`,
|
|
50
|
+
`combsuffix-`, `combqualifier-`, lists over `combined.*`), the Question
|
|
51
|
+
values `sg-` (`study_group`), `bl-`, `bracketed-` and `colon-` (bool),
|
|
52
|
+
`technical-` (bool), `material-`, `v-` (`version`), `year-`, `month-`,
|
|
53
|
+
`day-`, `lang-` (`language`), `twin-(…)` (`common_text_twin`, the nested
|
|
54
|
+
ISO/IEC id of `ITU-T H.222.0 (2021) | ISO/IEC 13818-1:2022`, with the ISO
|
|
55
|
+
schema). Facets (bool): `suffixspaced`,
|
|
56
|
+
`qualifierglued`, `combsuffixspaced` and `combqualifierglued` (lists),
|
|
57
|
+
`numberglued`, `slashjoined`.
|
|
58
|
+
|
|
59
|
+
----
|
|
60
|
+
ITU-T G.729 Annex B (1996) Cor. 3 (03/2001) urn:pubid:itu:rec:729:sector-T:series-G:anx:B:year-1996:cor:3:year-2001:month-03
|
|
61
|
+
ITU-T H.264 (V14) (08/2021) urn:pubid:itu:rec:264:sector-T:series-H:v-14:year-2021:month-08
|
|
62
|
+
Report ITU-R BT.2020-1 urn:pubid:itu:rpt:2020:sector-R:series-BT:part-1
|
|
63
|
+
ITU-T D.81/F.80 bis (11/1980) urn:pubid:itu:comb:81:sector-T:series-D:combseries-F:combnumber-80:combsuffix-bis:year-1980:month-11:f:0.combsuffixspaced-true
|
|
64
|
+
ITU-R 37-7/5: urn:pubid:itu:q:37:sector-R:part-7:sg-5:colon-true
|
|
65
|
+
ITU-T E Suppl.1 urn:pubid:itu:sup:1:sector-T:series-E:f:0.numberglued-true
|
|
66
|
+
----
|
|
67
|
+
|
|
68
|
+
Rulings of this wave:
|
|
69
|
+
|
|
70
|
+
* *Facets are the flags that the ITU classes call rendering-only*: the same
|
|
71
|
+
document printed two ways (`Suppl.1`/`Suppl. 1`, `V.25 ter`/`V.25ter`,
|
|
72
|
+
`D.502R`/`D.502 R`, `Amd. 1/Cor. 1`/`Amd. 1 Cor. 1`). Each is a boolean,
|
|
73
|
+
so the codec has boolean facets now (`kind: :bool`, and `:bools` for a
|
|
74
|
+
list, see <<../../../docs/URN-SCHEMES.adoc#rules-kinds,kinds>>). Every other flag is an atom, because it names a
|
|
75
|
+
different document: `Technical Cor.`, `attachment`, the word `series`, a
|
|
76
|
+
series code joined by a dash. The Question flags `/BL`, the brackets and
|
|
77
|
+
the trailing `:` are atoms too: the design proposal had them as facets,
|
|
78
|
+
but nothing in the ITU code says that they are spelling only.
|
|
79
|
+
* *The supplement chain is the `base` chain.* Supplements, annexes and
|
|
80
|
+
appendixes all name their parent `base`, so they share the slug prefix of
|
|
81
|
+
the Recommendation.
|
|
82
|
+
* *Not placed:* the `parts` of a second designation (`G.780/Y.1351-2`) is
|
|
83
|
+
a list inside a list, which the codec cannot write, so `#to_pubid_urn`
|
|
84
|
+
raises for it (pinned). No pass fixture has one. Neither are the shared
|
|
85
|
+
attributes of `Pubid::Identifier` that no ITU builder sets (`date`,
|
|
86
|
+
`languages`, `stage` …).
|
|
87
|
+
* *Coverage beyond the pass fixtures.* Every `full/` input and every
|
|
88
|
+
`parse("…")` literal of the ITU specs that parses also round-trips.
|
|
89
|
+
* *Cutting the facets merges nothing:* 2,752 slugs without the `f` group, 0
|
|
90
|
+
shared.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[[urn-jcgm]]
|
|
2
|
+
= JCGM URN schemes
|
|
3
|
+
|
|
4
|
+
This file is the single home of the JCGM (`jcgm`) 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:jcgm:` (the `_type` flavor segment).
|
|
11
|
+
|
|
12
|
+
Official URN: none. The organization has no namespace in the IANA registry, and the current `urn:jcgm:…` form of `to_urn` is pubid-invented (legacy, no round-trip promise).
|
|
13
|
+
|
|
14
|
+
Current `to_urn` (≤400 sampled pass ids): 31 ids, 29 round-trip, 2 reshape, 0 do not re-parse, 0 raise, 0 empty, 0 colliding URNs.
|
|
15
|
+
|
|
16
|
+
Corpus: 31 of 31 pass ids parse.
|
|
17
|
+
|
|
18
|
+
[cols="3,1,1,1,4",options="header"]
|
|
19
|
+
|===
|
|
20
|
+
| `_type` | token | core | ids | example
|
|
21
|
+
| `pubid:jcgm:amendment` | `amd` | number | 3 | `JCGM 100:2008/Amd 1`
|
|
22
|
+
| `pubid:jcgm:corrigendum` | `cor` | number | 2 | `JCGM 200:2008 Corrigendum`
|
|
23
|
+
| `pubid:jcgm:guide` | `guide` | number | 13 | `JCGM 100`
|
|
24
|
+
| `pubid:jcgm:gum-guide` | `gumguide` | number | 2 | `JCGM GUM-1:2022-11-28`
|
|
25
|
+
| `pubid:jcgm:identifier` | `id` | number | 0 | —
|
|
26
|
+
| `pubid:jcgm:meeting` | `meeting` | number | 16 | `JCGM 11st Meeting (2006)`
|
|
27
|
+
|===
|
|
28
|
+
|
|
29
|
+
Atoms, canonical order: `year-` (`year`), `month-` (`month`), `day-` (`day`), `lang-` (`languages.*.code`, list).
|
|
30
|
+
|
|
31
|
+
Landed (issue #670) as drafted. All 31 corpus rows emit.
|
|
32
|
+
|
|
33
|
+
Facet candidates (spelling-only): `languages.*.original_code`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[[urn-jis]]
|
|
2
|
+
= JIS URN schemes
|
|
3
|
+
|
|
4
|
+
This file is the single home of the JIS (`jis`) 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:jis:` (the `_type` flavor segment).
|
|
11
|
+
|
|
12
|
+
Official URN: none. The organization has no namespace in the IANA registry, and the current `urn:jis:…` form of `to_urn` is pubid-invented (legacy, no round-trip promise).
|
|
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: 10561 of 10561 pass ids parse.
|
|
17
|
+
|
|
18
|
+
[cols="3,1,1,1,4",options="header"]
|
|
19
|
+
|===
|
|
20
|
+
| `_type` | token | core | ids | example
|
|
21
|
+
| `pubid:jis:all-parts` | `all` | number | 0 | —
|
|
22
|
+
| `pubid:jis:amendment` | `amd` | number | 0 | —
|
|
23
|
+
| `pubid:jis:corrigendum` | `cor` | number | 0 | —
|
|
24
|
+
| `pubid:jis:explanation` | `e` | number | 0 | —
|
|
25
|
+
| `pubid:jis:identifier` | `id` | number | 0 | —
|
|
26
|
+
| `pubid:jis:japanese-industrial-standard` | `jis` | number | 10556 | `JIS A 0001:1999`
|
|
27
|
+
| `pubid:jis:standard` | `std` | number | 0 | —
|
|
28
|
+
| `pubid:jis:technical-report` | `tr` | number | 0 | —
|
|
29
|
+
| `pubid:jis:technical-specification` | `ts` | number | 0 | —
|
|
30
|
+
| `pubid:jis:welding-engineering-standard` | `wes` | number | 5 | `WES 7700-1:2019`
|
|
31
|
+
|===
|
|
32
|
+
|
|
33
|
+
Atoms, canonical order: `series-` (`series`), `part-` (`parts`, list), `year-` (`year`, int), `reaffirmed-` (`reaffirmed`, bool).
|
|
34
|
+
|
|
35
|
+
Landed (issue #670) as drafted; the year is an int atom (`year-1999`) and the zero-padded printed number stays the core (`jis:0001`). All 10,561 corpus rows emit.
|