pubid 2.0.0.pre.alpha.8 → 2.0.0.pre.alpha.9

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 (484) hide show
  1. checksums.yaml +4 -4
  2. data/data/bipm/update_codes.yaml +9 -0
  3. data/data/iec/update_codes.yaml +3 -0
  4. data/data/ieee/update_codes.yaml +107 -1
  5. data/data/nist/series.yaml +155 -0
  6. data/data/nist/update_codes.yaml +8 -0
  7. data/lib/pubid/adobe/builder.rb +52 -0
  8. data/lib/pubid/adobe/identifier.rb +49 -0
  9. data/lib/pubid/adobe/identifiers/publication.rb +31 -0
  10. data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
  11. data/lib/pubid/adobe/identifiers.rb +10 -0
  12. data/lib/pubid/adobe/parser.rb +128 -0
  13. data/lib/pubid/adobe/renderer.rb +39 -0
  14. data/lib/pubid/adobe/urn_generator.rb +42 -0
  15. data/lib/pubid/adobe/urn_parser.rb +69 -0
  16. data/lib/pubid/adobe.rb +60 -0
  17. data/lib/pubid/amca/builder.rb +2 -2
  18. data/lib/pubid/amca/identifier.rb +1 -3
  19. data/lib/pubid/amca/identifiers/base.rb +1 -6
  20. data/lib/pubid/amca/identifiers/interpretation.rb +1 -1
  21. data/lib/pubid/amca/identifiers/publication.rb +1 -1
  22. data/lib/pubid/amca/identifiers/standard.rb +1 -1
  23. data/lib/pubid/amca/identifiers.rb +0 -1
  24. data/lib/pubid/amca/single_identifier.rb +1 -1
  25. data/lib/pubid/amca.rb +3 -3
  26. data/lib/pubid/ashrae/builder.rb +22 -22
  27. data/lib/pubid/ashrae/identifier.rb +3 -4
  28. data/lib/pubid/ashrae/identifiers/addenda_package.rb +1 -1
  29. data/lib/pubid/ashrae/identifiers/addendum.rb +1 -1
  30. data/lib/pubid/ashrae/identifiers/base.rb +14 -8
  31. data/lib/pubid/ashrae/identifiers/combined_addenda.rb +1 -1
  32. data/lib/pubid/ashrae/identifiers.rb +0 -1
  33. data/lib/pubid/ashrae/parser.rb +14 -9
  34. data/lib/pubid/ashrae/renderer.rb +19 -19
  35. data/lib/pubid/ashrae/single_identifier.rb +1 -1
  36. data/lib/pubid/ashrae/supplement_identifier.rb +6 -6
  37. data/lib/pubid/ashrae.rb +3 -3
  38. data/lib/pubid/bipm/builder.rb +107 -0
  39. data/lib/pubid/bipm/identifier.rb +160 -0
  40. data/lib/pubid/bipm/identifiers/committee_document.rb +24 -0
  41. data/lib/pubid/bipm/identifiers/guide.rb +24 -0
  42. data/lib/pubid/bipm/identifiers/meeting.rb +41 -0
  43. data/lib/pubid/bipm/identifiers/mep.rb +21 -0
  44. data/lib/pubid/bipm/identifiers/metrologia_article.rb +24 -0
  45. data/lib/pubid/bipm/identifiers/si_brochure.rb +20 -0
  46. data/lib/pubid/bipm/identifiers.rb +15 -0
  47. data/lib/pubid/bipm/parser.rb +184 -0
  48. data/lib/pubid/bipm/renderer.rb +110 -0
  49. data/lib/pubid/bipm/urn_generator.rb +58 -0
  50. data/lib/pubid/bipm/urn_parser.rb +52 -0
  51. data/lib/pubid/bipm.rb +86 -0
  52. data/lib/pubid/bsi/builder.rb +14 -14
  53. data/lib/pubid/bsi/identifier.rb +0 -1
  54. data/lib/pubid/bsi/identifiers/addendum_document.rb +2 -2
  55. data/lib/pubid/bsi/identifiers/amendment.rb +4 -4
  56. data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +6 -0
  57. data/lib/pubid/bsi/identifiers/corrigendum.rb +4 -4
  58. data/lib/pubid/bsi/identifiers/expert_commentary.rb +5 -5
  59. data/lib/pubid/bsi/identifiers/supplement_document.rb +2 -2
  60. data/lib/pubid/bsi/identifiers/value_added_publication.rb +6 -6
  61. data/lib/pubid/bsi/renderer.rb +8 -8
  62. data/lib/pubid/bsi/single_identifier.rb +48 -0
  63. data/lib/pubid/builder/base.rb +5 -3
  64. data/lib/pubid/bundled_identifier.rb +3 -3
  65. data/lib/pubid/calconnect/builder.rb +38 -0
  66. data/lib/pubid/calconnect/identifier.rb +117 -0
  67. data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
  68. data/lib/pubid/calconnect/identifiers.rb +9 -0
  69. data/lib/pubid/calconnect/parser.rb +54 -0
  70. data/lib/pubid/calconnect/renderer.rb +36 -0
  71. data/lib/pubid/calconnect/urn_generator.rb +33 -0
  72. data/lib/pubid/calconnect/urn_parser.rb +34 -0
  73. data/lib/pubid/calconnect.rb +77 -0
  74. data/lib/pubid/ccsds/builder.rb +1 -1
  75. data/lib/pubid/ccsds/identifier.rb +1 -1
  76. data/lib/pubid/ccsds/identifiers/corrigendum.rb +2 -2
  77. data/lib/pubid/ccsds/supplement_identifier.rb +6 -6
  78. data/lib/pubid/ccsds/urn_generator.rb +3 -3
  79. data/lib/pubid/cen_cenelec/builder.rb +46 -12
  80. data/lib/pubid/cen_cenelec/identifiers/amendment.rb +2 -2
  81. data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +6 -0
  82. data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +2 -2
  83. data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +60 -3
  84. data/lib/pubid/cen_cenelec/identifiers/fragment.rb +2 -2
  85. data/lib/pubid/cen_cenelec/renderer.rb +5 -5
  86. data/lib/pubid/cen_cenelec/supplement_identifier.rb +5 -5
  87. data/lib/pubid/cen_cenelec/urn_generator.rb +1 -1
  88. data/lib/pubid/cen_cenelec.rb +76 -72
  89. data/lib/pubid/cie/builder.rb +139 -24
  90. data/lib/pubid/cie/identifier.rb +7 -3
  91. data/lib/pubid/cie/identifiers/bundle.rb +32 -4
  92. data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
  93. data/lib/pubid/cie/identifiers/conference.rb +9 -4
  94. data/lib/pubid/cie/identifiers/corrigendum.rb +17 -23
  95. data/lib/pubid/cie/identifiers/dual_published.rb +4 -4
  96. data/lib/pubid/cie/identifiers/identical.rb +7 -7
  97. data/lib/pubid/cie/identifiers/joint_published.rb +8 -8
  98. data/lib/pubid/cie/identifiers/proceedings.rb +39 -0
  99. data/lib/pubid/cie/identifiers/standard.rb +33 -7
  100. data/lib/pubid/cie/identifiers/supplement.rb +24 -22
  101. data/lib/pubid/cie/identifiers/tutorial_bundle.rb +6 -2
  102. data/lib/pubid/cie/identifiers.rb +2 -0
  103. data/lib/pubid/cie/parser.rb +54 -5
  104. data/lib/pubid/cie/single_identifier.rb +40 -1
  105. data/lib/pubid/cie/supplement_identifier.rb +29 -16
  106. data/lib/pubid/cie/urn_generator.rb +11 -8
  107. data/lib/pubid/cie.rb +0 -1
  108. data/lib/pubid/components/date.rb +21 -5
  109. data/lib/pubid/csa/builder.rb +1 -1
  110. data/lib/pubid/csa/composite_identifier.rb +17 -1
  111. data/lib/pubid/csa/identifier.rb +48 -3
  112. data/lib/pubid/csa/identifiers/bundled.rb +6 -0
  113. data/lib/pubid/csa/identifiers/combined.rb +6 -0
  114. data/lib/pubid/csa/identifiers/package.rb +2 -2
  115. data/lib/pubid/csa/parser.rb +6 -6
  116. data/lib/pubid/csa/wrapper_identifier.rb +17 -0
  117. data/lib/pubid/doi/builder.rb +18 -0
  118. data/lib/pubid/doi/identifier.rb +46 -0
  119. data/lib/pubid/doi/identifiers/resource.rb +30 -0
  120. data/lib/pubid/doi/identifiers.rb +9 -0
  121. data/lib/pubid/doi/parser.rb +52 -0
  122. data/lib/pubid/doi/renderer.rb +13 -0
  123. data/lib/pubid/doi.rb +55 -0
  124. data/lib/pubid/easc/builder.rb +55 -0
  125. data/lib/pubid/easc/identifier.rb +61 -0
  126. data/lib/pubid/easc/identifiers/pmg.rb +20 -0
  127. data/lib/pubid/easc/identifiers/rmg.rb +19 -0
  128. data/lib/pubid/easc/identifiers.rb +10 -0
  129. data/lib/pubid/easc/parser.rb +80 -0
  130. data/lib/pubid/easc/renderer.rb +48 -0
  131. data/lib/pubid/easc/urn_generator.rb +46 -0
  132. data/lib/pubid/easc/urn_parser.rb +57 -0
  133. data/lib/pubid/easc.rb +52 -0
  134. data/lib/pubid/ecma/builder.rb +31 -0
  135. data/lib/pubid/ecma/identifier.rb +76 -0
  136. data/lib/pubid/ecma/identifiers/memento.rb +30 -0
  137. data/lib/pubid/ecma/identifiers/standard.rb +31 -0
  138. data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
  139. data/lib/pubid/ecma/identifiers.rb +11 -0
  140. data/lib/pubid/ecma/parser.rb +41 -0
  141. data/lib/pubid/ecma/renderer.rb +46 -0
  142. data/lib/pubid/ecma/urn_generator.rb +25 -0
  143. data/lib/pubid/ecma/urn_parser.rb +35 -0
  144. data/lib/pubid/ecma.rb +67 -0
  145. data/lib/pubid/etsi/builder.rb +7 -3
  146. data/lib/pubid/etsi/identifier.rb +1 -3
  147. data/lib/pubid/etsi/identifiers/base.rb +28 -10
  148. data/lib/pubid/etsi/identifiers/etsi_standard.rb +128 -4
  149. data/lib/pubid/etsi/identifiers/supplement_identifier.rb +35 -3
  150. data/lib/pubid/etsi/identifiers.rb +0 -1
  151. data/lib/pubid/etsi/parser.rb +8 -2
  152. data/lib/pubid/etsi/renderer.rb +8 -2
  153. data/lib/pubid/etsi.rb +5 -5
  154. data/lib/pubid/export/exporter.rb +2 -1
  155. data/lib/pubid/export/flavor_exporter.rb +18 -3
  156. data/lib/pubid/gb/builder.rb +45 -0
  157. data/lib/pubid/gb/identifier.rb +64 -0
  158. data/lib/pubid/gb/identifiers/standard.rb +34 -0
  159. data/lib/pubid/gb/identifiers.rb +9 -0
  160. data/lib/pubid/gb/parser.rb +63 -0
  161. data/lib/pubid/gb/renderer.rb +35 -0
  162. data/lib/pubid/gb.rb +87 -0
  163. data/lib/pubid/gost/builder.rb +148 -0
  164. data/lib/pubid/gost/identifier.rb +49 -0
  165. data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
  166. data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
  167. data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
  168. data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
  169. data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
  170. data/lib/pubid/gost/identifiers.rb +13 -0
  171. data/lib/pubid/gost/parser.rb +97 -0
  172. data/lib/pubid/gost/renderer.rb +48 -0
  173. data/lib/pubid/gost/urn_generator.rb +46 -0
  174. data/lib/pubid/gost/urn_parser.rb +52 -0
  175. data/lib/pubid/gost.rb +49 -0
  176. data/lib/pubid/iala/builder.rb +22 -27
  177. data/lib/pubid/iala/identifier.rb +27 -2
  178. data/lib/pubid/iala/identifiers/advice.rb +1 -1
  179. data/lib/pubid/iala/identifiers/annex.rb +10 -10
  180. data/lib/pubid/iala/identifiers/general_assembly.rb +5 -2
  181. data/lib/pubid/iala/identifiers/guideline.rb +3 -1
  182. data/lib/pubid/iala/identifiers/letter.rb +1 -1
  183. data/lib/pubid/iala/identifiers/manual.rb +3 -1
  184. data/lib/pubid/iala/identifiers/model_course.rb +3 -1
  185. data/lib/pubid/iala/identifiers/recommendation.rb +3 -1
  186. data/lib/pubid/iala/identifiers/report.rb +1 -1
  187. data/lib/pubid/iala/identifiers/resolution.rb +1 -1
  188. data/lib/pubid/iala/identifiers/standard.rb +3 -1
  189. data/lib/pubid/iala/identifiers.rb +0 -1
  190. data/lib/pubid/iala/renderer.rb +1 -1
  191. data/lib/pubid/iala/urn_generator.rb +1 -1
  192. data/lib/pubid/iala/urn_parser.rb +19 -2
  193. data/lib/pubid/iala.rb +4 -4
  194. data/lib/pubid/iana/builder.rb +20 -0
  195. data/lib/pubid/iana/identifier.rb +72 -0
  196. data/lib/pubid/iana/identifiers/registry.rb +33 -0
  197. data/lib/pubid/iana/identifiers.rb +9 -0
  198. data/lib/pubid/iana/parser.rb +38 -0
  199. data/lib/pubid/iana/renderer.rb +29 -0
  200. data/lib/pubid/iana/urn_generator.rb +15 -0
  201. data/lib/pubid/iana/urn_parser.rb +24 -0
  202. data/lib/pubid/iana.rb +69 -0
  203. data/lib/pubid/identifier.rb +210 -23
  204. data/lib/pubid/idf/builder.rb +1 -1
  205. data/lib/pubid/idf/parser.rb +2 -2
  206. data/lib/pubid/idf/renderer.rb +1 -1
  207. data/lib/pubid/idf/supplement_identifier.rb +3 -3
  208. data/lib/pubid/iec/builder.rb +35 -25
  209. data/lib/pubid/iec/identifier.rb +47 -2
  210. data/lib/pubid/iec/identifiers/base.rb +2 -2
  211. data/lib/pubid/iec/identifiers/consolidated_identifier.rb +6 -0
  212. data/lib/pubid/iec/identifiers/fragment_identifier.rb +11 -11
  213. data/lib/pubid/iec/identifiers/international_standard.rb +8 -5
  214. data/lib/pubid/iec/identifiers/sheet_identifier.rb +12 -12
  215. data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
  216. data/lib/pubid/iec/identifiers/technical_report.rb +1 -1
  217. data/lib/pubid/iec/identifiers/technical_specification.rb +1 -1
  218. data/lib/pubid/iec/identifiers/vap_identifier.rb +12 -12
  219. data/lib/pubid/iec/identifiers.rb +1 -0
  220. data/lib/pubid/iec/parser.rb +51 -10
  221. data/lib/pubid/iec/renderer.rb +18 -8
  222. data/lib/pubid/iec/single_identifier.rb +1 -1
  223. data/lib/pubid/iec/supplement_identifier.rb +32 -19
  224. data/lib/pubid/iec.rb +1 -6
  225. data/lib/pubid/ieee/aiee/builder.rb +17 -3
  226. data/lib/pubid/ieee/aiee/identifier.rb +45 -61
  227. data/lib/pubid/ieee/builder.rb +341 -68
  228. data/lib/pubid/ieee/compaction.rb +121 -0
  229. data/lib/pubid/ieee/components/draft.rb +47 -7
  230. data/lib/pubid/ieee/identifier.rb +1 -3
  231. data/lib/pubid/ieee/identifiers/adopted_standard.rb +30 -5
  232. data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
  233. data/lib/pubid/ieee/identifiers/base.rb +106 -13
  234. data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
  235. data/lib/pubid/ieee/identifiers/conformance_identifier.rb +6 -2
  236. data/lib/pubid/ieee/identifiers/corrigendum.rb +17 -2
  237. data/lib/pubid/ieee/identifiers/csa_dual_published.rb +3 -3
  238. data/lib/pubid/ieee/identifiers/dual_identifier.rb +3 -3
  239. data/lib/pubid/ieee/identifiers/dual_published.rb +3 -3
  240. data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +102 -5
  241. data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +2 -1
  242. data/lib/pubid/ieee/identifiers/joint_development.rb +56 -11
  243. data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +1 -1
  244. data/lib/pubid/ieee/identifiers/nesc/base.rb +90 -19
  245. data/lib/pubid/ieee/identifiers/nesc/draft.rb +20 -5
  246. data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
  247. data/lib/pubid/ieee/identifiers/nesc/handbook.rb +16 -5
  248. data/lib/pubid/ieee/identifiers/nesc/redline.rb +11 -2
  249. data/lib/pubid/ieee/identifiers/nesc/standard.rb +18 -3
  250. data/lib/pubid/ieee/identifiers/nesc.rb +1 -0
  251. data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +3 -3
  252. data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +14 -6
  253. data/lib/pubid/ieee/identifiers/redlined_standard.rb +4 -4
  254. data/lib/pubid/ieee/identifiers/si_standard.rb +4 -1
  255. data/lib/pubid/ieee/identifiers/standard.rb +4 -1
  256. data/lib/pubid/ieee/identifiers/supplement_identifier.rb +26 -7
  257. data/lib/pubid/ieee/identifiers.rb +2 -1
  258. data/lib/pubid/ieee/ire/builder.rb +7 -6
  259. data/lib/pubid/ieee/ire/identifier.rb +48 -33
  260. data/lib/pubid/ieee/nesc/builder.rb +33 -20
  261. data/lib/pubid/ieee/nesc/parser.rb +15 -14
  262. data/lib/pubid/ieee/parser.rb +461 -43
  263. data/lib/pubid/ieee/pre_parser.rb +1 -1
  264. data/lib/pubid/ieee/renderer.rb +154 -57
  265. data/lib/pubid/ieee/typed_stages.rb +12 -1
  266. data/lib/pubid/ieee/urn_generator.rb +3 -5
  267. data/lib/pubid/ieee.rb +56 -3
  268. data/lib/pubid/ietf/builder.rb +62 -0
  269. data/lib/pubid/ietf/identifier.rb +5 -0
  270. data/lib/pubid/ietf/identifiers/base.rb +75 -0
  271. data/lib/pubid/ietf/identifiers/bcp.rb +25 -0
  272. data/lib/pubid/ietf/identifiers/fyi.rb +25 -0
  273. data/lib/pubid/ietf/identifiers/internet_draft.rb +29 -0
  274. data/lib/pubid/ietf/identifiers/rfc.rb +25 -0
  275. data/lib/pubid/ietf/identifiers/std.rb +25 -0
  276. data/lib/pubid/ietf/identifiers.rb +13 -0
  277. data/lib/pubid/ietf/parser.rb +43 -0
  278. data/lib/pubid/ietf/renderer.rb +26 -0
  279. data/lib/pubid/ietf/urn_generator.rb +23 -0
  280. data/lib/pubid/ietf/urn_parser.rb +35 -0
  281. data/lib/pubid/ietf.rb +76 -0
  282. data/lib/pubid/iho/identifier.rb +1 -3
  283. data/lib/pubid/iho/identifiers/base.rb +1 -7
  284. data/lib/pubid/iho/identifiers/bibliographic.rb +1 -1
  285. data/lib/pubid/iho/identifiers/circular_letter.rb +1 -1
  286. data/lib/pubid/iho/identifiers/miscellaneous.rb +1 -1
  287. data/lib/pubid/iho/identifiers/publication.rb +1 -1
  288. data/lib/pubid/iho/identifiers/standard.rb +1 -1
  289. data/lib/pubid/iho/identifiers.rb +0 -1
  290. data/lib/pubid/iho.rb +7 -7
  291. data/lib/pubid/isbn/builder.rb +44 -0
  292. data/lib/pubid/isbn/check_digit.rb +53 -0
  293. data/lib/pubid/isbn/identifier.rb +63 -0
  294. data/lib/pubid/isbn/identifiers/book.rb +30 -0
  295. data/lib/pubid/isbn/identifiers.rb +9 -0
  296. data/lib/pubid/isbn/parser.rb +45 -0
  297. data/lib/pubid/isbn/renderer.rb +16 -0
  298. data/lib/pubid/isbn.rb +52 -0
  299. data/lib/pubid/iso/builder.rb +9 -4
  300. data/lib/pubid/iso/combined_identifier.rb +2 -2
  301. data/lib/pubid/iso/identifier.rb +17 -1
  302. data/lib/pubid/iso/identifiers/directives_supplement.rb +8 -8
  303. data/lib/pubid/iso/normalizer.rb +2 -2
  304. data/lib/pubid/iso/parser.rb +16 -12
  305. data/lib/pubid/iso/supplement_identifier.rb +19 -6
  306. data/lib/pubid/iso/urn_generator.rb +4 -1
  307. data/lib/pubid/iso/urn_parser.rb +1 -1
  308. data/lib/pubid/itu/builder.rb +230 -29
  309. data/lib/pubid/itu/components/code.rb +48 -5
  310. data/lib/pubid/itu/components/designation.rb +35 -0
  311. data/lib/pubid/itu/components.rb +1 -0
  312. data/lib/pubid/itu/identifier.rb +1 -3
  313. data/lib/pubid/itu/identifiers/addendum.rb +15 -0
  314. data/lib/pubid/itu/identifiers/amendment.rb +6 -28
  315. data/lib/pubid/itu/identifiers/annex.rb +13 -2
  316. data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
  317. data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
  318. data/lib/pubid/itu/identifiers/base.rb +341 -23
  319. data/lib/pubid/itu/identifiers/combined_identifier.rb +99 -23
  320. data/lib/pubid/itu/identifiers/corrigendum.rb +16 -23
  321. data/lib/pubid/itu/identifiers/errata.rb +15 -0
  322. data/lib/pubid/itu/identifiers/handbook.rb +38 -0
  323. data/lib/pubid/itu/identifiers/question.rb +63 -0
  324. data/lib/pubid/itu/identifiers/recommendation.rb +3 -2
  325. data/lib/pubid/itu/identifiers/report.rb +39 -0
  326. data/lib/pubid/itu/identifiers/special_publication.rb +3 -1
  327. data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
  328. data/lib/pubid/itu/identifiers/supplement.rb +119 -14
  329. data/lib/pubid/itu/identifiers.rb +10 -1
  330. data/lib/pubid/itu/model.rb +1 -1
  331. data/lib/pubid/itu/parser.rb +480 -26
  332. data/lib/pubid/itu/urn_generator.rb +36 -6
  333. data/lib/pubid/itu/urn_parser.rb +8 -0
  334. data/lib/pubid/itu.rb +11 -3
  335. data/lib/pubid/jcgm/builder.rb +23 -13
  336. data/lib/pubid/jcgm/identifiers/amendment.rb +0 -2
  337. data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
  338. data/lib/pubid/jcgm/identifiers/gum_guide.rb +3 -3
  339. data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
  340. data/lib/pubid/jcgm/identifiers.rb +2 -0
  341. data/lib/pubid/jcgm/parser.rb +66 -6
  342. data/lib/pubid/jcgm/renderer.rb +26 -12
  343. data/lib/pubid/jcgm/single_identifier.rb +74 -5
  344. data/lib/pubid/jcgm/supplement_identifier.rb +39 -4
  345. data/lib/pubid/jcgm/urn_generator.rb +21 -13
  346. data/lib/pubid/jcgm/urn_parser.rb +15 -3
  347. data/lib/pubid/jis/identifier.rb +52 -0
  348. data/lib/pubid/nist/builder.rb +29 -9
  349. data/lib/pubid/nist/caster.rb +7 -45
  350. data/lib/pubid/nist/circular_supplement_builder.rb +7 -5
  351. data/lib/pubid/nist/components/supplement.rb +5 -2
  352. data/lib/pubid/nist/configuration.rb +7 -1
  353. data/lib/pubid/nist/identifier.rb +1 -3
  354. data/lib/pubid/nist/identifiers/base.rb +121 -37
  355. data/lib/pubid/nist/identifiers/circular.rb +1 -1
  356. data/lib/pubid/nist/identifiers/commercial_standard.rb +1 -1
  357. data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +1 -1
  358. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +1 -1
  359. data/lib/pubid/nist/identifiers/crpl_report.rb +1 -1
  360. data/lib/pubid/nist/identifiers/dated_document.rb +1 -1
  361. data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +1 -1
  362. data/lib/pubid/nist/identifiers/grant_contractor_report.rb +1 -1
  363. data/lib/pubid/nist/identifiers/handbook.rb +1 -1
  364. data/lib/pubid/nist/identifiers/internal_report.rb +1 -1
  365. data/lib/pubid/nist/identifiers/letter_circular.rb +1 -1
  366. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +1 -1
  367. data/lib/pubid/nist/identifiers/monograph.rb +1 -1
  368. data/lib/pubid/nist/identifiers/ncstar.rb +2 -2
  369. data/lib/pubid/nist/identifiers/nsrds.rb +1 -1
  370. data/lib/pubid/nist/identifiers/owmwp.rb +1 -1
  371. data/lib/pubid/nist/identifiers/report.rb +1 -1
  372. data/lib/pubid/nist/identifiers/special_publication.rb +10 -1
  373. data/lib/pubid/nist/identifiers/technical_note.rb +1 -1
  374. data/lib/pubid/nist/identifiers.rb +0 -1
  375. data/lib/pubid/nist/parser.rb +26 -3
  376. data/lib/pubid/nist/preprocessor.rb +15 -0
  377. data/lib/pubid/nist/router.rb +2 -2
  378. data/lib/pubid/nist/series/ir.rb +0 -3
  379. data/lib/pubid/nist/supplement_identifier.rb +9 -9
  380. data/lib/pubid/nist.rb +12 -12
  381. data/lib/pubid/oasis/builder.rb +77 -0
  382. data/lib/pubid/oasis/identifier.rb +82 -0
  383. data/lib/pubid/oasis/identifiers/standard.rb +29 -0
  384. data/lib/pubid/oasis/identifiers.rb +9 -0
  385. data/lib/pubid/oasis/parser.rb +34 -0
  386. data/lib/pubid/oasis/renderer.rb +29 -0
  387. data/lib/pubid/oasis/urn_generator.rb +25 -0
  388. data/lib/pubid/oasis/urn_parser.rb +22 -0
  389. data/lib/pubid/oasis.rb +74 -0
  390. data/lib/pubid/ogc/builder.rb +33 -0
  391. data/lib/pubid/ogc/identifier.rb +77 -0
  392. data/lib/pubid/ogc/identifiers/document.rb +26 -0
  393. data/lib/pubid/ogc/identifiers.rb +10 -0
  394. data/lib/pubid/ogc/parser.rb +40 -0
  395. data/lib/pubid/ogc/renderer.rb +33 -0
  396. data/lib/pubid/ogc/urn_generator.rb +14 -0
  397. data/lib/pubid/ogc/urn_parser.rb +22 -0
  398. data/lib/pubid/ogc.rb +71 -0
  399. data/lib/pubid/oiml/builder.rb +31 -7
  400. data/lib/pubid/oiml/identifier.rb +9 -1
  401. data/lib/pubid/oiml/parser.rb +11 -12
  402. data/lib/pubid/oiml/renderer.rb +13 -13
  403. data/lib/pubid/oiml/single_identifier.rb +20 -0
  404. data/lib/pubid/oiml/supplement_identifier.rb +9 -9
  405. data/lib/pubid/oiml/urn_parser.rb +23 -6
  406. data/lib/pubid/oiml.rb +4 -0
  407. data/lib/pubid/omg/builder.rb +19 -0
  408. data/lib/pubid/omg/identifier.rb +44 -0
  409. data/lib/pubid/omg/identifiers/specification.rb +32 -0
  410. data/lib/pubid/omg/identifiers.rb +9 -0
  411. data/lib/pubid/omg/parser.rb +40 -0
  412. data/lib/pubid/omg/renderer.rb +19 -0
  413. data/lib/pubid/omg.rb +51 -0
  414. data/lib/pubid/parsers/mr_string.rb +101 -7
  415. data/lib/pubid/plateau/builder.rb +8 -4
  416. data/lib/pubid/plateau/identifier.rb +1 -3
  417. data/lib/pubid/plateau/identifiers/base.rb +1 -6
  418. data/lib/pubid/plateau/identifiers/handbook.rb +1 -1
  419. data/lib/pubid/plateau/identifiers/technical_report.rb +1 -1
  420. data/lib/pubid/plateau/identifiers.rb +0 -1
  421. data/lib/pubid/plateau/parser.rb +15 -5
  422. data/lib/pubid/plateau/renderer.rb +1 -1
  423. data/lib/pubid/plateau/supplement_identifier.rb +11 -11
  424. data/lib/pubid/plateau.rb +4 -4
  425. data/lib/pubid/renderers/human_readable.rb +3 -1
  426. data/lib/pubid/renderers/mr_string.rb +46 -4
  427. data/lib/pubid/renderers/supplement_renderer.rb +1 -1
  428. data/lib/pubid/rendering/supplement.rb +4 -4
  429. data/lib/pubid/sae/builder.rb +1 -1
  430. data/lib/pubid/sae/identifier.rb +1 -3
  431. data/lib/pubid/sae/identifiers/base.rb +10 -7
  432. data/lib/pubid/sae/identifiers.rb +0 -1
  433. data/lib/pubid/sae.rb +3 -3
  434. data/lib/pubid/tgpp/builder.rb +41 -0
  435. data/lib/pubid/tgpp/identifier.rb +91 -0
  436. data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
  437. data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
  438. data/lib/pubid/tgpp/identifiers.rb +11 -0
  439. data/lib/pubid/tgpp/parser.rb +62 -0
  440. data/lib/pubid/tgpp/renderer.rb +36 -0
  441. data/lib/pubid/tgpp/urn_generator.rb +20 -0
  442. data/lib/pubid/tgpp/urn_parser.rb +28 -0
  443. data/lib/pubid/tgpp.rb +78 -0
  444. data/lib/pubid/type_resolver.rb +59 -0
  445. data/lib/pubid/un/builder.rb +42 -0
  446. data/lib/pubid/un/identifier.rb +37 -0
  447. data/lib/pubid/un/identifiers/document.rb +24 -0
  448. data/lib/pubid/un/identifiers.rb +9 -0
  449. data/lib/pubid/un/parser.rb +25 -0
  450. data/lib/pubid/un/renderer.rb +11 -0
  451. data/lib/pubid/un.rb +46 -0
  452. data/lib/pubid/version.rb +1 -1
  453. data/lib/pubid/w3c/builder.rb +55 -0
  454. data/lib/pubid/w3c/identifier.rb +101 -0
  455. data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
  456. data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
  457. data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
  458. data/lib/pubid/w3c/identifiers/note.rb +30 -0
  459. data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
  460. data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
  461. data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
  462. data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
  463. data/lib/pubid/w3c/identifiers/standard.rb +12 -0
  464. data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
  465. data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
  466. data/lib/pubid/w3c/identifiers.rb +25 -0
  467. data/lib/pubid/w3c/parser.rb +43 -0
  468. data/lib/pubid/w3c/renderer.rb +35 -0
  469. data/lib/pubid/w3c/urn_generator.rb +18 -0
  470. data/lib/pubid/w3c/urn_parser.rb +36 -0
  471. data/lib/pubid/w3c.rb +67 -0
  472. data/lib/pubid/xsf/builder.rb +17 -0
  473. data/lib/pubid/xsf/identifier.rb +62 -0
  474. data/lib/pubid/xsf/identifiers/xep.rb +31 -0
  475. data/lib/pubid/xsf/identifiers.rb +9 -0
  476. data/lib/pubid/xsf/parser.rb +25 -0
  477. data/lib/pubid/xsf/renderer.rb +23 -0
  478. data/lib/pubid/xsf/urn_generator.rb +13 -0
  479. data/lib/pubid/xsf/urn_parser.rb +18 -0
  480. data/lib/pubid/xsf.rb +76 -0
  481. data/lib/pubid.rb +25 -1
  482. metadata +205 -4
  483. data/lib/pubid/cie/components/code.rb +0 -80
  484. data/lib/pubid/iala/identifiers/base.rb +0 -14
