pubid 2.0.52 → 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.
- checksums.yaml +4 -4
- data/data/parg/iala.json +1 -1
- data/lib/pubid/iala/CLAUDE.md +55 -6
- data/lib/pubid/iala/builder.rb +26 -3
- data/lib/pubid/iala/identifier.rb +16 -11
- data/lib/pubid/iala/identifiers/product_specification.rb +40 -0
- data/lib/pubid/iala/identifiers.rb +2 -0
- data/lib/pubid/iala/pubid_urn_schema.rb +1 -0
- data/lib/pubid/iala/renderer.rb +20 -2
- data/lib/pubid/iala/urn.adoc +133 -0
- data/lib/pubid/iala/urn_generator.rb +22 -4
- data/lib/pubid/iala/urn_parser.rb +10 -4
- data/lib/pubid/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85466069102a3322bef848e6168d4420799f142130b00d895157965d95d61637
|
|
4
|
+
data.tar.gz: 32bc6158dc9ce4be22d8ed95d7fc6556cbd38aff33e5f8c3d131a5a179418ccf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9acc03b45eff0887b586f91d336799c353f1b94d94566757641a1973d94b14952880869a011868ea773bff51bac549720ab4d8685537e1f0c9e40b8a4ecc0590
|
|
7
|
+
data.tar.gz: c79e8d27373ec927a4a197753d6b82f8824284118e2e7988e524c88ed03beeae7048902bce5038fc2efc075c04f89b129d719f9bdd043f539278b07828430fc9
|
data/data/parg/iala.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":102}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":32}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":29}},{"Entity":{"atom":25}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"dotted_segment","atom":27}},{"Sequence":{"atoms":[24,28]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":30}},{"Sequence":{"atoms":[18,31]}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Entity":{"atom":36}},{"Str":{"pattern":"-"}},{"Entity":{"atom":20}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":38}},{"Sequence":{"atoms":[35,39]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":41}},{"Repetition":{"atom":33,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,43]}},{"Named":{"name":"base","atom":44}},{"Entity":{"atom":47}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[48,49]}},{"Named":{"name":"annex_marker","atom":50}},{"Entity":{"atom":47}},{"Entity":{"atom":54}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Named":{"name":"annex_letter","atom":53}},{"Entity":{"atom":57}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":56,"positive":false}},{"Sequence":{"atoms":[52,55,58]}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":76}},{"Entity":{"atom":47}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":47}},{"Entity":{"atom":74}},{"Entity":{"atom":20}},{"Repetition":{"atom":66,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Entity":{"atom":20}},{"Repetition":{"atom":69,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[68,70]}},{"Repetition":{"atom":71,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[67,72]}},{"Named":{"name":"edition_value","atom":73}},{"Sequence":{"atoms":[62,63,64,65]}},{"Named":{"name":"edition","atom":75}},{"Entity":{"atom":83}},{"Entity":{"atom":79}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":74}},{"Sequence":{"atoms":[78,80,81]}},{"Named":{"name":"edition","atom":82}},{"Alternative":{"atoms":[61,77]}},{"Repetition":{"atom":84,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Entity":{"atom":47}},{"Repetition":{"atom":87,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[90,91,92,93,94,95]}},{"Named":{"name":"language","atom":96}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[88,89,97,98]}},{"Named":{"name":"language_group","atom":99}},{"Repetition":{"atom":86,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[45,46,51,60,85,101]}},{"Entity":{"atom":117}},{"Entity":{"atom":3}},{"Entity":{"atom":110}},{"Entity":{"atom":16}},{"Entity":{"atom":32}},{"Entity":{"atom":42}},{"Repetition":{"atom":108,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[106,107,109]}},{"Entity":{"atom":76}},{"Entity":{"atom":83}},{"Alternative":{"atoms":[111,112]}},{"Repetition":{"atom":113,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Repetition":{"atom":115,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[104,105,114,116]}},{"Entity":{"atom":147}},{"Str":{"pattern":"IALA "}},{"Entity":{"atom":142}},{"Entity":{"atom":130}},{"Entity":{"atom":57}},{"Repetition":{"atom":122,"min":0,"max":2,"tag":"Repetition"}},{"Entity":{"atom":20}},{"Repetition":{"atom":124,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":57}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[126,127]}},{"Lookahead":{"atom":128,"positive":false}},{"Sequence":{"atoms":[123,125,129]}},{"Lookahead":{"atom":121,"positive":false}},{"Entity":{"atom":136}},{"Entity":{"atom":57}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[133,134]}},{"Repetition":{"atom":135,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Entity":{"atom":136}},{"Sequence":{"atoms":[137,138]}},{"Repetition":{"atom":139,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[131,132,140]}},{"Named":{"name":"slug","atom":141}},{"Entity":{"atom":76}},{"Repetition":{"atom":143,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":100}},{"Repetition":{"atom":145,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[119,120,144,146]}},{"Alternative":{"atoms":[0,103,118]}}],"root":148},"bindings":[{"capture":"type_letter","path":"type_letter","type":"string","card":null,"preprocess":null},{"capture":"doc_number","path":"doc_number","type":"string","card":null,"preprocess":null},{"capture":"dotted_segment","path":"doc_number_dots[].dotted_segment","type":"string","card":null,"preprocess":null},{"capture":"subpart_number","path":"subpart[].subpart_number","type":"string","card":null,"preprocess":null},{"capture":"edition_value","path":"edition_value","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"annex_marker","path":"annex_marker","type":"string","card":null,"preprocess":null},{"capture":"annex_letter","path":"annex_letter","type":"string","card":null,"preprocess":null},{"capture":"slug","path":"slug","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"accept","input":"R1016:ed2.0(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"C0103-1 Ed 3.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA L2.1.11 Ed 2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1128 Annex A Ed 1.6","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1045 Annex Ed 1","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA A12-01 (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA 13th-vts-symposium-report (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA iala-style-guide Ed 1.0 (E)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA Arctic-Seminar-Report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA -arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic seminar report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic-","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic--report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA s1070","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA c0103-1","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA 1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"example","input":"G1040","expect":{"type_letter":"G","doc_number":"1040"}},{"entry":"identifier","kind":"example","input":"GA01.01","expect":{"type_letter":"GA","doc_number":"01","doc_number_dots":[{"dotted_segment":"01"}]}},{"entry":"identifier","kind":"example","input":"C0103-1","expect":{"type_letter":"C","doc_number":"0103","subpart":[{"subpart_number":"1"}]}},{"entry":"identifier","kind":"example","input":"IALA S1070 Ed 2.0","expect":{"type_letter":"S","doc_number":"1070","edition_value":"2.0"}},{"entry":"identifier","kind":"example","input":"IALA G1128 Annex A Ed 1.6","expect":{"type_letter":"G","doc_number":"1128","annex_marker":"Annex","annex_letter":"A","edition_value":"1.6"}},{"entry":"identifier","kind":"example","input":"IALA arctic-seminar-report (E)","expect":{"slug":"arctic-seminar-report","language":"E"}},{"entry":"identifier","kind":"example","input":"IALA iala-world-wide-radio-navigation-plan Ed 2","expect":{"slug":"iala-world-wide-radio-navigation-plan","edition_value":"2"}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n#\n# Edition-2 conversion with typed model bindings. Deviations from the\n# v1 tree:\n# - the dotted continuation and the dash subpart repeat capture-bearing\n# rule refs (the itu `parts` shape): a repetition over a capture-less\n# unit harvested as a bare span binds differently per engine, so the\n# bindings read the inner captures through the array paths\n# `doc_number_dots[].dotted_segment` and `subpart[].subpart_number`.\n# The dotted segment gains its own capture (`dotted_segment`); the\n# subpart keeps its `subpart_number` capture, hoisted out of the\n# inline repetition into a rule ref of its own.\n# - the annex base composite stays unbound. Every capture inside it\n# (type_letter, doc_number, …) is the only occurrence of its name on\n# the annex path, so the binding harvest hoists it to the top level:\n# the builder reads one flat map for the plain and the annex form\n# alike and dispatches on :annex_marker. edition_value and language\n# hoist out of their edition/language_group composites the same way.\n#\n# The codeless (slug) form: iala.int lists some publications (reports\n# and proceedings, the style guide, history books, radio plans) with no\n# code, and relaton gives them the product-URL slug as docid, e.g.\n# \"IALA arctic-seminar-report (E)\". slug_identifier is the last\n# alternative, so every typed code keeps priority; a typed code starts\n# upper-case and a slug lower-case or with a digit, so the two never\n# overlap. The \"IALA \" prefix is mandatory here (it is optional for a\n# typed code): without it any lower-case word would parse. The slug has\n# no space, so it never takes the trailing \" Ed <edition>\" or \" (<L>)\".\n# A slug is two or more hyphen-joined [a-z0-9] runs (every corpus slug\n# is), and its first run must not look like a code (0-2 letters and\n# digits: \"s1070\", \"ga01\", \"1070\"), so a lower-case or letterless typo\n# of a typed code (\"IALA s1070\", \"IALA c0103-1\", \"IALA 1070 Ed 2.0\")\n# still fails instead of parsing as a codeless publication.\n\ngrammar PubidIala version \"0.1.0\" edition 2 {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = dot (1*digit) as dotted_segment\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart_number = dash (1*digit) as subpart_number\n subpart = (1*subpart_number) as subpart\n code = type_letter number_with_dots [subpart]\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = {\n ((publisher type_letter number_with_dots [subpart]) as base)\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space upper as annex_letter !lower) ]\n [edition_human / edition_compact]\n [language_group]\n }\n plain_identifier = {\n publisher code [edition_human / edition_compact] [language_group]\n }\n slug_segment = 1*(lower / digit)\n slug_code_like = *2lower 1*digit !(lower / digit)\n slug = (!slug_code_like slug_segment 1*(dash slug_segment)) as slug\n slug_identifier = {\n \"IALA \" slug [edition_human] [language_group]\n }\n identifier = {\n annex_identifier\n / plain_identifier\n / slug_identifier\n }\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type_letter -> type_letter (string)\n doc_number -> doc_number (string)\n dotted_segment -> doc_number_dots[].dotted_segment (string)\n subpart_number -> subpart[].subpart_number (string)\n edition_value -> edition_value (string)\n language -> language (string)\n annex_marker -> annex_marker (string)\n annex_letter -> annex_letter (string)\n slug -> slug (string)\n }\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n accept \"IALA S1070 Ed 2.0\"\n accept \"R1016:ed2.0(F)\"\n accept \"C0103-1 Ed 3.0\"\n accept \"IALA L2.1.11 Ed 2\"\n accept \"IALA G1128 Annex A Ed 1.6\"\n accept \"IALA G1045 Annex Ed 1\"\n accept \"IALA A12-01 (E)\"\n accept \"IALA arctic-seminar-report\"\n accept \"IALA 13th-vts-symposium-report (E)\"\n accept \"IALA iala-style-guide Ed 1.0 (E)\"\n reject \"nonsense\"\n reject \"arctic-seminar-report\"\n reject \"IALA Arctic-Seminar-Report\"\n reject \"IALA -arctic-seminar-report\"\n reject \"IALA arctic seminar report\"\n reject \"IALA arctic\"\n reject \"IALA arctic-\"\n reject \"IALA arctic--report\"\n reject \"IALA s1070\"\n reject \"IALA c0103-1\"\n reject \"IALA 1070 Ed 2.0\"\n example \"G1040\" { type_letter: \"G\", doc_number: \"1040\" }\n example \"GA01.01\" {\n type_letter: \"GA\",\n doc_number: \"01\",\n doc_number_dots: [ { dotted_segment: \"01\" } ],\n }\n example \"C0103-1\" {\n type_letter: \"C\",\n doc_number: \"0103\",\n subpart: [ { subpart_number: \"1\" } ],\n }\n example \"IALA S1070 Ed 2.0\" {\n type_letter: \"S\",\n doc_number: \"1070\",\n edition_value: \"2.0\",\n }\n example \"IALA G1128 Annex A Ed 1.6\" {\n type_letter: \"G\",\n doc_number: \"1128\",\n annex_marker: \"Annex\",\n annex_letter: \"A\",\n edition_value: \"1.6\",\n }\n example \"IALA arctic-seminar-report (E)\" {\n slug: \"arctic-seminar-report\",\n language: \"E\",\n }\n example \"IALA iala-world-wide-radio-navigation-plan Ed 2\" {\n slug: \"iala-world-wide-radio-navigation-plan\",\n edition_value: \"2\",\n }\n }\n}\n","source_hash":"ab620b92df8199a8ed6a1e34e270748e97596744c2fab91f27ee82c8add38825","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:35c2500510eb2381f7b589169862d6bca767259d9d75b349e0268eb318d70983","checksum":"sha256:000246eed8518ec3eebf2e2aab2fb113141bcbb18721f339511026067b805936","validated":{"lint_errors":0,"lint_warnings":3,"tests_total":30,"tests_failures":0,"self_test":true}}
|
|
1
|
+
{"bindings":null,"version":"0.2.0","grammar":"PubidIala","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":105}},{"Entity":{"atom":3}},{"Str":{"pattern":"IALA "}},{"Repetition":{"atom":2,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Str":{"pattern":"GA"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"X"}},{"Str":{"pattern":"P"}},{"Alternative":{"atoms":[5,6,7,8,9,10,11,12,13,14]}},{"Named":{"name":"type_letter","atom":15}},{"Entity":{"atom":32}},{"Entity":{"atom":22}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":19,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number","atom":21}},{"Entity":{"atom":29}},{"Entity":{"atom":25}},{"Str":{"pattern":"."}},{"Entity":{"atom":20}},{"Repetition":{"atom":26,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"dotted_segment","atom":27}},{"Sequence":{"atoms":[24,28]}},{"Repetition":{"atom":23,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"doc_number_dots","atom":30}},{"Sequence":{"atoms":[18,31]}},{"Entity":{"atom":42}},{"Entity":{"atom":40}},{"Entity":{"atom":36}},{"Str":{"pattern":"-"}},{"Entity":{"atom":20}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart_number","atom":38}},{"Sequence":{"atoms":[35,39]}},{"Repetition":{"atom":34,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"subpart","atom":41}},{"Repetition":{"atom":33,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,4,17,43]}},{"Named":{"name":"base","atom":44}},{"Entity":{"atom":47}},{"Str":{"pattern":" "}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[48,49]}},{"Named":{"name":"annex_marker","atom":50}},{"Entity":{"atom":47}},{"Entity":{"atom":54}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Entity":{"atom":20}},{"Repetition":{"atom":55,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[53,56]}},{"Named":{"name":"annex_letter","atom":57}},{"Entity":{"atom":60}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Lookahead":{"atom":59,"positive":false}},{"Sequence":{"atoms":[52,58,61]}},{"Repetition":{"atom":62,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":79}},{"Entity":{"atom":47}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":47}},{"Entity":{"atom":77}},{"Entity":{"atom":20}},{"Repetition":{"atom":69,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Entity":{"atom":20}},{"Repetition":{"atom":72,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[71,73]}},{"Repetition":{"atom":74,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[70,75]}},{"Named":{"name":"edition_value","atom":76}},{"Sequence":{"atoms":[65,66,67,68]}},{"Named":{"name":"edition","atom":78}},{"Entity":{"atom":86}},{"Entity":{"atom":82}},{"Str":{"pattern":":"}},{"Str":{"pattern":"ed"}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[81,83,84]}},{"Named":{"name":"edition","atom":85}},{"Alternative":{"atoms":[64,80]}},{"Repetition":{"atom":87,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":103}},{"Entity":{"atom":47}},{"Repetition":{"atom":90,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"("}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"R"}},{"Alternative":{"atoms":[93,94,95,96,97,98]}},{"Named":{"name":"language","atom":99}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[91,92,100,101]}},{"Named":{"name":"language_group","atom":102}},{"Repetition":{"atom":89,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[45,46,51,63,88,104]}},{"Entity":{"atom":120}},{"Entity":{"atom":3}},{"Entity":{"atom":113}},{"Entity":{"atom":16}},{"Entity":{"atom":32}},{"Entity":{"atom":42}},{"Repetition":{"atom":111,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[109,110,112]}},{"Entity":{"atom":79}},{"Entity":{"atom":86}},{"Alternative":{"atoms":[114,115]}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":103}},{"Repetition":{"atom":118,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[107,108,117,119]}},{"Entity":{"atom":168}},{"Entity":{"atom":3}},{"Entity":{"atom":137}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"s"}},{"Alternative":{"atoms":[124,125]}},{"Entity":{"atom":36}},{"Entity":{"atom":136}},{"Str":{"pattern":"200"}},{"Lookahead":{"atom":129,"positive":false}},{"Str":{"pattern":"2"}},{"Entity":{"atom":20}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[131,132,133]}},{"Sequence":{"atoms":[130,134]}},{"Named":{"name":"s100_number","atom":135}},{"Sequence":{"atoms":[126,127,128]}},{"Entity":{"atom":47}},{"Str":{"pattern":"Annex"}},{"Str":{"pattern":"ANNEX"}},{"Alternative":{"atoms":[139,140]}},{"Named":{"name":"annex_marker","atom":141}},{"Entity":{"atom":47}},{"Entity":{"atom":54}},{"Entity":{"atom":20}},{"Repetition":{"atom":145,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[144,146]}},{"Named":{"name":"annex_letter","atom":147}},{"Entity":{"atom":60}},{"Lookahead":{"atom":149,"positive":false}},{"Sequence":{"atoms":[143,148,150]}},{"Repetition":{"atom":151,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":79}},{"Entity":{"atom":86}},{"Entity":{"atom":163}},{"Entity":{"atom":47}},{"Str":{"pattern":"Ed"}},{"Entity":{"atom":47}},{"Sequence":{"atoms":[157,158]}},{"Repetition":{"atom":159,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[156,160,161]}},{"Named":{"name":"edition","atom":162}},{"Alternative":{"atoms":[153,154,155]}},{"Repetition":{"atom":164,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":103}},{"Repetition":{"atom":166,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[122,123,138,142,152,165,167]}},{"Entity":{"atom":179}},{"Entity":{"atom":3}},{"Entity":{"atom":137}},{"Entity":{"atom":79}},{"Entity":{"atom":86}},{"Entity":{"atom":163}},{"Alternative":{"atoms":[172,173,174]}},{"Repetition":{"atom":175,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":103}},{"Repetition":{"atom":177,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[170,171,176,178]}},{"Entity":{"atom":209}},{"Str":{"pattern":"IALA "}},{"Entity":{"atom":204}},{"Entity":{"atom":192}},{"Entity":{"atom":60}},{"Repetition":{"atom":184,"min":0,"max":2,"tag":"Repetition"}},{"Entity":{"atom":20}},{"Repetition":{"atom":186,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":60}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[188,189]}},{"Lookahead":{"atom":190,"positive":false}},{"Sequence":{"atoms":[185,187,191]}},{"Lookahead":{"atom":183,"positive":false}},{"Entity":{"atom":198}},{"Entity":{"atom":60}},{"Entity":{"atom":20}},{"Alternative":{"atoms":[195,196]}},{"Repetition":{"atom":197,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":36}},{"Entity":{"atom":198}},{"Sequence":{"atoms":[199,200]}},{"Repetition":{"atom":201,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[193,194,202]}},{"Named":{"name":"slug","atom":203}},{"Entity":{"atom":79}},{"Repetition":{"atom":205,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":103}},{"Repetition":{"atom":207,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[181,182,206,208]}},{"Alternative":{"atoms":[0,106,121,169,180]}}],"root":210},"bindings":[{"capture":"type_letter","path":"type_letter","type":"string","card":null,"preprocess":null},{"capture":"doc_number","path":"doc_number","type":"string","card":null,"preprocess":null},{"capture":"dotted_segment","path":"doc_number_dots[].dotted_segment","type":"string","card":null,"preprocess":null},{"capture":"subpart_number","path":"subpart[].subpart_number","type":"string","card":null,"preprocess":null},{"capture":"s100_number","path":"s100_number","type":"string","card":null,"preprocess":null},{"capture":"edition_value","path":"edition_value","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"annex_marker","path":"annex_marker","type":"string","card":null,"preprocess":null},{"capture":"annex_letter","path":"annex_letter","type":"string","card":null,"preprocess":null},{"capture":"slug","path":"slug","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule identifier: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"G1040","expect":{}},{"entry":"identifier","kind":"accept","input":"GA1040","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"accept","input":"R1016:ed2.0(F)","expect":{}},{"entry":"identifier","kind":"accept","input":"C0103-1 Ed 3.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA L2.1.11 Ed 2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1128 Annex A Ed 1.6","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA G1045 Annex Ed 1","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA A12-01 (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA 13th-vts-symposium-report (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA iala-style-guide Ed 1.0 (E)","expect":{}},{"entry":"identifier","kind":"accept","input":"S-201 2.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201 2.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201 Ed 2.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201:ed2.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA s-201 2.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201 ANNEX B2","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-201 Annex A 1.0.0","expect":{}},{"entry":"identifier","kind":"accept","input":"IALA S-230 1.0.0 (E)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}},{"entry":"identifier","kind":"reject","input":"arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA Arctic-Seminar-Report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA -arctic-seminar-report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic seminar report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic-","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA arctic--report","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA s1070","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA c0103-1","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA 1070 Ed 2.0","expect":{}},{"entry":"identifier","kind":"reject","input":"S-411 1.2.1","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA S-411 1.2.1","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA S-200 1.0.0","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA S-30 2.0","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA S-2011 2.0.0","expect":{}},{"entry":"identifier","kind":"reject","input":"IALA S-201 Ed","expect":{}},{"entry":"identifier","kind":"example","input":"G1040","expect":{"type_letter":"G","doc_number":"1040"}},{"entry":"identifier","kind":"example","input":"GA01.01","expect":{"type_letter":"GA","doc_number":"01","doc_number_dots":[{"dotted_segment":"01"}]}},{"entry":"identifier","kind":"example","input":"C0103-1","expect":{"type_letter":"C","doc_number":"0103","subpart":[{"subpart_number":"1"}]}},{"entry":"identifier","kind":"example","input":"IALA S1070 Ed 2.0","expect":{"type_letter":"S","doc_number":"1070","edition_value":"2.0"}},{"entry":"identifier","kind":"example","input":"IALA G1128 Annex A Ed 1.6","expect":{"type_letter":"G","doc_number":"1128","annex_marker":"Annex","annex_letter":"A","edition_value":"1.6"}},{"entry":"identifier","kind":"example","input":"IALA arctic-seminar-report (E)","expect":{"slug":"arctic-seminar-report","language":"E"}},{"entry":"identifier","kind":"example","input":"IALA S-201 2.0.0","expect":{"s100_number":"201","edition_value":"2.0.0"}},{"entry":"identifier","kind":"example","input":"IALA S-201 ANNEX B2","expect":{"s100_number":"201","annex_marker":"ANNEX","annex_letter":"B2"}},{"entry":"identifier","kind":"example","input":"IALA iala-world-wide-radio-navigation-plan Ed 2","expect":{"slug":"iala-world-wide-radio-navigation-plan","edition_value":"2"}}],"docs":{},"source":"# Port of lib/pubid/iala/parser.rb: [IALA ]<type><number>[.dots][-subs]\n# [ Ed X.Y | :edX.Y] [(L)], plus the Annex-to-base form. The annex\n# letter guard (!lower) keeps \"Ed 1\" from mis-capturing.\n#\n# The S-100-family product specifications (the IHO-granted S-201..S-299\n# range, iala.int/technical/data-modelling/iala-s-200-development-status):\n# the hyphenated lexical form \"S-201\" with the S-100 dotted x.y.z\n# edition on the BARE face (\"IALA S-201 2.0.0\", the site's own citation\n# form); \"Ed 2.0.0\" and the compact \":ed2.0.0\" parse as normalizing\n# aliases. The hundreds digit is fixed to 2 by the grant, so WMO's and\n# IHO's own S-series (\"S-411 1.2.1\") never parse here. The alternative\n# sits above slug_identifier so the lower-case spelling (\"IALA s-201\")\n# binds the typed form instead of the codeless slug. The S-100 annex\n# wrapper takes the sub-numbered annex letters the package attests\n# (\"Annex A\", \"ANNEX B2\", \"Annex D1\"), which widens the shared annex\n# letter rule to an optional digit for the legacy series as well.\n#\n# Edition-2 conversion with typed model bindings. Deviations from the\n# v1 tree:\n# - the dotted continuation and the dash subpart repeat capture-bearing\n# rule refs (the itu `parts` shape): a repetition over a capture-less\n# unit harvested as a bare span binds differently per engine, so the\n# bindings read the inner captures through the array paths\n# `doc_number_dots[].dotted_segment` and `subpart[].subpart_number`.\n# The dotted segment gains its own capture (`dotted_segment`); the\n# subpart keeps its `subpart_number` capture, hoisted out of the\n# inline repetition into a rule ref of its own.\n# - the annex base composite stays unbound. Every capture inside it\n# (type_letter, doc_number, …) is the only occurrence of its name on\n# the annex path, so the binding harvest hoists it to the top level:\n# the builder reads one flat map for the plain and the annex form\n# alike and dispatches on :annex_marker. edition_value and language\n# hoist out of their edition/language_group composites the same way.\n#\n# The codeless (slug) form: iala.int lists some publications (reports\n# and proceedings, the style guide, history books, radio plans) with no\n# code, and relaton gives them the product-URL slug as docid, e.g.\n# \"IALA arctic-seminar-report (E)\". slug_identifier is the last\n# alternative, so every typed code keeps priority; a typed code starts\n# upper-case and a slug lower-case or with a digit, so the two never\n# overlap. The \"IALA \" prefix is mandatory here (it is optional for a\n# typed code): without it any lower-case word would parse. The slug has\n# no space, so it never takes the trailing \" Ed <edition>\" or \" (<L>)\".\n# A slug is two or more hyphen-joined [a-z0-9] runs (every corpus slug\n# is), and its first run must not look like a code (0-2 letters and\n# digits: \"s1070\", \"ga01\", \"1070\"), so a lower-case or letterless typo\n# of a typed code (\"IALA s1070\", \"IALA c0103-1\", \"IALA 1070 Ed 2.0\")\n# still fails instead of parsing as a codeless publication.\n\ngrammar PubidIala version \"0.2.0\" edition 2 {\n type_letter = (\"GA\" / \"S\" / \"R\" / \"G\" / \"M\" / \"C\" / \"A\" / \"L\" / \"X\" / \"P\") as type_letter\n doc_number = (1*digit) as doc_number\n dotted_number = dot (1*digit) as dotted_segment\n number_with_dots = doc_number (*dotted_number) as doc_number_dots\n subpart_number = dash (1*digit) as subpart_number\n subpart = (1*subpart_number) as subpart\n code = type_letter number_with_dots [subpart]\n s100_number = (!\"200\" (\"2\" digit digit)) as s100_number\n s100_code = ((\"S\" / \"s\") dash s100_number)\n edition_value = (1*digit *(dot 1*digit)) as edition_value\n edition_human = (space \"Ed\" space edition_value) as edition\n edition_compact = (colon \"ed\" edition_value) as edition\n s100_edition = (space [\"Ed\" space] edition_value) as edition\n language_group = ([space] \"(\" (\"E\" / \"F\" / \"S\" / \"C\" / \"A\" / \"R\") as language \")\") as language_group\n annex_identifier = {\n ((publisher type_letter number_with_dots [subpart]) as base)\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space (upper [digit]) as annex_letter !lower) ]\n [edition_human / edition_compact]\n [language_group]\n }\n plain_identifier = {\n publisher code [edition_human / edition_compact] [language_group]\n }\n s100_annex_identifier = {\n publisher s100_code\n space\n (\"Annex\" / \"ANNEX\") as annex_marker\n [ (space (upper [digit]) as annex_letter !lower) ]\n [edition_human / edition_compact / s100_edition]\n [language_group]\n }\n s100_identifier = {\n publisher s100_code\n [edition_human / edition_compact / s100_edition]\n [language_group]\n }\n slug_segment = 1*(lower / digit)\n slug_code_like = *2lower 1*digit !(lower / digit)\n slug = (!slug_code_like slug_segment 1*(dash slug_segment)) as slug\n slug_identifier = {\n \"IALA \" slug [edition_human] [language_group]\n }\n identifier = {\n annex_identifier\n / plain_identifier\n / s100_annex_identifier\n / s100_identifier\n / slug_identifier\n }\n publisher = [\"IALA \"]\n upper = %x41-5A\n lower = %x61-7A\n digit = %x30-39\n dash = \"-\"\n colon = \":\"\n dot = \".\"\n space = \" \"\n entry identifier: identifier\n\n bindings identifier {\n type_letter -> type_letter (string)\n doc_number -> doc_number (string)\n dotted_segment -> doc_number_dots[].dotted_segment (string)\n subpart_number -> subpart[].subpart_number (string)\n s100_number -> s100_number (string)\n edition_value -> edition_value (string)\n language -> language (string)\n annex_marker -> annex_marker (string)\n annex_letter -> annex_letter (string)\n slug -> slug (string)\n }\n\n test {\n accept \"G1040\"\n accept \"GA1040\"\n accept \"IALA S1070 Ed 2.0\"\n accept \"R1016:ed2.0(F)\"\n accept \"C0103-1 Ed 3.0\"\n accept \"IALA L2.1.11 Ed 2\"\n accept \"IALA G1128 Annex A Ed 1.6\"\n accept \"IALA G1045 Annex Ed 1\"\n accept \"IALA A12-01 (E)\"\n accept \"IALA arctic-seminar-report\"\n accept \"IALA 13th-vts-symposium-report (E)\"\n accept \"IALA iala-style-guide Ed 1.0 (E)\"\n accept \"S-201 2.0.0\"\n accept \"IALA S-201 2.0.0\"\n accept \"IALA S-201 Ed 2.0.0\"\n accept \"IALA S-201:ed2.0.0\"\n accept \"IALA S-201\"\n accept \"IALA s-201 2.0.0\"\n accept \"IALA S-201 ANNEX B2\"\n accept \"IALA S-201 Annex A 1.0.0\"\n accept \"IALA S-230 1.0.0 (E)\"\n reject \"nonsense\"\n reject \"arctic-seminar-report\"\n reject \"IALA Arctic-Seminar-Report\"\n reject \"IALA -arctic-seminar-report\"\n reject \"IALA arctic seminar report\"\n reject \"IALA arctic\"\n reject \"IALA arctic-\"\n reject \"IALA arctic--report\"\n reject \"IALA s1070\"\n reject \"IALA c0103-1\"\n reject \"IALA 1070 Ed 2.0\"\n reject \"S-411 1.2.1\"\n reject \"IALA S-411 1.2.1\"\n reject \"IALA S-200 1.0.0\"\n reject \"IALA S-30 2.0\"\n reject \"IALA S-2011 2.0.0\"\n reject \"IALA S-201 Ed\"\n example \"G1040\" { type_letter: \"G\", doc_number: \"1040\" }\n example \"GA01.01\" {\n type_letter: \"GA\",\n doc_number: \"01\",\n doc_number_dots: [ { dotted_segment: \"01\" } ],\n }\n example \"C0103-1\" {\n type_letter: \"C\",\n doc_number: \"0103\",\n subpart: [ { subpart_number: \"1\" } ],\n }\n example \"IALA S1070 Ed 2.0\" {\n type_letter: \"S\",\n doc_number: \"1070\",\n edition_value: \"2.0\",\n }\n example \"IALA G1128 Annex A Ed 1.6\" {\n type_letter: \"G\",\n doc_number: \"1128\",\n annex_marker: \"Annex\",\n annex_letter: \"A\",\n edition_value: \"1.6\",\n }\n example \"IALA arctic-seminar-report (E)\" {\n slug: \"arctic-seminar-report\",\n language: \"E\",\n }\n example \"IALA S-201 2.0.0\" {\n s100_number: \"201\",\n edition_value: \"2.0.0\",\n }\n example \"IALA S-201 ANNEX B2\" {\n s100_number: \"201\",\n annex_marker: \"ANNEX\",\n annex_letter: \"B2\",\n }\n example \"IALA iala-world-wide-radio-navigation-plan Ed 2\" {\n slug: \"iala-world-wide-radio-navigation-plan\",\n edition_value: \"2\",\n }\n }\n}\n","source_hash":"4bc93bf63b1692f346ce1cb273eff7adc50fc36a2d9c9904cda4e5457dacbae1","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.5.1.0","edition":2,"semantics_hash":"sha256:f21ad5b10665dcb1c4cc0d266e9b20359baab33900b2422a87c9ab0ace3c80eb","checksum":"sha256:c6e3329aa3e2bba2504bededcc333568c5672898e614099111dc72e5747b5d80","validated":{"lint_errors":0,"lint_warnings":10,"tests_total":47,"tests_failures":0,"self_test":true}}
|
data/lib/pubid/iala/CLAUDE.md
CHANGED
|
@@ -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<
|
|
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
|
-
- `
|
|
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
|
|
data/lib/pubid/iala/builder.rb
CHANGED
|
@@ -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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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"
|
|
54
|
-
"pubid:iala:
|
|
55
|
-
|
|
56
|
-
"pubid:iala:
|
|
57
|
-
"pubid:iala:
|
|
58
|
-
"pubid:iala:
|
|
59
|
-
"pubid:iala:
|
|
60
|
-
"pubid:iala:
|
|
61
|
-
"pubid:iala:
|
|
62
|
-
"pubid:iala:
|
|
63
|
-
"pubid:iala:
|
|
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"
|
data/lib/pubid/iala/renderer.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
= IALA URN schemes
|
|
2
|
+
|
|
3
|
+
The IALA flavor carries two URN forms: the official Maritime Resource
|
|
4
|
+
Name (`#to_urn`) and the pubid scheme (`#to_pubid_urn`, the round-trip
|
|
5
|
+
codec). This file is the flavor's URN record; the mixed
|
|
6
|
+
`docs/URN-SCHEMES.adoc` keeps its per-flavor snapshots frozen.
|
|
7
|
+
|
|
8
|
+
== Official URN: the IALA MRN scheme (`#to_urn`)
|
|
9
|
+
|
|
10
|
+
IALA owns the `mrn` URN namespace's IALA subtree. The scheme is defined
|
|
11
|
+
by three IALA documents, all published through the IALA MRN portal
|
|
12
|
+
(https://www.iala.int/technical/data-modelling-mrn/):
|
|
13
|
+
|
|
14
|
+
* *IALA Recommendation (Normative) R1023, Maritime Resource Names, Ed
|
|
15
|
+
1.0, June 2022* —
|
|
16
|
+
https://www.iala.int/technical/data-modelling-mrn/ (R1023). Normative
|
|
17
|
+
root: it ADOPTS the MRN and RECOMMENDS observing G1143; its own cover
|
|
18
|
+
and every page footer print the attested publication form
|
|
19
|
+
`urn:mrn:iala:pub:r1023:ed1.0`.
|
|
20
|
+
* *IALA Guideline G1143, Unique Identifiers for Maritime Resources, Ed
|
|
21
|
+
3.1* —
|
|
22
|
+
https://www.iala.int/technical/data-modelling-mrn/ (G1143). The
|
|
23
|
+
structure-and-use authority R1023 points at: the ABNF, the character
|
|
24
|
+
set, case rules, and the per-type annexes.
|
|
25
|
+
* *IALA Guideline G1164, Management of MRN Organisation Identifiers,
|
|
26
|
+
Ed 1.1* —
|
|
27
|
+
https://www.iala.int/technical/data-modelling-mrn/ (G1164). The
|
|
28
|
+
org-ID governance: rules for OIDs, IALA's own org id, and the
|
|
29
|
+
application procedure.
|
|
30
|
+
|
|
31
|
+
=== The derived scheme
|
|
32
|
+
|
|
33
|
+
G1143 §5.1/§5.2 define the MRN as
|
|
34
|
+
`urn:mrn:<governing-organization>:<type>:<type-specific-part>` with the
|
|
35
|
+
type (the Organization-specific namespace ID) a minimum of three
|
|
36
|
+
*lowercase alphanumeric* characters, the whole MRN case-insensitive and
|
|
37
|
+
conventionally lowercase (§5.1.3). The flavor emits:
|
|
38
|
+
|
|
39
|
+
----
|
|
40
|
+
urn:mrn:iala:pub:<doc-id>[:annex[-<letter>]][:ed<edition>][:<lang>]
|
|
41
|
+
----
|
|
42
|
+
|
|
43
|
+
[cols="3,1,4",options="header"]
|
|
44
|
+
|===
|
|
45
|
+
| segment | rule | source
|
|
46
|
+
| `urn:mrn:` | lowercase conventional (case-insensitive) | G1143 §5.1
|
|
47
|
+
| `iala` | IALA's Organization ID (min 3 lowercase alphanumerics, never
|
|
48
|
+
an ISO 3166-1 alpha-3 code) | G1164 §3.1; the portal's OID registry
|
|
49
|
+
row `urn:mrn:iala:`
|
|
50
|
+
| `pub` | the publication type, 3 lowercase alphanumerics (G1143 Annex
|
|
51
|
+
A4; the other defined types are `aton`, `vts`, `wwy`, and the
|
|
52
|
+
wildcards `obj`/`int`) | G1143 §5.2, Annex A
|
|
53
|
+
| `<doc-id>` | the lowercase document identifier in IALA's managed
|
|
54
|
+
namespace: the legacy series codes joined letter+number (`s1070`,
|
|
55
|
+
`r0126`, `c0103-1`, `m0001`, `ga01.01`, `l2.1.11`, `a12-01`, the
|
|
56
|
+
reserved `x0123`, `p0123`) and the S-100-family codes hyphenated
|
|
57
|
+
(`s-201` … `s-299`) | G1143 Annex A4
|
|
58
|
+
| `annex[-<letter>]` | the Annex wrapper (lettered form for `ANNEX`
|
|
59
|
+
A-style, bare for `Annex` without a letter; the letter carries the
|
|
60
|
+
sub-numbered S-100 annex letters, `annex-b2`) — a managed-namespace
|
|
61
|
+
extension; no cover prints it yet | G1143 Annex A4 (the managed
|
|
62
|
+
namespace is IALA's to define)
|
|
63
|
+
| `ed<edition>` | the edition glued after the lowercase `ed` marker,
|
|
64
|
+
digits verbatim in IALA's own face: dotted `x.y` for the legacy
|
|
65
|
+
series (`ed1.0`, `ed3.1`, `ed2.0` — the cover/footer forms of R1023,
|
|
66
|
+
G1143 and G1164, and G1164 §2's `urn:mrn:iala:pub:g1143:ed2.0`
|
|
67
|
+
example), dotted `x.y.z` for the S-100-family product specifications
|
|
68
|
+
(`ed2.0.0`, IALA S-201 Edition 2.0.0) | R1023/G1143/G1164 covers;
|
|
69
|
+
G1164 §2
|
|
70
|
+
| `<lang>` | one lowercase letter (`e`, `f`, `s`) — the catalogue's own
|
|
71
|
+
language suffix form (`urn:mrn:iala:pub:a12-01:e`) | relaton-data-iala
|
|
72
|
+
assigned MRNs
|
|
73
|
+
|===
|
|
74
|
+
|
|
75
|
+
=== Divergences found against the official rules (2026-11 revamp)
|
|
76
|
+
|
|
77
|
+
* The S-100-family product specifications were outside the grammar:
|
|
78
|
+
`S-201 2.0.0` raised in the flavor, the lower-case spelling fell to
|
|
79
|
+
the codeless `Publication` (`#to_urn` nil), and the bare string was
|
|
80
|
+
claimed by the WMO flavor's generic S-rule — the wrong organization's
|
|
81
|
+
namespace (`urn:mrn:wmo:pub:s-201:ed2.0.0`). The IHO grant fixes the
|
|
82
|
+
range (S-201..S-299, hundreds digit 2), the hyphenated lexical form,
|
|
83
|
+
and the dotted edition; the exact round trip on the bare face now
|
|
84
|
+
routes the strings here, while WMO keeps its own S-4xx (the
|
|
85
|
+
pubid#469/#763 dual-perspective law: the lexical form leads no
|
|
86
|
+
prefix; each org assigns its own identifier).
|
|
87
|
+
* Everything already attested was verified conformant and unchanged:
|
|
88
|
+
the 15 cover/footer URNs transcribed into the testsuite corpus and
|
|
89
|
+
the 687 catalogue-assigned MRNs in relaton-data-iala all match the
|
|
90
|
+
emission (lowercase doc id, `pub` type, glued `ed` marker, dotted
|
|
91
|
+
editions, `:lang` suffix). No frozen URN changed in the revamp.
|
|
92
|
+
* The corpus-attested malformed R1026 spellings (`Ed1.0`, `ed.1.0`)
|
|
93
|
+
stay parse-accepted as normalization aliases; the canonical emission
|
|
94
|
+
is the lowercase glued form.
|
|
95
|
+
|
|
96
|
+
=== Parse acceptance
|
|
97
|
+
|
|
98
|
+
The MRN is case-insensitive (G1143 §5.1.3): the namespace, the code,
|
|
99
|
+
the annex segments, the `ed` marker and the language letter all parse
|
|
100
|
+
in any case. The parser rebuilds the human identifier through the
|
|
101
|
+
grammar, so URN decode and string parse share one construction path.
|
|
102
|
+
|
|
103
|
+
== The pubid-scheme URN (`#to_pubid_urn`)
|
|
104
|
+
|
|
105
|
+
Namespace: `urn:pubid:iala:` (the `_type` flavor segment). Schema:
|
|
106
|
+
`lib/pubid/iala/pubid_urn_schema.rb`; the fleet-wide design rules live
|
|
107
|
+
in the root `CLAUDE.md`'s URN bullet (issue #656).
|
|
108
|
+
|
|
109
|
+
[cols="3,1,1,1,4",options="header"]
|
|
110
|
+
|===
|
|
111
|
+
| `_type` | token | core | example
|
|
112
|
+
| `pubid:iala:advice` | `advice` | number | `IALA A12-01`
|
|
113
|
+
| `pubid:iala:annex` | `annex` | number | `IALA G1045 Annex Ed 1`
|
|
114
|
+
| `pubid:iala:general-assembly` | `ga` | number | `IALA GA01.01`
|
|
115
|
+
| `pubid:iala:guideline` | `g` | number | `urn:mrn:iala:pub:g1195:ed1.0`
|
|
116
|
+
| `pubid:iala:identifier` | `id` | number | —
|
|
117
|
+
| `pubid:iala:letter` | `letter` | number | `IALA L2.1.11 Ed 2`
|
|
118
|
+
| `pubid:iala:manual` | `manual` | number | `IALA M0001 Ed 9.0`
|
|
119
|
+
| `pubid:iala:model-course` | `mc` | number | `urn:mrn:iala:pub:c0103-1:ed3.0`
|
|
120
|
+
| `pubid:iala:product-specification` | `ps` | number | `S-201 2.0.0`
|
|
121
|
+
| `pubid:iala:publication` | `pub` | number | `IALA arctic-seminar-report (E)`
|
|
122
|
+
| `pubid:iala:recommendation` | `rec` | number | `urn:mrn:iala:pub:r1023:ed1.0`
|
|
123
|
+
| `pubid:iala:report` | `rpt` | number | —
|
|
124
|
+
| `pubid:iala:resolution` | `r` | number | —
|
|
125
|
+
| `pubid:iala:standard` | `std` | number | `urn:mrn:iala:pub:s1040:ed2.0`
|
|
126
|
+
|===
|
|
127
|
+
|
|
128
|
+
Atoms, canonical order: `ed-` (`edition`), `lang-` (`language`),
|
|
129
|
+
`annexform-` (`annex_form`), `letter-` (`letter`).
|
|
130
|
+
|
|
131
|
+
The codeless publications (`pub`, the product-URL slug as core
|
|
132
|
+
`number`) have no official URN: `#to_urn` is nil, because IALA assigns
|
|
133
|
+
them no MRN (the #772 ruling).
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
module Pubid
|
|
4
4
|
module Iala
|
|
5
5
|
# Generates URN strings for IALA identifiers using the Maritime Resource
|
|
6
|
-
# Name (MRN) namespace that IALA prints on its cover pages
|
|
6
|
+
# Name (MRN) namespace that IALA prints on its cover pages — the
|
|
7
|
+
# official scheme of IALA Recommendation R1023 (Maritime Resource
|
|
8
|
+
# Names, Ed 1.0, whose own cover prints urn:mrn:iala:pub:r1023:ed1.0)
|
|
9
|
+
# and Guideline G1143 (Unique Identifiers for Maritime Resources):
|
|
10
|
+
# urn:mrn:<org>:<type>:<type-specific-part> with IALA's Organization
|
|
11
|
+
# ID "iala" (G1164) and the publication type "pub" (G1143 Annex A4).
|
|
7
12
|
#
|
|
8
13
|
# Format: urn:mrn:iala:pub:<type-lower><number>[:ed<edition>][:<lang-lower>]
|
|
9
14
|
# Example: urn:mrn:iala:pub:s1070:ed2.0
|
|
10
15
|
# urn:mrn:iala:pub:r1016:ed2.0:f
|
|
16
|
+
# urn:mrn:iala:pub:s-201:ed2.0.0 (the S-100-family code face)
|
|
11
17
|
class UrnGenerator
|
|
12
18
|
attr_reader :identifier
|
|
13
19
|
|
|
@@ -30,10 +36,10 @@ module Pubid
|
|
|
30
36
|
# (with optional letter suffix), then the annex's own edition/lang.
|
|
31
37
|
# G1045 Annex Ed 1 → urn:mrn:iala:pub:g1045:annex:ed1
|
|
32
38
|
# G1128 ANNEX A Ed 1.6 (E) → urn:mrn:iala:pub:g1128:annex-a:ed1.6:e
|
|
39
|
+
# S-201 ANNEX B2 → urn:mrn:iala:pub:s-201:annex-b2
|
|
33
40
|
def generate_annex
|
|
34
41
|
base = identifier.base
|
|
35
|
-
parts = ["urn:mrn:iala:pub",
|
|
36
|
-
"#{base.type_letter.downcase}#{base.number}"]
|
|
42
|
+
parts = ["urn:mrn:iala:pub", base_code_segment(base)]
|
|
37
43
|
annex_seg = identifier.letter ? "annex-#{identifier.letter.downcase}" : "annex"
|
|
38
44
|
parts << annex_seg
|
|
39
45
|
parts << "ed#{identifier.edition}" if identifier.edition
|
|
@@ -42,7 +48,19 @@ module Pubid
|
|
|
42
48
|
end
|
|
43
49
|
|
|
44
50
|
def code_segment
|
|
45
|
-
|
|
51
|
+
base_code_segment(identifier)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# The lowercase document identifier in IALA's managed namespace
|
|
55
|
+
# (G1143 §5.1.3: the MRN is case-insensitive, conventionally
|
|
56
|
+
# written lowercase): the legacy series codes join letter and
|
|
57
|
+
# number ("s1070"), the S-100-family codes hyphenate ("s-201").
|
|
58
|
+
def base_code_segment(base)
|
|
59
|
+
if base.is_a?(Identifiers::ProductSpecification)
|
|
60
|
+
"s-#{base.number}"
|
|
61
|
+
else
|
|
62
|
+
"#{base.type_letter.downcase}#{base.number}"
|
|
63
|
+
end
|
|
46
64
|
end
|
|
47
65
|
end
|
|
48
66
|
end
|
|
@@ -15,8 +15,10 @@ module Pubid
|
|
|
15
15
|
# urn:mrn:iala:pub:c0103-1 → IALA C0103-1
|
|
16
16
|
# urn:mrn:iala:pub:g1045:annex:ed1 → IALA G1045 Annex Ed 1
|
|
17
17
|
# urn:mrn:iala:pub:g1128:annex-a:ed1.6 → IALA G1128 ANNEX A Ed 1.6
|
|
18
|
+
# urn:mrn:iala:pub:s-201:ed2.0.0 → IALA S-201 2.0.0
|
|
19
|
+
# urn:mrn:iala:pub:s-201:annex-b2 → IALA S-201 ANNEX B2
|
|
18
20
|
class UrnParser < Pubid::UrnParser::Base
|
|
19
|
-
PREFIX = "urn:mrn:iala:pub:"
|
|
21
|
+
PREFIX = "urn:mrn:iala:pub:"
|
|
20
22
|
|
|
21
23
|
def parse_urn(urn)
|
|
22
24
|
body = strip_namespace(urn)
|
|
@@ -30,17 +32,18 @@ module Pubid
|
|
|
30
32
|
|
|
31
33
|
parts.drop(1).each do |seg|
|
|
32
34
|
case seg
|
|
33
|
-
when /\Aannex(-([a-z]))?\z/i
|
|
35
|
+
when /\Aannex(-([a-z]\d?))?\z/i
|
|
34
36
|
# UrnGenerator emits "annex" (bare) for the Annex-without-letter
|
|
35
37
|
# form and "annex-X" (lettered) for the uppercase ANNEX form.
|
|
36
38
|
# The human parser accepts both "Annex" and "ANNEX"; mirror the
|
|
37
|
-
# generator's casing so URN round-trip is exact.
|
|
39
|
+
# generator's casing so URN round-trip is exact. The letter
|
|
40
|
+
# carries the sub-numbered S-100 annex letters ("annex-b2").
|
|
38
41
|
annex_letter = Regexp.last_match(2)&.upcase
|
|
39
42
|
annex_form = annex_letter ? "ANNEX" : "Annex"
|
|
40
43
|
# Edition marker: case-insensitive with an optional separator dot.
|
|
41
44
|
# Both variants occur in published documents (R1026 prints
|
|
42
45
|
# "Ed1.0" and "ed.1.0"); each parses to the canonical edition
|
|
43
|
-
# value and re-renders as lowercase "ed<x.
|
|
46
|
+
# value and re-renders as lowercase "ed<x.y[.z]>".
|
|
44
47
|
when /\Aed\.?/i
|
|
45
48
|
edition = seg.sub(/\Aed\.?/i, "")
|
|
46
49
|
when /\A[a-z]\z/i
|
|
@@ -51,6 +54,9 @@ module Pubid
|
|
|
51
54
|
text = "IALA #{code.upcase}"
|
|
52
55
|
text += " #{annex_form}" if annex_form
|
|
53
56
|
text += " #{annex_letter}" if annex_letter
|
|
57
|
+
# The S-100-family codes carry the bare dotted edition on the
|
|
58
|
+
# human face; the rebuilt text names the edition through the
|
|
59
|
+
# grammar's "Ed" alias and the renderer restores the bare face.
|
|
54
60
|
text += " Ed #{edition}" if edition
|
|
55
61
|
text += " (#{language})" if language
|
|
56
62
|
flavor_parse(text)
|
data/lib/pubid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pubid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.53
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -675,6 +675,7 @@ files:
|
|
|
675
675
|
- lib/pubid/iala/identifiers/letter.rb
|
|
676
676
|
- lib/pubid/iala/identifiers/manual.rb
|
|
677
677
|
- lib/pubid/iala/identifiers/model_course.rb
|
|
678
|
+
- lib/pubid/iala/identifiers/product_specification.rb
|
|
678
679
|
- lib/pubid/iala/identifiers/publication.rb
|
|
679
680
|
- lib/pubid/iala/identifiers/recommendation.rb
|
|
680
681
|
- lib/pubid/iala/identifiers/report.rb
|
|
@@ -683,6 +684,7 @@ files:
|
|
|
683
684
|
- lib/pubid/iala/parser.rb
|
|
684
685
|
- lib/pubid/iala/pubid_urn_schema.rb
|
|
685
686
|
- lib/pubid/iala/renderer.rb
|
|
687
|
+
- lib/pubid/iala/urn.adoc
|
|
686
688
|
- lib/pubid/iala/urn_generator.rb
|
|
687
689
|
- lib/pubid/iala/urn_parser.rb
|
|
688
690
|
- lib/pubid/iana.rb
|