pubid 2.0.9 → 2.0.11

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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pubid/adobe/pubid_urn_schema.rb +21 -0
  3. data/lib/pubid/adobe.rb +1 -0
  4. data/lib/pubid/amca/pubid_urn_schema.rb +25 -0
  5. data/lib/pubid/amca.rb +1 -0
  6. data/lib/pubid/bipm/CLAUDE.md +9 -0
  7. data/lib/pubid/bipm/pubid_urn_schema.rb +42 -0
  8. data/lib/pubid/bipm.rb +1 -0
  9. data/lib/pubid/bsi/CLAUDE.md +13 -0
  10. data/lib/pubid/bsi/pubid_urn_schema.rb +114 -0
  11. data/lib/pubid/bsi.rb +1 -0
  12. data/lib/pubid/calconnect/pubid_urn_schema.rb +20 -0
  13. data/lib/pubid/calconnect.rb +1 -0
  14. data/lib/pubid/ccsds/pubid_urn_schema.rb +22 -0
  15. data/lib/pubid/ccsds.rb +1 -0
  16. data/lib/pubid/cen_cenelec/CLAUDE.md +11 -0
  17. data/lib/pubid/cen_cenelec/pubid_urn_schema.rb +26 -8
  18. data/lib/pubid/cie/CLAUDE.md +9 -0
  19. data/lib/pubid/cie/pubid_urn_schema.rb +51 -0
  20. data/lib/pubid/cie.rb +1 -0
  21. data/lib/pubid/csa/CLAUDE.md +12 -0
  22. data/lib/pubid/csa/pubid_urn_schema.rb +58 -0
  23. data/lib/pubid/csa.rb +1 -0
  24. data/lib/pubid/doi/pubid_urn_schema.rb +19 -0
  25. data/lib/pubid/doi.rb +1 -0
  26. data/lib/pubid/easc/pubid_urn_schema.rb +20 -0
  27. data/lib/pubid/easc.rb +1 -0
  28. data/lib/pubid/ecma/pubid_urn_schema.rb +21 -0
  29. data/lib/pubid/ecma.rb +1 -0
  30. data/lib/pubid/evs/CLAUDE.md +10 -0
  31. data/lib/pubid/evs/pubid_urn_schema.rb +35 -0
  32. data/lib/pubid/evs.rb +1 -0
  33. data/lib/pubid/format_registry.rb +5 -1
  34. data/lib/pubid/gb/pubid_urn_schema.rb +23 -0
  35. data/lib/pubid/gb.rb +1 -0
  36. data/lib/pubid/iala/pubid_urn_schema.rb +30 -0
  37. data/lib/pubid/iala.rb +1 -0
  38. data/lib/pubid/iana/pubid_urn_schema.rb +17 -0
  39. data/lib/pubid/iana.rb +1 -0
  40. data/lib/pubid/idf/pubid_urn_schema.rb +44 -0
  41. data/lib/pubid/idf.rb +1 -0
  42. data/lib/pubid/iec/CLAUDE.md +13 -0
  43. data/lib/pubid/iec/pubid_urn_schema.rb +46 -8
  44. data/lib/pubid/ietf/pubid_urn_schema.rb +24 -0
  45. data/lib/pubid/ietf.rb +1 -0
  46. data/lib/pubid/iho/CLAUDE.md +11 -0
  47. data/lib/pubid/iho/pubid_urn_schema.rb +49 -0
  48. data/lib/pubid/iho.rb +1 -0
  49. data/lib/pubid/isbn/pubid_urn_schema.rb +20 -0
  50. data/lib/pubid/isbn.rb +1 -0
  51. data/lib/pubid/jis/pubid_urn_schema.rb +29 -0
  52. data/lib/pubid/jis.rb +1 -0
  53. data/lib/pubid/oasis/pubid_urn_schema.rb +21 -0
  54. data/lib/pubid/oasis.rb +1 -0
  55. data/lib/pubid/ogc/pubid_urn_schema.rb +18 -0
  56. data/lib/pubid/ogc.rb +1 -0
  57. data/lib/pubid/omg/pubid_urn_schema.rb +21 -0
  58. data/lib/pubid/omg.rb +1 -0
  59. data/lib/pubid/sae/pubid_urn_schema.rb +23 -0
  60. data/lib/pubid/sae.rb +1 -0
  61. data/lib/pubid/tgpp/pubid_urn_schema.rb +23 -0
  62. data/lib/pubid/tgpp.rb +1 -0
  63. data/lib/pubid/un/pubid_urn_schema.rb +19 -0
  64. data/lib/pubid/un.rb +1 -0
  65. data/lib/pubid/version.rb +1 -1
  66. data/lib/pubid/w3c/pubid_urn_schema.rb +27 -0
  67. data/lib/pubid/w3c.rb +1 -0
  68. data/lib/pubid/xsf/pubid_urn_schema.rb +14 -0
  69. data/lib/pubid/xsf.rb +1 -0
  70. data/lib/pubid.rb +28 -2
  71. metadata +29 -1
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Easc
5
+ # The pubid-scheme URN of easc (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("easc") do
10
+ atom "series", "series"
11
+ atom "year", "year"
12
+ atom "variant", "variant"
13
+
14
+
15
+ type "pubid:easc:identifier", "id"
16
+ type "pubid:easc:pmg", "pmg"
17
+ type "pubid:easc:rmg", "rmg"
18
+ end
19
+ end
20
+ end
data/lib/pubid/easc.rb CHANGED
@@ -18,6 +18,7 @@ module Pubid
18
18
  autoload :Renderer, "#{__dir__}/easc/renderer"