@@ -4,7 +4,9 @@ module Pubid
4
4
  module Jcgm
5
5
  class UrnGenerator < Pubid::UrnGenerator::Base
6
6
  def generate
7
- if identifier.is_a?(SupplementIdentifier)
7
+ if identifier.is_a?(Identifiers::Meeting)
8
+ generate_meeting_urn
9
+ elsif identifier.is_a?(SupplementIdentifier)
8
10
  generate_supplement_urn
9
11
  else
10
12
  generate_base_urn
@@ -13,16 +15,21 @@ module Pubid
13
15
 
14
16
  protected
15
17
 
18
+ # urn:jcgm:meeting:<number>:<year>, e.g. urn:jcgm:meeting:17:2012
19
+ def generate_meeting_urn
20
+ parts = ["urn", "jcgm", "meeting"]
21
+ parts << identifier.number.value if identifier.number
22
+ parts << identifier.date.year if identifier.date
23
+ parts.join(":")
24
+ end
25
+
16
26
  def generate_base_urn
17
27
  parts = ["urn", "jcgm"]
18
28
 
19
- gum_number = maybe(:gum_number)
20
- if gum_number
21
- number = gum_number.to_s
22
- parts << "gum.#{number}"
29
+ if identifier.is_a?(Identifiers::GumGuide) && identifier.number
30
+ parts << "gum.#{identifier.number}"
23
31
  elsif identifier.number
24
- number = identifier.number.to_s
25
- parts << number
32
+ parts << identifier.number.to_s
26
33
  end
27
34
 
28
35
  part = maybe(:part)
@@ -55,9 +62,11 @@ module Pubid
55
62
  parts << "iter.#{iter}"
56
63
  end
57
64
 
65
+ # Guide and GUM-guide are already implied by the number form (bare
66
+ # number vs "gum.N"), so their type_code is not appended.
58
67
  if identifier.typed_stage
59
68
  type_code = identifier.typed_stage.type_code
60
- if type_code && type_code.to_s != "guide"
69
+ if type_code && !%w[guide gum_guide].include?(type_code.to_s)
61
70
  parts << type_code.to_s
62
71
  end
63
72
  end
@@ -73,7 +82,7 @@ module Pubid
73
82
  def generate_supplement_urn
74
83
  parts = ["urn", "jcgm"]
75
84
 
76
- base_id = maybe(:base_identifier)
85
+ base_id = maybe(:base)
77
86
  if base_id
78
87
  base_gen = self.class.new(base_id)
79
88
  base_urn = base_gen.generate_base_urn
@@ -88,10 +97,9 @@ module Pubid
88
97
  parts << supp_type if supp_type
89
98
  end
90
99
 
91
- iteration = maybe(:iteration)
92
- if iteration
93
- iter = iteration.to_s
94
- parts << iter
100
+ # The supplement's own number (the "1" in "/Cor 1") — NOT iteration.
101
+ if identifier.number
102
+ parts << identifier.number.to_s
95
103
  end