19
19
  autoload :UrnGenerator, "#{__dir__}/easc/urn_generator"
20
20
  autoload :UrnParser, "#{__dir__}/easc/urn_parser"
21
+ autoload :PubidUrnSchema, "#{__dir__}/easc/pubid_urn_schema"
21
22
 
22
23
  # @param identifier [String]
23
24
  # @return [Pubid::Easc::Identifier]
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Ecma
5
+ # The pubid-scheme URN of ecma (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("ecma") do
10
+ atom "part", "part"
11
+ atom "volume", "vol"
12
+ atom "edition", "ed"
13
+
14
+
15
+ type "pubid:ecma:identifier", "id"
16
+ type "pubid:ecma:memento", "memento"
17
+ type "pubid:ecma:standard", "std"
18
+ type "pubid:ecma:technical-report", "tr"
19
+ end
20
+ end
21
+ end
data/lib/pubid/ecma.rb CHANGED
@@ -16,6 +16,7 @@ module Pubid
16
16
  autoload :Renderer, "#{__dir__}/ecma/renderer"
17
17
  autoload :UrnGenerator, "#{__dir__}/ecma/urn_generator"
18
18
  autoload :UrnParser, "#{__dir__}/ecma/urn_parser"
19
+ autoload :PubidUrnSchema, "#{__dir__}/ecma/pubid_urn_schema"
19
20
 
20
21
  # Parse an ECMA identifier string
21
22
  def self.parse(identifier)
@@ -56,3 +56,13 @@
56
56
  flavor, so a raw default of any spelling or component type fails, whatever
57
57
  flavor introduces it. Its `PENDING_RAW_DEFAULTS` table is empty today; an
58
58
  entry that starts to pass turns red, which is the signal to delete it.
59
+
60
+ ## pubid-scheme URN (issue #670)
61
+
62
+ `lib/pubid/evs/pubid_urn_schema.rb`; rulings in `docs/URN-SCHEMES.adoc`
63
+ (`[[urn-evs]]`). The separators and the draft marker are facets; the
64
+ amendment/corrigendum columns are atoms. An adoption of a European
65
+ document carries it along `base` and it keeps the CEN/CENELEC schema
66
+ (`EVS-EN 18216:2026` is
67
+ `urn:pubid:evs:cencenelec.en:18216:year-2026:na`); `intlorg-` covers an
68
+ adoption of an organization pubid does not model as a nested identifier.
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Evs
5
+ # The pubid-scheme URN of evs (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("evs") do
10
+ atom "part", "part"
11
+ atom "year", "year"
12
+ atom "language", "lang"
13
+ atom "amd_kind", "amdkind"
14
+ atom "amd_number", "amdnumber"
15
+ atom "amd_year", "amdyear"
16
+ atom "cor_kind", "corkind"
17
+ atom "cor_year", "coryear"
18
+ atom "evs_type", "evstype"
19
+ atom "intl_org", "intlorg"
20
+ atom "na_year", "nayear"
21
+
22
+
23
+ facet "separator", "separator"
24
+ facet "amd_separator", "amdseparator"
25
+ facet "cor_separator", "corseparator"
26
+ facet "na_separator", "naseparator"
27
+ facet "draft_prefix", "draftprefix", kind: :bool
28
+
29
+ type "pubid:evs:estonian-standard", "es"
30
+ type "pubid:evs:identifier", "id"
31
+ type "pubid:evs:international-adoption", "ia"
32
+ type "pubid:evs:national-adoption", "na"
33
+ end
34
+ end
35
+ end
data/lib/pubid/evs.rb CHANGED
@@ -22,6 +22,7 @@ module Pubid
22
22
  autoload :Renderer, "#{__dir__}/evs/renderer"