96
104
 
97
105
  if identifier.date&.is_a?(::Pubid::Components::Date) && identifier.date.present?
@@ -4,20 +4,32 @@ module Pubid
4
4
  module Jcgm
5
5
  # Parses JCGM URNs back into identifiers.
6
6
  #
7
- # UrnGenerator emits: `urn:jcgm:{number}:{year}`.
7
+ # UrnGenerator emits `urn:jcgm:{number}:{year}` for guides and
8
+ # `urn:jcgm:meeting:{number}:{year}` for committee/meeting records.
8
9
  #
9
10
  # Examples:
10
11
  # - urn:jcgm:200:2012 → JCGM 200:2012
11
12
  # - urn:jcgm:100:2008 → JCGM 100:2008
13
+ # - urn:jcgm:meeting:17:2012 → JCGM 17th Meeting (2012)
12
14
  class UrnParser < Pubid::UrnParser::Base
13
15
  def parse_urn(urn)
14
- body = strip_namespace(urn)
15
- parts = split_parts(body)
16
+ parts = split_parts(strip_namespace(urn))
17
+ return parse_meeting_urn(parts) if parts.first == "meeting"
18
+
16
19
  number, year = parts
17
20
  text = "JCGM #{number}"
18
21
  text += ":#{year}" if year