23
23
  autoload :UrnGenerator, "#{__dir__}/evs/urn_generator"
24
24
  autoload :UrnParser, "#{__dir__}/evs/urn_parser"
25
+ autoload :PubidUrnSchema, "#{__dir__}/evs/pubid_urn_schema"
25
26
 
26
27
  def self.parse(identifier)
27
28
  unless identifier.is_a?(String)
@@ -75,7 +75,11 @@ module Pubid
75
75
  mapping_class: ::Lutaml::Model::Mapping,
76
76
  adapter_class: adapter,
77
77
  transformer: transformer,
78
- error_types: [Pubid::Errors::ParseError],
78
+ # Both decode-failure classes wrap as InvalidFormatError here, so
79
+ # `Identifier.from_urn` keeps its one failure shape (issue #670:
80
+ # the umbrella raises UrnParseError where it leaked raw
81
+ # ArgumentError, and a grammar failure is ParseError).
82
+ error_types: [Pubid::Errors::ParseError, Pubid::Errors::UrnParseError],
79
83
  )
80
84
  end
81
85
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Gb
5
+ # The pubid-scheme URN of GB (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # JB/T 13368-2018 -> urn:pubid:gb:std:13368:pub-JB:mandate-T:year-2018
8
+ #
9
+ # The publisher and the mandate letter (`T` of GB/T) are atoms. The
10
+ # current urn:gb:… form of #to_urn is pubid-invented and stays there.
11
+ PubidUrnSchema = Pubid::PubidUrn.define("gb") do
12
+ atom "publisher", "pub"
13
+ atom "part", "part"
14
+ atom "year", "year"
15
+ atom "mandate", "mandate"
16
+ atom "identifiers", "ids", kind: :ids
17
+
18
+ type "pubid:gb:all-parts", "all", atoms: []
19
+ type "pubid:gb:identifier", "id"
20
+ type "pubid:gb:standard", "std"
21
+ end
22
+ end
23
+ end
data/lib/pubid/gb.rb CHANGED
@@ -41,6 +41,7 @@ module Pubid
41
41
  autoload :Identifiers, "#{__dir__}/gb/identifiers"
42
42
  autoload :Parser, "#{__dir__}/gb/parser"
43
43
  autoload :Renderer, "#{__dir__}/gb/renderer"
44
+ autoload :PubidUrnSchema, "#{__dir__}/gb/pubid_urn_schema"
44
45
 
45
46
  # Parse a Chinese Standard identifier string.
46
47
  # @param identifier [String] e.g. "GB/T 20223-2006"
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iala
5
+ # The pubid-scheme URN of iala (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("iala") do
10
+ atom "edition", "ed"
11
+ atom "language", "lang"
12
+ atom "annex_form", "annexform"
13
+ atom "letter", "letter"
14
+
15
+
16
+ type "pubid:iala:advice", "advice"
17
+ type "pubid:iala:annex", "annex"
18
+ type "pubid:iala:general-assembly", "ga"
19
+ type "pubid:iala:guideline", "g"
20
+ type "pubid:iala:identifier", "id"
21
+ type "pubid:iala:letter", "letter"
22
+ type "pubid:iala:manual", "manual"
23
+ type "pubid:iala:model-course", "mc"
24
+ type "pubid:iala:recommendation", "rec"
25
+ type "pubid:iala:report", "rpt"
26
+ type "pubid:iala:resolution", "r"
27
+ type "pubid:iala:standard", "std"
28
+ end
29
+ end
30
+ end
data/lib/pubid/iala.rb CHANGED
@@ -15,6 +15,7 @@ module Pubid
15
15
  autoload :Renderer, "#{__dir__}/iala/renderer"
16
16
  autoload :UrnGenerator, "#{__dir__}/iala/urn_generator"
17
17
  autoload :UrnParser, "#{__dir__}/iala/urn_parser"
18
+ autoload :PubidUrnSchema, "#{__dir__}/iala/pubid_urn_schema"
18
19
 
19
20
  # Parse an IALA identifier string into an identifier object.
20
21
  # @param identifier [String] The IALA identifier string to parse
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iana
5
+ # The pubid-scheme URN of iana (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("iana") do
10
+ atom "sub_registry", "subregistry"
11
+
12
+
13
+ type "pubid:iana:identifier", "id", core: []
14
+ type "pubid:iana:registry", "registry"
15
+ end
16
+ end
17
+ end
data/lib/pubid/iana.rb CHANGED
@@ -18,6 +18,7 @@ module Pubid
18
18
  autoload :Renderer, "#{__dir__}/iana/renderer"
19
19
  autoload :UrnGenerator, "#{__dir__}/iana/urn_generator"
20
20
  autoload :UrnParser, "#{__dir__}/iana/urn_parser"
21
+ autoload :PubidUrnSchema, "#{__dir__}/iana/pubid_urn_schema"
21
22
 
22
23
  # Parse an IANA identifier string
23
24
  def self.parse(identifier)
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Idf
5
+ # The pubid-scheme URN of IDF (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # IDF 146:2003/AMD 1:2023 ->
8
+ # urn:pubid:idf:is:146:pubbody-IDF:year-2003:amd:1:year-2023
9
+ #
10
+ # The current urn:idf:… form of #to_urn is pubid-invented and stays
11
+ # there. `type`, `stage` and `typed_stage` serialize every registry
12
+ # field of their components, so each field is its own atom (the NIST
13
+ # ruling): reducing them to one identifying value would change to_hash
14
+ # and need a relaton-data re-crawl — a separate decision.
15
+ PubidUrnSchema = Pubid::PubidUrn.define("idf") do
16
+ atom "publisher.body", "pubbody"
17
+ atom "type.abbr", "typeabbr"
18
+ atom "type.name", "typename"
19
+ atom "type.type_code", "typetypecode"
20
+ atom "part", "part"
21
+ atom "year", "year"
22
+ atom "stage.abbr", "stageabbr"
23
+ atom "stage.name", "stagename"
24
+ atom "stage.stage_code", "stagestagecode"
25
+ atom "stage.harmonized_stages", "stageharmonizedstages", kind: :list
26
+ atom "typed_stage.abbr", "typedstageabbr", kind: :list
27
+ atom "typed_stage.name", "typedstagename"
28
+ atom "typed_stage.code", "typedstage"
29
+ atom "typed_stage.long_abbr", "typedstagelongabbr"
30
+ atom "typed_stage.short_abbr", "typedstageshortabbr"
31
+ atom "typed_stage.stage_code", "typedstagestagecode"
32
+ atom "typed_stage.type_code", "typedstagetypecode"
33
+ atom "typed_stage.harmonized_stages", "typedstageharmonizedstages",
34
+ kind: :list
35
+
36
+ type "pubid:idf:all-parts", "all"
37
+ type "pubid:idf:amendment", "amd"
38
+ type "pubid:idf:corrigendum", "cor"
39
+ type "pubid:idf:identifier", "id"
40
+ type "pubid:idf:international-standard", "is"
41
+ type "pubid:idf:reviewed-method", "rm"
42
+ end
43
+ end
44
+ end
data/lib/pubid/idf.rb CHANGED
@@ -17,6 +17,7 @@ module Pubid
17
17
  autoload :SupplementIdentifier, "#{__dir__}/idf/supplement_identifier"
18
18
  autoload :UrnGenerator, "#{__dir__}/idf/urn_generator"
19
19
  autoload :UrnParser, "#{__dir__}/idf/urn_parser"
20
+ autoload :PubidUrnSchema, "#{__dir__}/idf/pubid_urn_schema"
20
21
 
21
22
  def self.parse(identifier)
22
23
  unless identifier.is_a?(String)
@@ -31,3 +31,16 @@ These notes were part of the root `CLAUDE.md`. Read them before you change `lib/
31
31
  **Two parent-slot gaps recorded by the cross-flavor `base` survey** (`lib/pubid/bsi/CLAUDE.md` has the measured version). `Identifiers::TestReportForm#cispr_identifier` is a polymorphic `Identifier` parent slot with no `#root` override, so `root` returns the form itself. And `Identifiers::ConsolidatedIdentifier#base_document` returns `identifiers&.first` **without** the recursive `&.base_document` that its BSI, CSA and CEN counterparts use — a one-level peel where the others peel fully, so a consolidated edition of a supplement does not reduce to the bare standard. Neither is chased here; both are pinned by nothing, which is why they are written down.
32
32
 