19
22
  flavor_parse(text)
20
23
  end
24
+
25
+ private
26
+
27
+ # urn:jcgm:meeting:<number>:<year> -> "JCGM <ordinal> Meeting (<year>)"
28
+ def parse_meeting_urn(parts)
29
+ _, number, year = parts
30
+ ordinal = Identifiers::Meeting.ordinal(number)
31
+ flavor_parse("JCGM #{ordinal} Meeting (#{year})")
32
+ end
21
33
  end
22
34
  end
23
35
  end
@@ -117,6 +117,58 @@ module Pubid
117
117
  render(format: :human, **opts)
118
118
  end
119
119
 
120
+ # JIS exposes its publisher as the `PUBLISHER` constant rather than the
121
+ # inherited `publisher` attribute, so the generic mr_publisher returns
122
+ # nil. Without this override every JIS id would lose its "JIS." prefix.
123
+ # Lowercased to match the all-lowercase MR convention.
124
+ def mr_publisher
125
+ PUBLISHER.downcase
126
+ end
127
+
128
+ # JIS stores its identity across `series` (division letter A–Z), `number`
129
+ # (string, may have leading zeros), and `parts` (multi-level). The
130
+ # generic mr_number_with_part only knows about `number`/`part`/`subpart`,
131
+ # so without these overrides every JIS id would collapse onto its
132
+ # document number and drop the division letter (issue #142).
133
+ # Lowercased to match the all-lowercase MR convention.
134
+ def mr_type
135
+ return nil unless respond_to?(:type_prefix)
136
+
137
+ type_prefix&.downcase
138
+ end
139
+
140
+ def mr_number_with_part
141
+ segments = []
142
+ segments << series.to_s.downcase if series
143
+ segments << number.to_s if number
144
+ parts&.each { |p| segments << p.to_s }
145
+ return nil if segments.empty?
146
+
147
+ segments.join("-")
148
+ end
149
+
150
+ # JIS stores the year as a bare integer (not a Components::Date), so the
151
+ # inherited mr_year (which reads `date`) returns nil. Emit it directly,
152
+ # including the reaffirmation marker so `JIS X:2019` and `JIS X:2019R`
153
+ # stay distinct in MR.
154
+ def mr_year
155
+ return nil unless year
156
+
157
+ year_with_reaffirmation.to_s
158
+ end
159
+
160
+ def mr_languages
161
+ return nil unless language
162
+
163
+ "(#{language})"
164
+ end
165
+
166
+ def mr_all_parts
167
+ return nil unless all_parts?
168
+
169
+ "all-parts"
170
+ end
171
+
120
172
  # from_hash is the shared polymorphic dispatch on Pubid::Identifier.
121
173
  # JIS_TYPE_MAP remains as the key_value polymorphic_map.
122
174
 
@@ -22,7 +22,7 @@ module Pubid
22
22
 
23
23
  # Build an identifier object from parsed data
24
24
  # @param parsed [Hash, Array] the parsed identifier data
25
- # @return [Identifiers::Base] the constructed identifier object
25
+ # @return [Identifier] the constructed identifier object
26
26
  def build(parsed)
27
27
  # Parslet can return array of hashes - merge them
28
28
  parsed_hash = parsed.is_a?(Array) ? flatten_array(parsed) : parsed
@@ -287,8 +287,6 @@ module Pubid
287
287
 
288
288
  identifier.number = Components::Code.new(value: "#{first_num.value}-#{number_part}")
289
289
  identifier.edition = edition_obj
290
- identifier.edition_component = edition_obj
291
- identifier.revision = "r#{edition_id}"
292
290
  # CS Emergency pattern: e104-43 -> number=104, edition_year=1943
293
291
  # Logic: e104-43 means "emergency 104 from 1943" (43 = 1943)
294
292
  elsif first_num.value.to_s.match?(/^e(\d{3})$/) &&
@@ -304,7 +302,6 @@ module Pubid
304
302
 
305
303
  identifier.number = Components::Code.new(value: number_part)
306
304
  identifier.edition = edition_obj
307
- identifier.edition_component = edition_obj
308
305
  elsif first_num.value.to_s.match?(/^(\d+)e(\d+)$/) &&
309
306
  second_num.value.to_s.match?(/^\d{2,4}$/)
310
307
  # Pattern: "11e2-1915" OR "123e2-50" parsed as first="11e2"|"123e2", second="1915"|"50"
@@ -326,7 +323,6 @@ module Pubid
326
323
  edition_obj = Components::Edition.new(type: "e",
327
324
  id: edition_id, additional_text: year_part)
328
325
  identifier.edition = edition_obj
329
- identifier.edition_component = edition_obj
330
326
  elsif first_num.value.to_s.match?(/^(\d+)supp?$/) &&
331
327
  second_num.value.to_s.match?(/^\d{4}$/)
332
328
  # Pattern: "25supp-1924" parsed as first="25supp", second="1924"
@@ -351,7 +347,6 @@ module Pubid
351
347
  identifier.number = first_num
352
348
  edition_obj = Components::Edition.new(type: "e",
353
349
  id: second_num.value.to_s)
354
- identifier.edition_component = edition_obj
355
350
  identifier.edition = edition_obj
356
351
  identifier.edition_year = second_num.value.to_s
357
352
  elsif part_num && series.part_num_as_component?
@@ -379,11 +374,34 @@ module Pubid
379
374
  id: extracted_revision.to_s)
380
375
  end
381
376
 