33
33
  **Stage codes — the SSOT and what is settled.** The authoritative source for IEC stage abbreviations is committed in this repo: **`data/iec/stage-codes.md`** — the 52-row IEC/ISO stage-code correspondence table transcribed from IEC's official *IEC/ISO Harmonized APIs* documents (v0.0.8 2023-06, api-portal.iec.ch; v0.0.7 2021-05, iec-apiportal.apigee.io — the successors that replace the IEC Data Feeds), the legacy Data-Feeds field examples, and the IS-lifecycle ladder from `StageCodes_IS_v2.pdf` (2023-06). `www.iec.ch` itself is fully WAF-gated to non-browsers and the Wayback Machine holds no snapshots of its PDFs, so the extract — not the unreachable original — is the reference. **`Pubid::Iec.locate_stage` reads `TYPED_STAGES` only** (`lib/pubid/iec.rb`); `PROJECT_STAGES` (AFDIS, TCDV, PRVC…) are not queryable through it. Every one of metanorma-iec's 55 `STAGE_CODES` — the list quoted in pubid#237 — resolves, locked by `spec/pubid/iec/typed_stages_spec.rb` in the issue's own order; aliases are always **appended, never prepended**, so `abbr.first` (what renders) is unchanged. Notable rulings from that pass: **ADIS** is the legacy Data-Feeds spelling of AFDIS ("Approved for FDIS circulation", ISO_LEVEL 40.99) and is an alias on `cdv` (the typed stage claiming 40.99); **CDISH/CDPAS** are the 50.20 rows of the DISH/DPAS deliverables, not "committee draft ISH/PAS" (30.xx); **Reconciliation items recorded in the extract, deliberately not applied:** DELPUB sits at 99.60 there while the `is` ladder does not claim 99.60; CAN carries two codes (30.98 IS/TR/TS, 50.98 PAS/ISH/COR); the rows CDISH-table-siblings DECDISH/MERGED/SPLIT/PCC/PRVN/DEL/RPUB/TPUB and the per-deliverable translation/preparation families are not registered as typed-stage abbreviations.
34
+
35
+ ## pubid-scheme URN (issue #670)
36
+
37
+ `lib/pubid/iec/pubid_urn_schema.rb` completes the partial schema the IEEE
38
+ and GOST waves landed; rulings in `docs/URN-SCHEMES.adoc` (`[[urn-iec]]`).
39
+ Invariant: every atom added after those waves sits after `database-` and
40
+ before `lang-`, so a landed URN encodes identically (`database` became the
41
+ bool the corpus serializes before any URN carried it). The URN inherits
42
+ the unserialized-identity gaps pinned above: a WorkingDocument's URN is
43
+ the type-only `urn:pubid:iec:wd` (all WD rows share one hash — a shared
44
+ hash, not a collision), and a TestReportForm's CISPR document rides
45
+ `cispr_identifier`. Mapping them stays the wire-format decision it
46
+ already was.
@@ -2,15 +2,28 @@
2
2
 
3
3
  module Pubid
4
4
  module Iec
5
- # The pubid-scheme URN of IEC — PARTIAL (issue #656;
5
+ # The pubid-scheme URN of IEC (issue #670 completes the flavor;
6
6
  # docs/URN-SCHEMES.adoc).
7
7
  #
8
- # Only the types other flavors nest are declared: the International
9
- # Standard (IEC/IEEE co-publications, GOST adoptions), and the TS, TR,
10
- # amendment and consolidated identifier a GOST adoption can name
11
- # ("IEC 60079-0:2017+AMD1:2020"). IEC's own wave declares the rest of the
12
- # flavor; until then IEC stays pending in the contract spec. The official
13
- # RFC 5141-style urn:iec:std: form stays on #to_urn.
8
+ # CISPR 12:2007/AMD1:2009 ->
9
+ # urn:pubid:iec:is:12:pub-CISPR:year-2007:amd:1:pub-CISPR:year-2009
10
+ #
11
+ # The partial schema landed with IEEE named the one type IEEE nests; the
12
+ # GOST wave added the TS, TR, amendment and consolidated identifier a
13
+ # GOST adoption can name. This wave declares the rest of the flavor and
14
+ # the atoms its types serialize (`vap`, the sheet/fragment numbers);
15
+ # every new atom sits after the ones earlier waves placed, so the
16
+ # published URNs are unchanged. `database` was a string atom before any
17
+ # URN carried it — the corpus holds only `true`, so it is a bool.
18
+ #
19
+ # Known identity gaps the URN inherits, because it carries exactly what
20
+ # to_hash carries (pinned in lib/pubid/iec/CLAUDE.md): a WorkingDocument
21
+ # serializes only `_type`, and a TestReportForm's CISPR document sits in
22
+ # the unserialized `cispr_identifier` — such rows emit type-only URNs
23
+ # (`urn:pubid:iec:wd`) and are one hash, so they are not a collision.
24
+ # Mapping them is a wire-format change and stays the separate decision
25
+ # it already was. The official RFC 5141-style urn:iec:std: form stays
26
+ # on #to_urn.
14
27
  PubidUrnSchema = Pubid::PubidUrn.define("iec") do
15
28
  atom "publisher", "pub"
16
29
  atom "copublishers", "co", kind: :list
@@ -23,17 +36,42 @@ module Pubid
23
36
  atom "edition", "ed"
24
37
  atom "stage", "stage"
25
38
  atom "stage_iteration", "iter"
26
- atom "database", "database"
39
+ atom "database", "database", kind: :bool
40
+ atom "fragment_number", "frag"
41
+ atom "sheet_number", "sheet"
42
+ atom "sheet_year", "sheetyear"
43
+ atom "vap", "vap", kind: :list
27
44
  atom "languages.*.code", "lang"
28
45
  atom "identifiers", "ids", kind: :ids
29
46
 
30
47
  facet "languages.*.original_code", "langsrc"
31
48
 
49
+ type "pubid:iec:all-parts", "all"
32
50
  type "pubid:iec:amendment", "amd"
51
+ type "pubid:iec:base", "base"
52
+ type "pubid:iec:component-specification", "cs"
53
+ type "pubid:iec:conformity-assessment", "ca"
33
54
  type "pubid:iec:consolidated-identifier", "consol", core: []
55
+ type "pubid:iec:corrigendum", "cor"
56
+ type "pubid:iec:fragment-identifier", "fi", core: []
57
+ type "pubid:iec:guide", "guide"
58
+ type "pubid:iec:identifier", "id"
34
59
  type "pubid:iec:international-standard", "is"
60
+ type "pubid:iec:interpretation-sheet", "is2"
61
+ type "pubid:iec:operational-document", "od"
62
+ type "pubid:iec:publicly-available-specification", "pas"
63
+ type "pubid:iec:sheet-identifier", "si", core: []
64
+ type "pubid:iec:single-identifier", "si2"
65
+ type "pubid:iec:societal-technology-trend-report", "sttr"
66
+ type "pubid:iec:systems-reference-document", "srd"
67
+ type "pubid:iec:technical-group", "tg"
35
68
  type "pubid:iec:technical-report", "tr"
36
69
  type "pubid:iec:technical-specification", "ts"
70
+ type "pubid:iec:technology-report", "tr2"
71
+ type "pubid:iec:test-report-form", "trf"
72
+ type "pubid:iec:vap-identifier", "vi"
73
+ type "pubid:iec:white-paper", "wp"
74
+ type "pubid:iec:working-document", "wd"
37
75
  end
38
76
  end
39
77
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Ietf
5
+ # The pubid-scheme URN of IETF (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # draft-3gpp-collaboration-01 ->
8
+ # urn:pubid:ietf:id2:3gpp-collaboration:v-01
9
+ #
10
+ # The official urn:ietf:rfc:… namespace (RFC 2648) stays on #to_urn.
11
+ # The internet-draft token is `id2`, because `id` names the flavor's
12
+ # bare identifier.
13
+ PubidUrnSchema = Pubid::PubidUrn.define("ietf") do
14
+ atom "version", "v"
15
+
16
+ type "pubid:ietf:bcp", "bcp"
17
+ type "pubid:ietf:fyi", "fyi"
18
+ type "pubid:ietf:identifier", "id"
19
+ type "pubid:ietf:internet-draft", "id2"
20
+ type "pubid:ietf:rfc", "rfc"
21
+ type "pubid:ietf:std", "std"
22
+ end
23
+ end
24
+ end
data/lib/pubid/ietf.rb CHANGED
@@ -24,6 +24,7 @@ module Pubid
24
24
  autoload :Renderer, "#{__dir__}/ietf/renderer"
25
25
  autoload :UrnGenerator, "#{__dir__}/ietf/urn_generator"
26
26
  autoload :UrnParser, "#{__dir__}/ietf/urn_parser"
27
+ autoload :PubidUrnSchema, "#{__dir__}/ietf/pubid_urn_schema"
27
28
 
28
29
  # Parse an IETF identifier string
29
30
  def self.parse(identifier)
@@ -172,3 +172,14 @@ edition rename (the serialized key moved `version` → `edition`) and
172
172
  the volume unification; relaton-cli's `MachineIndex::REFINABLE_KEYS`
173
173
  needs `edition`/`volume` beside the retired `version`/`year` keys; the