377
+ # Expose the SP subseries (Appendix A.2 of the NIST PubID Syntax) as
378
+ # a queryable attribute. For "NIST SP 800-53" the subseries is "800"
379
+ # (first_num) and the sequence is "53" (already folded into number).
380
+ # Pure metadata extraction — number is left intact so existing
381
+ # rendering and indexing stay byte-identical.
382
+ if identifier.is_a?(Identifiers::SpecialPublication) &&
383
+ first_num && identifier.respond_to?(:subseries=)
384
+ first_str = first_num.value.to_s
385
+ subseries_code =
386
+ if Identifiers::SpecialPublication::SP_SUBSERIES.include?(first_str)
387
+ first_str
388
+ elsif (m = first_str.match(/\A(\d+GB)\b/)) &&
389
+ Identifiers::SpecialPublication::SP_SUBSERIES.include?(m[1])
390
+ # Parser emits "1190GB-12" as a single first_number token; strip
391
+ # the suffix to surface the bare "1190GB" subseries code.
392
+ m[1]
393
+ end
394
+ if subseries_code
395
+ identifier.subseries =
396
+ Components::Code.new(value: subseries_code)
397
+ end
398
+ end
399
+
382
400
  # Series-specific post-processing (e.g., IR reverses the "84e2946"
383
401
  # form that preprocessing produced back to "84-2946").
384
402
  series.finalize_identifier(identifier, parsed_hash)
385
403
 
386
- # publisher_was_parsed defaults to true (see Identifiers::Base), so only
404
+ # publisher_was_parsed defaults to true (see Identifier), so only
387
405
  # the prefix-less case needs recording: assign false when no publisher
388
406
  # was parsed/extracted, and leave it unset (default true, omitted from
389
407
  # to_hash) when one was. Keeps the common publisher-bearing id lean.
@@ -437,11 +455,13 @@ module Pubid
437
455
  component = Components::Supplement.new
438
456
  # Split the fused "Jun1925"/"Jun1926" strings into isolated start/end
439
457
  # month+year nodes (start reuses :month/:year, end uses *_end).
440
- if range_start && (m = range_start.match(/\A([A-Za-z]{3,9})(\d{4})\z/))
458
+ # Each end is either a fused "Jun1925" (month+year) or a bare "1925"
459
+ # (year-only range, no month).
460
+ if range_start && (m = range_start.match(/\A([A-Za-z]{3,9})?(\d{4})\z/))
441
461
  component.month = m[1]
442
462
  component.year = m[2]
443
463
  end
444
- if range_end && (m = range_end.match(/\A([A-Za-z]{3,9})(\d{4})\z/))
464
+ if range_end && (m = range_end.match(/\A([A-Za-z]{3,9})?(\d{4})\z/))
445
465
  component.month_end = m[1]
446
466
  component.year_end = m[2]
447
467
  end
@@ -32,7 +32,7 @@ module Pubid
32
32
  when :publisher
33
33
  return nil if value.nil? || value.to_s.strip.empty?
34
34
 
35
- # publisher is a plain string attribute (see Identifiers::Base).
35
+ # publisher is a plain string attribute (see Identifier).
36
36
  value.to_s
37
37
 
38
38
  when :dated_date
@@ -48,6 +48,11 @@ module Pubid
48
48
 
49
49
  { dated_seq: value.to_s }
50
50
 
51
+ when :year
52
+ # Bare 4-digit year (e.g. from "NIST Research Library (2022)").
53
+ # The Identifier#year attribute is typed as :integer.
54
+ value&.to_s&.to_i
55
+
51
56
  when :series
52
57
  return nil if value.nil? || value.to_s.strip.empty?
53
58
 
@@ -196,9 +201,6 @@ module Pubid
196
201
  value: data[:letter_suffix].to_s.upcase),
197
202
  edition: Components::Edition.new(type: "r",
198
203
  id: data[:revision_id].to_s),
199
- edition_component: Components::Edition.new(type: "r",
200
- id: data[:revision_id].to_s),
201
- revision: "r#{data[:revision_id]}",
202
204
  }
203
205
  end
204
206
 
@@ -633,7 +635,7 @@ module Pubid
633
635
 
634
636
  when :parsed_format
635
637
  # Format detection result from parser. :short is the render default
636
- # (a nil parsed_format renders short — see Identifiers::Base#to_s), so
638
+ # (a nil parsed_format renders short — see Identifier#to_s), so
637
639
  # store only non-default formats (e.g. "mr"); "short" stays unset and
638
640
  # is omitted from to_hash. detect_format only emits :mr or :short.
639
641
  v = value&.to_s
@@ -877,8 +879,6 @@ module Pubid
877
879
  # Store as id directly - renders as "e199206"
878
880
  {
879
881
  edition: Components::Edition.new(type: "e", id: edition_date),
880
- edition_component: Components::Edition.new(type: "e",
881
- id: edition_date),
882
882
  }
883
883
 
884
884
  when :edition_e
@@ -889,8 +889,6 @@ module Pubid
889
889
 
890
890
  {
891
891
  edition: Components::Edition.new(type: "e", id: edition_id),
892
- edition_component: Components::Edition.new(type: "e",
893
- id: edition_id),
894
892
  }
895
893
 
896
894
  when :edition_r
@@ -901,9 +899,6 @@ module Pubid
901
899
 
902
900
  {
903
901
  edition: Components::Edition.new(type: "r", id: edition_id),
904
- edition_component: Components::Edition.new(type: "r",
905
- id: edition_id),
906
- revision: "r#{edition_id}", # Also set revision string attribute for compatibility
907
902
  }
908
903
 
909
904
  when :edition_r_no_space
@@ -915,9 +910,6 @@ module Pubid
915
910
 
916
911
  {
917
912
  edition: Components::Edition.new(type: "r", id: edition_id),
918
- edition_component: Components::Edition.new(type: "r",
919
- id: edition_id),
920
- revision: "r#{edition_id}", # Also set revision string attribute for compatibility
921
913
  }
922
914
 
923
915
  when :edition_rev
@@ -928,9 +920,6 @@ module Pubid
928
920
 
929
921
  {
930
922
  edition: Components::Edition.new(type: "r", id: edition_id),
931
- edition_component: Components::Edition.new(type: "r",
932
- id: edition_id),
933
- revision: "r#{edition_id}", # Also set revision string attribute for compatibility
934
923
  }
935
924
 
936
925
  when :edition_r_letter
@@ -943,10 +932,6 @@ module Pubid
943
932
  {
944
933
  edition: Components::Edition.new(type: "r", id: edition_id,
945
934
  additional_text: edition_letter),
946
- edition_component: Components::Edition.new(type: "r",
947
- id: edition_id,
948
- additional_text: edition_letter),
949
- revision: "r#{edition_id}#{edition_letter}", # Also set revision string attribute for compatibility
950
935
  }
951
936
 
952
937
  when :edition_r_letter_only
@@ -957,9 +942,6 @@ module Pubid
957
942
 
958
943
  {
959
944
  edition: Components::Edition.new(type: "r", id: edition_letter),
960
- edition_component: Components::Edition.new(type: "r",
961
- id: edition_letter),
962
- revision: "r#{edition_letter}", # Also set revision string attribute for compatibility
963
945
  }
964
946
 
965
947
  when :edition_historical