174
174
  pubid pin moves in step with the relaton-data-iho re-key.
175
+
176
+ ## pubid-scheme URN (issue #670)
177
+
178
+ `lib/pubid/iho/pubid_urn_schema.rb`; rulings in `docs/URN-SCHEMES.adoc`
179
+ (`[[urn-iho]]`). The atoms follow the containment order of
180
+ `UrnGenerator::SEGMENTS` — the document's `ed-`/`year-` first, then each
181
+ component with its own edition/year right after it (`sup-`, `part-`,
182
+ `parted-`, `appendix-`, `appsub-`, `vol-`, `issue-` …). Case is preserved
183
+ (`part-A`); the yearbook year is a volume (`vol-2024`, no `year-` value —
184
+ the legacy `y.` marker stays decodable in the official URN parser, never
185
+ emitted). The official `urn:mrn:iho:…` form stays on `#to_urn`.
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iho
5
+ # The pubid-scheme URN of IHO (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # IHO S-100 5.0.0 Part 2 (2024) ->
8
+ # urn:pubid:iho:std:100:ed-5.0.0:year-2024:part-2
9
+ #
10
+ # The atoms follow the containment order of the official URN
11
+ # (urn:iho:s:100:ed-5.2.0:part-2, Pubid::Iho::UrnGenerator): the
12
+ # document's edition and year first, then each component with its own
13
+ # edition/year right after it — supplement, part, annex, appendix (the
14
+ # two-level Appendix D-2 keeps the subnumber as its own atom), volume
15
+ # (the unified locator, yearbook volumes included: `vol-2024`), issue.
16
+ # Letters stay case-preserved (`part-A`). The legacy `y.` yearbook
17
+ # marker is decodable in the official URN parser, never emitted here:
18
+ # a periodical has no `year-` atom value, its volume carries the year.
19
+ # The official urn:mrn:iho:… form stays on #to_urn.
20
+ PubidUrnSchema = Pubid::PubidUrn.define("iho") do
21
+ atom "edition", "ed"
22
+ atom "year", "year"
23
+ atom "supplement", "sup"
24
+ atom "supplement_edition", "suped"
25
+ atom "supplement_year", "supyear"
26
+ atom "part", "part"
27
+ atom "part_edition", "parted"
28
+ atom "part_year", "party"
29
+ atom "annex", "annex"
30
+ atom "annex_edition", "anned"
31
+ atom "annex_year", "annyear"
32
+ atom "appendix", "appendix"
33
+ atom "appendix_subnumber", "appsub"
34
+ atom "appendix_edition", "apped"
35
+ atom "appendix_year", "appyear"
36
+ atom "volume", "vol"
37
+ atom "issue", "issue"
38
+ atom "volume_edition", "voled"
39
+ atom "volume_year", "voly"
40
+
41
+ type "pubid:iho:bibliographic", "b"
42
+ type "pubid:iho:circular-letter", "cl"
43
+ type "pubid:iho:identifier", "id"
44
+ type "pubid:iho:miscellaneous", "m"
45
+ type "pubid:iho:publication", "pub"
46
+ type "pubid:iho:standard", "std"
47
+ end
48
+ end
49
+ end
data/lib/pubid/iho.rb CHANGED
@@ -14,6 +14,7 @@ module Pubid
14
14
  autoload :Renderer, "#{__dir__}/iho/renderer"
15
15
  autoload :UrnGenerator, "#{__dir__}/iho/urn_generator"
16
16
  autoload :UrnParser, "#{__dir__}/iho/urn_parser"
17
+ autoload :PubidUrnSchema, "#{__dir__}/iho/pubid_urn_schema"
17
18
 
18
19
  # Parse an IHO identifier string into an identifier object
19
20
  # @param identifier [String] The IHO identifier string to parse
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Isbn
5
+ # The pubid-scheme URN of ISBN (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # ISBN 0-306-40615-2 -> urn:pubid:isbn:book:hyphenated-0-306-40615-2:raw-0306406152
8
+ #
9
+ # There is no positional core: the hyphenated and raw spellings are both
10
+ # optional atoms (an ISBN given bare serializes only `raw`). The official
11
+ # urn:isbn: namespace (RFC 3187) stays on #to_urn.
12
+ PubidUrnSchema = Pubid::PubidUrn.define("isbn") do
13
+ atom "hyphenated", "hyphenated"
14
+ atom "raw", "raw"
15
+
16
+ type "pubid:isbn:book", "book", core: []
17
+ type "pubid:isbn:identifier", "id", core: []
18
+ end
19
+ end
20
+ end
data/lib/pubid/isbn.rb CHANGED
@@ -18,6 +18,7 @@ module Pubid
18
18
  autoload :Identifiers, "#{__dir__}/isbn/identifiers"