@@ -970,8 +952,6 @@ module Pubid
970
952
 
971
953
  {
972
954
  edition: Components::Edition.new(type: "-", id: edition_id),
973
- edition_component: Components::Edition.new(type: "-",
974
- id: edition_id),
975
955
  }
976
956
 
977
957
  when :edition_r_with_space_letter
@@ -991,10 +971,6 @@ module Pubid
991
971
  {
992
972
  edition: Components::Edition.new(type: "r", id: edition_id,
993
973
  additional_text: edition_letter),
994
- edition_component: Components::Edition.new(type: "r",
995
- id: edition_id,
996
- additional_text: edition_letter),
997
- revision: "r#{edition_id}#{edition_letter}",
998
974
  }
999
975
  else
1000
976
  # Space was in original input - preserve format
@@ -1002,11 +978,6 @@ module Pubid
1002
978
  edition: Components::Edition.new(type: "r", id: edition_id,
1003
979
  additional_text: edition_letter,
1004
980
  original_prefix: " r"),
1005
- edition_component: Components::Edition.new(type: "r",
1006
- id: edition_id,
1007
- additional_text: edition_letter,
1008
- original_prefix: " r"),
1009
- revision: "r#{edition_id}#{edition_letter}",
1010
981
  }
1011
982
  end
1012
983
 
@@ -1027,19 +998,12 @@ module Pubid
1027
998
  # No original_prefix - space was added by preprocessing
1028
999
  {
1029
1000
  edition: Components::Edition.new(type: "r", id: edition_id),
1030
- edition_component: Components::Edition.new(type: "r",
1031
- id: edition_id),
1032
- revision: "r#{edition_id}",
1033
1001
  }
1034
1002
  else
1035
1003
  # Space was in original input - preserve format
1036
1004
  {
1037
1005
  edition: Components::Edition.new(type: "r", id: edition_id,
1038
1006
  original_prefix: " r"),
1039
- edition_component: Components::Edition.new(type: "r",
1040
- id: edition_id,
1041
- original_prefix: " r"),
1042
- revision: "r#{edition_id}",
1043
1007
  }
1044
1008
  end
1045
1009
 
@@ -1089,7 +1053,6 @@ module Pubid
1089
1053
  )
1090
1054
  return {
1091
1055
  edition: edition_obj,
1092
- edition_component: edition_obj,
1093
1056
  edition_year: edition_id.to_s,
1094
1057
  }
1095
1058
  else
@@ -1113,7 +1076,6 @@ module Pubid
1113
1076
  # Return as hash to set edition and edition_year
1114
1077
  {
1115
1078
  edition: edition_obj, # Main attribute for tests
1116
- edition_component: edition_obj, # V2 component
1117
1079
  edition_year: value.to_s, # Keep string for render logic
1118
1080
  }
1119
1081
 
@@ -25,7 +25,7 @@ module Pubid
25
25
  @builder = builder
26
26
  end
27
27
 
28
- # Build CircularSupplement with base_identifier wrapping
28
+ # Build CircularSupplement with base wrapping
29
29
  # @param parsed_hash [Hash] the parsed supplement data
30
30
  # Build a CIRC/LCIRC supplement. Most forms collapse onto the base
31
31
  # identifier's normal class (Circular / LetterCircular) with isolated
@@ -56,10 +56,12 @@ module Pubid
56
56
  ys = range[:supp_year_start]&.to_s
57
57
  me = range[:supp_month_end]&.to_s
58
58
  ye = range[:supp_year_end]&.to_s
59
+ # Month is optional: a year-only range ("sup1925-1926") passes just the
60
+ # bare year, which supplement_from parses into year/year_end.
59
61
  identifier.supplement = @builder.supplement_from(
60
62
  value: nil, has_revision: false,
61
- range_start: (ms && ys ? "#{ms}#{ys}" : nil),
62
- range_end: (me && ye ? "#{me}#{ye}" : nil)
63
+ range_start: (ys ? "#{ms}#{ys}" : nil),
64
+ range_end: (ye ? "#{me}#{ye}" : nil)
63
65
  )
64
66
  return identifier
65
67
  end
@@ -216,7 +218,7 @@ module Pubid
216
218
 
217
219
  # Recursively build base identifier
218
220
  # This will go through normal build() process which extracts edition from "101e2"
219
- supplement.base_identifier = @builder.build(base_hash)
221
+ supplement.base = @builder.build(base_hash)
220
222
 
221
223
  # NEW: Handle revision + implicit supplement pattern (e.g., "145r11/1925")
222
224
  # Create update format: "Upd1-{year}{revision_number}"
@@ -246,7 +248,7 @@ module Pubid
246
248
  }
247
249
 
248
250
  # Recursively build base identifier
249
- supplement.base_identifier = @builder.build(base_hash)
251
+ supplement.base = @builder.build(base_hash)
250
252
  end
251
253
 
252
254
  # Build supplement edition from captured data
@@ -139,8 +139,9 @@ module Pubid
139
139
  end
140
140
 
141
141
  # A range is marked by the presence of an END; START reuses month/year.
142
+ # Months are optional, so a year-only range ("1925-1926") also counts.
142
143
  def date_range?
143
- month && year && month_end && year_end
144
+ year && year_end
144
145
  end
145
146
 
146
147
  def build_date_range_format
@@ -164,7 +165,9 @@ module Pubid
164
165
  end
165
166
 
166
167
  def build_long_date_range_format
167
- "Supplement #{month} #{year}-#{month_end} #{year_end}"
168
+ start = [month, year].compact.join(" ")
169
+ finish = [month_end, year_end].compact.join(" ")
170
+ "Supplement #{start}-#{finish}"
168
171
  end
169
172
 
170
173
  def build_long_month_year_format
@@ -58,7 +58,13 @@ module Pubid
58
58
  private
59
59
 
60
60
  def default_series_path
61
- File.join(__dir__, "../../../gems/pubid-nist/series.yaml")
61
+ # Prefer data/nist/series.yaml (the canonical home in the monorepo);
62
+ # fall back to archived-gems/pubid-nist/series.yaml for backward
63
+ # compat with the v1 layout.
64
+ monorepo = File.join(__dir__, "../../../data/nist/series.yaml")
65
+ return monorepo if File.exist?(monorepo)
66
+
67
+ File.join(__dir__, "../../../archived-gems/pubid-nist/series.yaml")
62
68
  end
63
69
 
64
70
  def load_series
@@ -3,8 +3,6 @@
3
3
  # The NIST flavor base class is Pubid::Nist::Identifier — a real
4
4
  # Pubid::Identifier subclass that every concrete NIST identifier descends from,
5
5
  # so `id.is_a?(Pubid::Nist::Identifier)` and the shared polymorphic `from_hash`
6
- # work natively (no facade needed). Its full body, `.parse`, and the
7
- # Identifiers::Base back-compat alias are defined in identifiers/base.rb to keep
6
+ # work natively (no facade needed). Its full body and `.parse` are defined in identifiers/base.rb to keep
8
7
  # that large body in one place; this file just ensures it is loaded when a
9
8
  # consumer references Pubid::Nist::Identifier directly.
10
- require_relative "identifiers/base"