19
19
  autoload :Parser, "#{__dir__}/isbn/parser"
20
20
  autoload :Renderer, "#{__dir__}/isbn/renderer"
21
+ autoload :PubidUrnSchema, "#{__dir__}/isbn/pubid_urn_schema"
21
22
 
22
23
  def self.parse(identifier)
23
24
  Identifier.parse(identifier)
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Jis
5
+ # The pubid-scheme URN of JIS (issue #670; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # JIS A 0001:1999 -> urn:pubid:jis:jis:0001:series-A:year-1999
8
+ #
9
+ # The current urn:jis:… form of #to_urn is pubid-invented and stays
10
+ # there.
11
+ PubidUrnSchema = Pubid::PubidUrn.define("jis") do
12
+ atom "series", "series"
13
+ atom "parts", "part", kind: :list
14
+ atom "year", "year", kind: :int
15
+ atom "reaffirmed", "reaffirmed", kind: :bool
16
+
17
+ type "pubid:jis:all-parts", "all"
18
+ type "pubid:jis:amendment", "amd"
19
+ type "pubid:jis:corrigendum", "cor"
20
+ type "pubid:jis:explanation", "e"
21
+ type "pubid:jis:identifier", "id"
22
+ type "pubid:jis:japanese-industrial-standard", "jis"
23
+ type "pubid:jis:standard", "std"
24
+ type "pubid:jis:technical-report", "tr"
25
+ type "pubid:jis:technical-specification", "ts"
26
+ type "pubid:jis:welding-engineering-standard", "wes"
27
+ end
28
+ end
29
+ end
data/lib/pubid/jis.rb CHANGED
@@ -19,6 +19,7 @@ module Pubid
19
19
  autoload :SupplementIdentifier, "#{__dir__}/jis/supplement_identifier"
20
20
  autoload :UrnGenerator, "#{__dir__}/jis/urn_generator"
21
21
  autoload :UrnParser, "#{__dir__}/jis/urn_parser"
22
+ autoload :PubidUrnSchema, "#{__dir__}/jis/pubid_urn_schema"
22
23
 
23
24
  # Parse a JIS identifier string
24
25
  def self.parse(identifier)
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Oasis
5
+ # The pubid-scheme URN of oasis (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("oasis") do
10
+ atom "part", "part"
11
+ atom "version", "v"
12
+ atom "stage", "stage"
13
+ atom "label", "label"
14
+ atom "original", "original"
15
+
16
+
17
+ type "pubid:oasis:identifier", "id"
18
+ type "pubid:oasis:standard", "std"
19
+ end
20
+ end
21
+ end
data/lib/pubid/oasis.rb CHANGED
@@ -17,6 +17,7 @@ module Pubid
17
17
  autoload :Renderer, "#{__dir__}/oasis/renderer"
18
18
  autoload :UrnGenerator, "#{__dir__}/oasis/urn_generator"
19
19
  autoload :UrnParser, "#{__dir__}/oasis/urn_parser"
20
+ autoload :PubidUrnSchema, "#{__dir__}/oasis/pubid_urn_schema"
20
21
 
21
22
  # Parse an OASIS identifier string
22
23
  def self.parse(identifier)
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Ogc
5
+ # The pubid-scheme URN of ogc (issue #656; docs/URN-SCHEMES.adoc).
6
+ #
7
+ # Declared from the doc's section: the atom, facet and type tables
8
+ # below are the doc's design, conforming token-for-token.
9
+ PubidUrnSchema = Pubid::PubidUrn.define("ogc") do
10
+ atom "year", "year"
11
+ atom "revision", "rev"
12
+
13
+
14
+ type "pubid:ogc:document", "document"
15
+ type "pubid:ogc:identifier", "id"
16
+ end
17
+ end
18
+ end
data/lib/pubid/ogc.rb CHANGED
@@ -20,6 +20,7 @@ module Pubid
20
20
  autoload :Renderer, "#{__dir__}/ogc/renderer"
21
21
  autoload :UrnGenerator, "#{__dir__}/ogc/urn_generator"
22
22
  autoload :UrnParser, "#{__dir__}/ogc/urn_parser"
23
+ autoload :PubidUrnSchema, "#{__dir__}/ogc/pubid_urn_schema"
23
24
 
24
25
  # Parse an OGC identifier string
25
26
  def self.parse(identifier)