pubid 1.15.21 → 2.0.0.alpha.10

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 (863) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.adoc +2044 -53
  4. data/archived-gems/pubid-ccsds/update_codes.yaml +1 -0
  5. data/archived-gems/pubid-iec/stages.yaml +129 -0
  6. data/archived-gems/pubid-iec/update_codes.yaml +67 -0
  7. data/archived-gems/pubid-ieee/update_codes.yaml +104 -0
  8. data/archived-gems/pubid-iso/stages.yaml +106 -0
  9. data/archived-gems/pubid-iso/update_codes.yaml +4 -0
  10. data/archived-gems/pubid-itu/i18n.yaml +13 -0
  11. data/archived-gems/pubid-itu/series.yaml +42 -0
  12. data/archived-gems/pubid-nist/publishers.yaml +6 -0
  13. data/archived-gems/pubid-nist/series.yaml +121 -0
  14. data/archived-gems/pubid-nist/stages.yaml +16 -0
  15. data/archived-gems/pubid-nist/update_codes.yaml +93 -0
  16. data/archived-gems/pubid-plateau/update_codes.yaml +6 -0
  17. data/data/bipm/update_codes.yaml +9 -0
  18. data/data/ccsds/update_codes.yaml +1 -0
  19. data/data/iec/update_codes.yaml +70 -0
  20. data/data/ieee/update_codes.yaml +210 -0
  21. data/data/iso/update_codes.yaml +21 -0
  22. data/data/nist/series.yaml +155 -0
  23. data/data/nist/update_codes.yaml +122 -0
  24. data/data/plateau/update_codes.yaml +6 -0
  25. data/lib/pubid/adobe/builder.rb +52 -0
  26. data/lib/pubid/adobe/identifier.rb +47 -0
  27. data/lib/pubid/adobe/identifiers/publication.rb +31 -0
  28. data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
  29. data/lib/pubid/adobe/identifiers.rb +10 -0
  30. data/lib/pubid/adobe/parser.rb +136 -0
  31. data/lib/pubid/adobe/renderer.rb +39 -0
  32. data/lib/pubid/adobe/urn_generator.rb +42 -0
  33. data/lib/pubid/adobe/urn_parser.rb +69 -0
  34. data/lib/pubid/adobe.rb +60 -0
  35. data/lib/pubid/amca/builder.rb +176 -0
  36. data/lib/pubid/amca/identifier.rb +4 -0
  37. data/lib/pubid/amca/identifiers/base.rb +92 -0
  38. data/lib/pubid/amca/identifiers/interpretation.rb +38 -0
  39. data/lib/pubid/amca/identifiers/publication.rb +34 -0
  40. data/lib/pubid/amca/identifiers/standard.rb +20 -0
  41. data/lib/pubid/amca/identifiers.rb +11 -0
  42. data/lib/pubid/amca/parser.rb +153 -0
  43. data/lib/pubid/amca/renderer.rb +82 -0
  44. data/lib/pubid/amca/single_identifier.rb +10 -0
  45. data/lib/pubid/amca/urn_generator.rb +51 -0
  46. data/lib/pubid/amca/urn_parser.rb +28 -0
  47. data/lib/pubid/amca.rb +73 -0
  48. data/lib/pubid/ansi/builder.rb +54 -0
  49. data/lib/pubid/ansi/identifier.rb +31 -0
  50. data/lib/pubid/ansi/identifiers/american_national_standard.rb +13 -0
  51. data/lib/pubid/ansi/identifiers/standard.rb +15 -0
  52. data/lib/pubid/ansi/identifiers.rb +11 -0
  53. data/lib/pubid/ansi/parser.rb +91 -0
  54. data/lib/pubid/ansi/renderer.rb +53 -0
  55. data/lib/pubid/ansi/single_identifier.rb +16 -0
  56. data/lib/pubid/ansi/urn_generator.rb +41 -0
  57. data/lib/pubid/ansi/urn_parser.rb +23 -0
  58. data/lib/pubid/ansi.rb +68 -0
  59. data/lib/pubid/api/builder.rb +58 -0
  60. data/lib/pubid/api/components/code.rb +9 -0
  61. data/lib/pubid/api/identifier.rb +42 -0
  62. data/lib/pubid/api/identifiers/base.rb +12 -0
  63. data/lib/pubid/api/identifiers/bulletin.rb +13 -0
  64. data/lib/pubid/api/identifiers/continuous_operations_standard.rb +13 -0
  65. data/lib/pubid/api/identifiers/mpms.rb +26 -0
  66. data/lib/pubid/api/identifiers/publication.rb +13 -0
  67. data/lib/pubid/api/identifiers/recommended_practice.rb +13 -0
  68. data/lib/pubid/api/identifiers/specification.rb +13 -0
  69. data/lib/pubid/api/identifiers/standard.rb +13 -0
  70. data/lib/pubid/api/identifiers/technical_report.rb +13 -0
  71. data/lib/pubid/api/identifiers/typeless_standard.rb +11 -0
  72. data/lib/pubid/api/identifiers.rb +18 -0
  73. data/lib/pubid/api/parser.rb +140 -0
  74. data/lib/pubid/api/renderer.rb +98 -0
  75. data/lib/pubid/api/single_identifier.rb +24 -0
  76. data/lib/pubid/api/urn_generator.rb +23 -0
  77. data/lib/pubid/api/urn_parser.rb +35 -0
  78. data/lib/pubid/api.rb +68 -0
  79. data/lib/pubid/ashrae/builder.rb +519 -0
  80. data/lib/pubid/ashrae/identifier.rb +8 -0
  81. data/lib/pubid/ashrae/identifiers/addenda_package.rb +42 -0
  82. data/lib/pubid/ashrae/identifiers/addendum.rb +44 -0
  83. data/lib/pubid/ashrae/identifiers/base.rb +119 -0
  84. data/lib/pubid/ashrae/identifiers/combined_addenda.rb +43 -0
  85. data/lib/pubid/ashrae/identifiers/errata.rb +39 -0
  86. data/lib/pubid/ashrae/identifiers/guideline.rb +41 -0
  87. data/lib/pubid/ashrae/identifiers/interpretation.rb +45 -0
  88. data/lib/pubid/ashrae/identifiers/standard.rb +41 -0
  89. data/lib/pubid/ashrae/identifiers.rb +15 -0
  90. data/lib/pubid/ashrae/parser.rb +748 -0
  91. data/lib/pubid/ashrae/renderer.rb +117 -0
  92. data/lib/pubid/ashrae/single_identifier.rb +10 -0
  93. data/lib/pubid/ashrae/supplement_identifier.rb +38 -0
  94. data/lib/pubid/ashrae/urn_generator.rb +57 -0
  95. data/lib/pubid/ashrae/urn_parser.rb +27 -0
  96. data/lib/pubid/ashrae.rb +77 -0
  97. data/lib/pubid/asme/builder.rb +162 -0
  98. data/lib/pubid/asme/components/code.rb +26 -0
  99. data/lib/pubid/asme/identifier.rb +24 -0
  100. data/lib/pubid/asme/identifiers/base.rb +10 -0
  101. data/lib/pubid/asme/identifiers/standard.rb +96 -0
  102. data/lib/pubid/asme/identifiers.rb +10 -0
  103. data/lib/pubid/asme/parser.rb +308 -0
  104. data/lib/pubid/asme/renderer.rb +66 -0
  105. data/lib/pubid/asme/single_identifier.rb +38 -0
  106. data/lib/pubid/asme/urn_generator.rb +133 -0
  107. data/lib/pubid/asme/urn_parser.rb +31 -0
  108. data/lib/pubid/asme.rb +67 -0
  109. data/lib/pubid/astm/builder.rb +166 -0
  110. data/lib/pubid/astm/components/code.rb +42 -0
  111. data/lib/pubid/astm/components.rb +9 -0
  112. data/lib/pubid/astm/identifier.rb +24 -0
  113. data/lib/pubid/astm/identifiers/adjunct.rb +28 -0
  114. data/lib/pubid/astm/identifiers/base.rb +13 -0
  115. data/lib/pubid/astm/identifiers/code_number.rb +81 -0
  116. data/lib/pubid/astm/identifiers/data_series.rb +13 -0
  117. data/lib/pubid/astm/identifiers/iso_dual_published.rb +65 -0
  118. data/lib/pubid/astm/identifiers/manual.rb +23 -0
  119. data/lib/pubid/astm/identifiers/monograph.rb +13 -0
  120. data/lib/pubid/astm/identifiers/research_report.rb +21 -0
  121. data/lib/pubid/astm/identifiers/standard.rb +23 -0
  122. data/lib/pubid/astm/identifiers/technical_report.rb +12 -0
  123. data/lib/pubid/astm/identifiers/work_in_progress.rb +12 -0
  124. data/lib/pubid/astm/identifiers.rb +19 -0
  125. data/lib/pubid/astm/parser.rb +244 -0
  126. data/lib/pubid/astm/renderer.rb +172 -0
  127. data/lib/pubid/astm/single_identifier.rb +47 -0
  128. data/lib/pubid/astm/urn_generator.rb +101 -0
  129. data/lib/pubid/astm/urn_parser.rb +30 -0
  130. data/lib/pubid/astm.rb +55 -0
  131. data/lib/pubid/bipm/builder.rb +163 -0
  132. data/lib/pubid/bipm/identifier.rb +285 -0
  133. data/lib/pubid/bipm/identifiers/committee_document.rb +36 -0
  134. data/lib/pubid/bipm/identifiers/guide.rb +35 -0
  135. data/lib/pubid/bipm/identifiers/meeting.rb +53 -0
  136. data/lib/pubid/bipm/identifiers/mep.rb +33 -0
  137. data/lib/pubid/bipm/identifiers/metrologia_article.rb +48 -0
  138. data/lib/pubid/bipm/identifiers/si_brochure.rb +33 -0
  139. data/lib/pubid/bipm/identifiers.rb +15 -0
  140. data/lib/pubid/bipm/parser.rb +237 -0
  141. data/lib/pubid/bipm/renderer.rb +118 -0
  142. data/lib/pubid/bipm/urn_generator.rb +58 -0
  143. data/lib/pubid/bipm/urn_parser.rb +60 -0
  144. data/lib/pubid/bipm.rb +91 -0
  145. data/lib/pubid/bsi/builder.rb +1495 -0
  146. data/lib/pubid/bsi/components/code.rb +11 -0
  147. data/lib/pubid/bsi/components/date.rb +11 -0
  148. data/lib/pubid/bsi/components/publisher.rb +11 -0
  149. data/lib/pubid/bsi/components/type.rb +11 -0
  150. data/lib/pubid/bsi/identifier.rb +6 -0
  151. data/lib/pubid/bsi/identifiers/addendum_document.rb +30 -0
  152. data/lib/pubid/bsi/identifiers/adopted_european_norm.rb +67 -0
  153. data/lib/pubid/bsi/identifiers/adopted_international_standard.rb +51 -0
  154. data/lib/pubid/bsi/identifiers/aerospace_standard.rb +65 -0
  155. data/lib/pubid/bsi/identifiers/amendment.rb +48 -0
  156. data/lib/pubid/bsi/identifiers/british_industrial_practice.rb +21 -0
  157. data/lib/pubid/bsi/identifiers/british_standard.rb +34 -0
  158. data/lib/pubid/bsi/identifiers/bundled_identifier.rb +40 -0
  159. data/lib/pubid/bsi/identifiers/committee_document.rb +44 -0
  160. data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +84 -0
  161. data/lib/pubid/bsi/identifiers/corrigendum.rb +44 -0
  162. data/lib/pubid/bsi/identifiers/detailed_specification.rb +33 -0
  163. data/lib/pubid/bsi/identifiers/disc.rb +27 -0
  164. data/lib/pubid/bsi/identifiers/draft_document.rb +27 -0
  165. data/lib/pubid/bsi/identifiers/electronic_book.rb +16 -0
  166. data/lib/pubid/bsi/identifiers/expert_commentary.rb +36 -0
  167. data/lib/pubid/bsi/identifiers/explanatory_supplement.rb +35 -0
  168. data/lib/pubid/bsi/identifiers/flex.rb +30 -0
  169. data/lib/pubid/bsi/identifiers/handbook.rb +23 -0
  170. data/lib/pubid/bsi/identifiers/index.rb +30 -0
  171. data/lib/pubid/bsi/identifiers/method.rb +35 -0
  172. data/lib/pubid/bsi/identifiers/national_annex.rb +48 -0
  173. data/lib/pubid/bsi/identifiers/practice_guide.rb +21 -0
  174. data/lib/pubid/bsi/identifiers/publicly_available_specification.rb +27 -0
  175. data/lib/pubid/bsi/identifiers/published_document.rb +27 -0
  176. data/lib/pubid/bsi/identifiers/section.rb +32 -0
  177. data/lib/pubid/bsi/identifiers/set.rb +40 -0
  178. data/lib/pubid/bsi/identifiers/standalone_amendment.rb +40 -0
  179. data/lib/pubid/bsi/identifiers/supplement_document.rb +29 -0
  180. data/lib/pubid/bsi/identifiers/supplementary_index.rb +35 -0
  181. data/lib/pubid/bsi/identifiers/technical_specification.rb +34 -0
  182. data/lib/pubid/bsi/identifiers/test_method.rb +35 -0
  183. data/lib/pubid/bsi/identifiers/value_added_publication.rb +37 -0
  184. data/lib/pubid/bsi/identifiers.rb +51 -0
  185. data/lib/pubid/bsi/model.rb +196 -0
  186. data/lib/pubid/bsi/parser.rb +673 -0
  187. data/lib/pubid/bsi/renderer.rb +1064 -0
  188. data/lib/pubid/bsi/single_identifier.rb +141 -0
  189. data/lib/pubid/bsi/urn_generator.rb +92 -0
  190. data/lib/pubid/bsi/urn_parser.rb +52 -0
  191. data/lib/pubid/bsi.rb +282 -0
  192. data/lib/pubid/builder/base.rb +187 -0
  193. data/lib/pubid/bundled_identifier.rb +134 -0
  194. data/lib/pubid/calconnect/builder.rb +38 -0
  195. data/lib/pubid/calconnect/identifier.rb +121 -0
  196. data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
  197. data/lib/pubid/calconnect/identifiers.rb +9 -0
  198. data/lib/pubid/calconnect/parser.rb +54 -0
  199. data/lib/pubid/calconnect/renderer.rb +36 -0
  200. data/lib/pubid/calconnect/urn_generator.rb +33 -0
  201. data/lib/pubid/calconnect/urn_parser.rb +34 -0
  202. data/lib/pubid/calconnect.rb +82 -0
  203. data/lib/pubid/ccsds/builder.rb +57 -0
  204. data/lib/pubid/ccsds/identifier.rb +76 -0
  205. data/lib/pubid/ccsds/identifiers/base.rb +41 -0
  206. data/lib/pubid/ccsds/identifiers/base_BASE_88929.rb +70 -0
  207. data/lib/pubid/ccsds/identifiers/corrigendum.rb +40 -0
  208. data/lib/pubid/ccsds/identifiers.rb +10 -0
  209. data/lib/pubid/ccsds/parser.rb +73 -0
  210. data/lib/pubid/ccsds/single_identifier.rb +77 -0
  211. data/lib/pubid/ccsds/supplement_identifier.rb +37 -0
  212. data/lib/pubid/ccsds/urn_generator.rb +115 -0
  213. data/lib/pubid/ccsds/urn_parser.rb +20 -0
  214. data/lib/pubid/ccsds.rb +64 -0
  215. data/lib/pubid/cen_cenelec/builder.rb +362 -0
  216. data/lib/pubid/cen_cenelec/identifier.rb +38 -0
  217. data/lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb +45 -0
  218. data/lib/pubid/cen_cenelec/identifiers/amendment.rb +19 -0
  219. data/lib/pubid/cen_cenelec/identifiers/base.rb +34 -0
  220. data/lib/pubid/cen_cenelec/identifiers/cen_report.rb +29 -0
  221. data/lib/pubid/cen_cenelec/identifiers/cen_workshop_agreement.rb +28 -0
  222. data/lib/pubid/cen_cenelec/identifiers/cenelec_harmonization_document.rb +28 -0
  223. data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +40 -0
  224. data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +20 -0
  225. data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +99 -0
  226. data/lib/pubid/cen_cenelec/identifiers/european_prestandard.rb +50 -0
  227. data/lib/pubid/cen_cenelec/identifiers/european_specification.rb +29 -0
  228. data/lib/pubid/cen_cenelec/identifiers/fragment.rb +18 -0
  229. data/lib/pubid/cen_cenelec/identifiers/guide.rb +27 -0
  230. data/lib/pubid/cen_cenelec/identifiers/harmonization_document.rb +28 -0
  231. data/lib/pubid/cen_cenelec/identifiers/technical_report.rb +28 -0
  232. data/lib/pubid/cen_cenelec/identifiers/technical_specification.rb +36 -0
  233. data/lib/pubid/cen_cenelec/identifiers.rb +32 -0
  234. data/lib/pubid/cen_cenelec/parser.rb +144 -0
  235. data/lib/pubid/cen_cenelec/renderer.rb +261 -0
  236. data/lib/pubid/cen_cenelec/single_identifier.rb +49 -0
  237. data/lib/pubid/cen_cenelec/supplement_identifier.rb +47 -0
  238. data/lib/pubid/cen_cenelec/urn_generator.rb +129 -0
  239. data/lib/pubid/cen_cenelec/urn_parser.rb +28 -0
  240. data/lib/pubid/cen_cenelec.rb +208 -0
  241. data/lib/pubid/cie/builder.rb +524 -0
  242. data/lib/pubid/cie/components/language.rb +58 -0
  243. data/lib/pubid/cie/identifier.rb +33 -0
  244. data/lib/pubid/cie/identifiers/bundle.rb +50 -0
  245. data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
  246. data/lib/pubid/cie/identifiers/conference.rb +37 -0
  247. data/lib/pubid/cie/identifiers/corrigendum.rb +34 -0
  248. data/lib/pubid/cie/identifiers/dual_published.rb +41 -0
  249. data/lib/pubid/cie/identifiers/identical.rb +64 -0
  250. data/lib/pubid/cie/identifiers/joint_published.rb +52 -0
  251. data/lib/pubid/cie/identifiers/proceedings.rb +41 -0
  252. data/lib/pubid/cie/identifiers/standard.rb +93 -0
  253. data/lib/pubid/cie/identifiers/supplement.rb +47 -0
  254. data/lib/pubid/cie/identifiers/tutorial_bundle.rb +24 -0
  255. data/lib/pubid/cie/identifiers.rb +19 -0
  256. data/lib/pubid/cie/parser.rb +396 -0
  257. data/lib/pubid/cie/single_identifier.rb +69 -0
  258. data/lib/pubid/cie/supplement_identifier.rb +39 -0
  259. data/lib/pubid/cie/urn_generator.rb +126 -0
  260. data/lib/pubid/cie/urn_parser.rb +28 -0
  261. data/lib/pubid/cie.rb +83 -0
  262. data/lib/pubid/components/adoption.rb +104 -0
  263. data/lib/pubid/components/code.rb +47 -0
  264. data/lib/pubid/components/date.rb +72 -0
  265. data/lib/pubid/components/edition.rb +35 -0
  266. data/lib/pubid/components/iteration.rb +32 -0
  267. data/lib/pubid/components/language.rb +39 -0
  268. data/lib/pubid/components/locality.rb +19 -0
  269. data/lib/pubid/components/publisher.rb +39 -0
  270. data/lib/pubid/components/relationship.rb +151 -0
  271. data/lib/pubid/components/stage.rb +45 -0
  272. data/lib/pubid/components/supplement.rb +184 -0
  273. data/lib/pubid/components/type.rb +48 -0
  274. data/lib/pubid/components/typed_stage.rb +58 -0
  275. data/lib/pubid/components.rb +19 -0
  276. data/lib/pubid/core/pattern_doc_generator.rb +272 -0
  277. data/lib/pubid/core/update_codes.rb +98 -0
  278. data/lib/pubid/core.rb +8 -0
  279. data/lib/pubid/csa/builder.rb +671 -0
  280. data/lib/pubid/csa/components/code.rb +9 -0
  281. data/lib/pubid/csa/components.rb +9 -0
  282. data/lib/pubid/csa/composite_identifier.rb +38 -0
  283. data/lib/pubid/csa/identifier.rb +570 -0
  284. data/lib/pubid/csa/identifiers/base.rb +10 -0
  285. data/lib/pubid/csa/identifiers/bundled.rb +141 -0
  286. data/lib/pubid/csa/identifiers/canadian_adopted.rb +82 -0
  287. data/lib/pubid/csa/identifiers/cec.rb +66 -0
  288. data/lib/pubid/csa/identifiers/combined.rb +158 -0
  289. data/lib/pubid/csa/identifiers/csa_adopted.rb +78 -0
  290. data/lib/pubid/csa/identifiers/package.rb +65 -0
  291. data/lib/pubid/csa/identifiers/series.rb +23 -0
  292. data/lib/pubid/csa/identifiers/standard.rb +10 -0
  293. data/lib/pubid/csa/identifiers.rb +17 -0
  294. data/lib/pubid/csa/parser.rb +449 -0
  295. data/lib/pubid/csa/renderer.rb +300 -0
  296. data/lib/pubid/csa/single_identifier.rb +119 -0
  297. data/lib/pubid/csa/urn_generator.rb +87 -0
  298. data/lib/pubid/csa/urn_parser.rb +33 -0
  299. data/lib/pubid/csa/wrapper_identifier.rb +64 -0
  300. data/lib/pubid/csa.rb +80 -0
  301. data/lib/pubid/doi/builder.rb +18 -0
  302. data/lib/pubid/doi/identifier.rb +49 -0
  303. data/lib/pubid/doi/identifiers/resource.rb +30 -0
  304. data/lib/pubid/doi/identifiers.rb +9 -0
  305. data/lib/pubid/doi/parser.rb +52 -0
  306. data/lib/pubid/doi/renderer.rb +13 -0
  307. data/lib/pubid/doi.rb +55 -0
  308. data/lib/pubid/easc/builder.rb +55 -0
  309. data/lib/pubid/easc/identifier.rb +59 -0
  310. data/lib/pubid/easc/identifiers/pmg.rb +20 -0
  311. data/lib/pubid/easc/identifiers/rmg.rb +19 -0
  312. data/lib/pubid/easc/identifiers.rb +10 -0
  313. data/lib/pubid/easc/parser.rb +88 -0
  314. data/lib/pubid/easc/renderer.rb +48 -0
  315. data/lib/pubid/easc/urn_generator.rb +46 -0
  316. data/lib/pubid/easc/urn_parser.rb +57 -0
  317. data/lib/pubid/easc.rb +52 -0
  318. data/lib/pubid/ecma/builder.rb +45 -0
  319. data/lib/pubid/ecma/identifier.rb +147 -0
  320. data/lib/pubid/ecma/identifiers/memento.rb +30 -0
  321. data/lib/pubid/ecma/identifiers/standard.rb +31 -0
  322. data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
  323. data/lib/pubid/ecma/identifiers.rb +11 -0
  324. data/lib/pubid/ecma/parser.rb +76 -0
  325. data/lib/pubid/ecma/renderer.rb +67 -0
  326. data/lib/pubid/ecma/urn_generator.rb +46 -0
  327. data/lib/pubid/ecma/urn_parser.rb +51 -0
  328. data/lib/pubid/ecma.rb +67 -0
  329. data/lib/pubid/errors.rb +79 -0
  330. data/lib/pubid/etsi/builder.rb +142 -0
  331. data/lib/pubid/etsi/components/code.rb +43 -0
  332. data/lib/pubid/etsi/components/version.rb +32 -0
  333. data/lib/pubid/etsi/components.rb +10 -0
  334. data/lib/pubid/etsi/identifier.rb +4 -0
  335. data/lib/pubid/etsi/identifiers/amendment.rb +15 -0
  336. data/lib/pubid/etsi/identifiers/base.rb +74 -0
  337. data/lib/pubid/etsi/identifiers/corrigendum.rb +15 -0
  338. data/lib/pubid/etsi/identifiers/etsi_standard.rb +222 -0
  339. data/lib/pubid/etsi/identifiers/supplement_identifier.rb +123 -0
  340. data/lib/pubid/etsi/identifiers.rb +13 -0
  341. data/lib/pubid/etsi/parser.rb +139 -0
  342. data/lib/pubid/etsi/renderer.rb +48 -0
  343. data/lib/pubid/etsi/urn_generator.rb +76 -0
  344. data/lib/pubid/etsi/urn_parser.rb +34 -0
  345. data/lib/pubid/etsi.rb +71 -0
  346. data/lib/pubid/export/auditor.rb +89 -0
  347. data/lib/pubid/export/exporter.rb +33 -0
  348. data/lib/pubid/export/flavor_exporter.rb +250 -0
  349. data/lib/pubid/export/result.rb +97 -0
  350. data/lib/pubid/export.rb +12 -0
  351. data/lib/pubid/format_detector.rb +16 -0
  352. data/lib/pubid/format_registry.rb +42 -0
  353. data/lib/pubid/gb/builder.rb +45 -0
  354. data/lib/pubid/gb/identifier.rb +67 -0
  355. data/lib/pubid/gb/identifiers/standard.rb +34 -0
  356. data/lib/pubid/gb/identifiers.rb +9 -0
  357. data/lib/pubid/gb/parser.rb +63 -0
  358. data/lib/pubid/gb/renderer.rb +35 -0
  359. data/lib/pubid/gb.rb +87 -0
  360. data/lib/pubid/gost/builder.rb +148 -0
  361. data/lib/pubid/gost/identifier.rb +47 -0
  362. data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
  363. data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
  364. data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
  365. data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
  366. data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
  367. data/lib/pubid/gost/identifiers.rb +13 -0
  368. data/lib/pubid/gost/parser.rb +105 -0
  369. data/lib/pubid/gost/renderer.rb +48 -0
  370. data/lib/pubid/gost/urn_generator.rb +46 -0
  371. data/lib/pubid/gost/urn_parser.rb +52 -0
  372. data/lib/pubid/gost.rb +49 -0
  373. data/lib/pubid/iala/builder.rb +102 -0
  374. data/lib/pubid/iala/identifier.rb +90 -0
  375. data/lib/pubid/iala/identifiers/advice.rb +15 -0
  376. data/lib/pubid/iala/identifiers/annex.rb +57 -0
  377. data/lib/pubid/iala/identifiers/general_assembly.rb +19 -0
  378. data/lib/pubid/iala/identifiers/guideline.rb +17 -0
  379. data/lib/pubid/iala/identifiers/letter.rb +16 -0
  380. data/lib/pubid/iala/identifiers/manual.rb +18 -0
  381. data/lib/pubid/iala/identifiers/model_course.rb +17 -0
  382. data/lib/pubid/iala/identifiers/recommendation.rb +17 -0
  383. data/lib/pubid/iala/identifiers/report.rb +16 -0
  384. data/lib/pubid/iala/identifiers/resolution.rb +16 -0
  385. data/lib/pubid/iala/identifiers/standard.rb +17 -0
  386. data/lib/pubid/iala/identifiers.rb +19 -0
  387. data/lib/pubid/iala/parser.rb +138 -0
  388. data/lib/pubid/iala/renderer.rb +36 -0
  389. data/lib/pubid/iala/urn_generator.rb +49 -0
  390. data/lib/pubid/iala/urn_parser.rb +67 -0
  391. data/lib/pubid/iala.rb +71 -0
  392. data/lib/pubid/iana/builder.rb +22 -0
  393. data/lib/pubid/iana/identifier.rb +140 -0
  394. data/lib/pubid/iana/identifiers/registry.rb +69 -0
  395. data/lib/pubid/iana/identifiers.rb +9 -0
  396. data/lib/pubid/iana/parser.rb +38 -0
  397. data/lib/pubid/iana/renderer.rb +32 -0
  398. data/lib/pubid/iana/urn_generator.rb +19 -0
  399. data/lib/pubid/iana/urn_parser.rb +24 -0
  400. data/lib/pubid/iana.rb +69 -0
  401. data/lib/pubid/identifier.rb +1118 -0
  402. data/lib/pubid/identifier_metadata.rb +148 -0
  403. data/lib/pubid/idf/builder.rb +82 -0
  404. data/lib/pubid/idf/identifier.rb +79 -0
  405. data/lib/pubid/idf/identifiers/amendment.rb +28 -0
  406. data/lib/pubid/idf/identifiers/corrigendum.rb +28 -0
  407. data/lib/pubid/idf/identifiers/international_standard.rb +124 -0
  408. data/lib/pubid/idf/identifiers/reviewed_method.rb +101 -0
  409. data/lib/pubid/idf/identifiers.rb +13 -0
  410. data/lib/pubid/idf/parser.rb +144 -0
  411. data/lib/pubid/idf/renderer.rb +84 -0
  412. data/lib/pubid/idf/single_identifier.rb +19 -0
  413. data/lib/pubid/idf/supplement_identifier.rb +35 -0
  414. data/lib/pubid/idf/urn_generator.rb +49 -0
  415. data/lib/pubid/idf/urn_parser.rb +25 -0
  416. data/lib/pubid/idf.rb +89 -0
  417. data/lib/pubid/iec/builder.rb +458 -0
  418. data/lib/pubid/iec/components/code.rb +36 -0
  419. data/lib/pubid/iec/components/consolidated_amendment.rb +59 -0
  420. data/lib/pubid/iec/components/publisher.rb +35 -0
  421. data/lib/pubid/iec/components/sheet.rb +32 -0
  422. data/lib/pubid/iec/components/trf_info.rb +38 -0
  423. data/lib/pubid/iec/components/vap_suffix.rb +41 -0
  424. data/lib/pubid/iec/components.rb +14 -0
  425. data/lib/pubid/iec/identifier.rb +341 -0
  426. data/lib/pubid/iec/identifiers/amendment.rb +97 -0
  427. data/lib/pubid/iec/identifiers/base.rb +54 -0
  428. data/lib/pubid/iec/identifiers/component_specification.rb +29 -0
  429. data/lib/pubid/iec/identifiers/conformity_assessment.rb +28 -0
  430. data/lib/pubid/iec/identifiers/consolidated_identifier.rb +85 -0
  431. data/lib/pubid/iec/identifiers/corrigendum.rb +93 -0
  432. data/lib/pubid/iec/identifiers/fragment_identifier.rb +148 -0
  433. data/lib/pubid/iec/identifiers/guide.rb +86 -0
  434. data/lib/pubid/iec/identifiers/international_standard.rb +162 -0
  435. data/lib/pubid/iec/identifiers/interpretation_sheet.rb +103 -0
  436. data/lib/pubid/iec/identifiers/operational_document.rb +29 -0
  437. data/lib/pubid/iec/identifiers/publicly_available_specification.rb +88 -0
  438. data/lib/pubid/iec/identifiers/sheet_identifier.rb +68 -0
  439. data/lib/pubid/iec/identifiers/societal_technology_trend_report.rb +30 -0
  440. data/lib/pubid/iec/identifiers/systems_reference_document.rb +29 -0
  441. data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
  442. data/lib/pubid/iec/identifiers/technical_report.rb +114 -0
  443. data/lib/pubid/iec/identifiers/technical_specification.rb +114 -0
  444. data/lib/pubid/iec/identifiers/technology_report.rb +28 -0
  445. data/lib/pubid/iec/identifiers/test_report_form.rb +35 -0
  446. data/lib/pubid/iec/identifiers/vap_identifier.rb +76 -0
  447. data/lib/pubid/iec/identifiers/white_paper.rb +29 -0
  448. data/lib/pubid/iec/identifiers/working_document.rb +62 -0
  449. data/lib/pubid/iec/identifiers.rb +31 -0
  450. data/lib/pubid/iec/parser.rb +443 -0
  451. data/lib/pubid/iec/renderer.rb +267 -0
  452. data/lib/pubid/iec/rendering_style.rb +113 -0
  453. data/lib/pubid/iec/single_identifier.rb +72 -0
  454. data/lib/pubid/iec/supplement_identifier.rb +178 -0
  455. data/lib/pubid/iec/urn_generator.rb +245 -0
  456. data/lib/pubid/iec/urn_parser.rb +128 -0
  457. data/lib/pubid/iec.rb +64 -0
  458. data/lib/pubid/ieee/aiee/builder.rb +85 -0
  459. data/lib/pubid/ieee/aiee/identifier.rb +89 -0
  460. data/lib/pubid/ieee/aiee/parser.rb +130 -0
  461. data/lib/pubid/ieee/aiee.rb +11 -0
  462. data/lib/pubid/ieee/builder.rb +1554 -0
  463. data/lib/pubid/ieee/compaction.rb +121 -0
  464. data/lib/pubid/ieee/components/code.rb +110 -0
  465. data/lib/pubid/ieee/components/draft.rb +147 -0
  466. data/lib/pubid/ieee/components/relationship.rb +13 -0
  467. data/lib/pubid/ieee/components/typed_stage.rb +100 -0
  468. data/lib/pubid/ieee/identifier.rb +5 -0
  469. data/lib/pubid/ieee/identifiers/adopted_standard.rb +81 -0
  470. data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
  471. data/lib/pubid/ieee/identifiers/base.rb +384 -0
  472. data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
  473. data/lib/pubid/ieee/identifiers/conformance_identifier.rb +29 -0
  474. data/lib/pubid/ieee/identifiers/corrigendum.rb +40 -0
  475. data/lib/pubid/ieee/identifiers/csa_dual_published.rb +62 -0
  476. data/lib/pubid/ieee/identifiers/dual_identifier.rb +14 -0
  477. data/lib/pubid/ieee/identifiers/dual_published.rb +79 -0
  478. data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +115 -0
  479. data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +48 -0
  480. data/lib/pubid/ieee/identifiers/joint_development.rb +223 -0
  481. data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +85 -0
  482. data/lib/pubid/ieee/identifiers/nesc/base.rb +127 -0
  483. data/lib/pubid/ieee/identifiers/nesc/draft.rb +43 -0
  484. data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
  485. data/lib/pubid/ieee/identifiers/nesc/handbook.rb +43 -0
  486. data/lib/pubid/ieee/identifiers/nesc/redline.rb +35 -0
  487. data/lib/pubid/ieee/identifiers/nesc/standard.rb +41 -0
  488. data/lib/pubid/ieee/identifiers/nesc.rb +16 -0
  489. data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +14 -0
  490. data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +49 -0
  491. data/lib/pubid/ieee/identifiers/redlined_standard.rb +26 -0
  492. data/lib/pubid/ieee/identifiers/si_standard.rb +38 -0
  493. data/lib/pubid/ieee/identifiers/standard.rb +44 -0
  494. data/lib/pubid/ieee/identifiers/supplement_identifier.rb +42 -0
  495. data/lib/pubid/ieee/identifiers.rb +34 -0
  496. data/lib/pubid/ieee/ire/builder.rb +62 -0
  497. data/lib/pubid/ieee/ire/identifier.rb +73 -0
  498. data/lib/pubid/ieee/ire/parser.rb +91 -0
  499. data/lib/pubid/ieee/ire.rb +11 -0
  500. data/lib/pubid/ieee/nesc/builder.rb +114 -0
  501. data/lib/pubid/ieee/nesc/parser.rb +155 -0
  502. data/lib/pubid/ieee/nesc.rb +10 -0
  503. data/lib/pubid/ieee/parser.rb +1644 -0
  504. data/lib/pubid/ieee/pre_parser.rb +301 -0
  505. data/lib/pubid/ieee/renderer.rb +408 -0
  506. data/lib/pubid/ieee/typed_stages.rb +183 -0
  507. data/lib/pubid/ieee/urn_generator.rb +215 -0
  508. data/lib/pubid/ieee/urn_parser.rb +34 -0
  509. data/lib/pubid/ieee.rb +163 -0
  510. data/lib/pubid/ieee_debug.rb +30 -0
  511. data/lib/pubid/ietf/builder.rb +78 -0
  512. data/lib/pubid/ietf/identifier.rb +5 -0
  513. data/lib/pubid/ietf/identifiers/base.rb +72 -0
  514. data/lib/pubid/ietf/identifiers/bcp.rb +36 -0
  515. data/lib/pubid/ietf/identifiers/fyi.rb +36 -0
  516. data/lib/pubid/ietf/identifiers/internet_draft.rb +45 -0
  517. data/lib/pubid/ietf/identifiers/rfc.rb +27 -0
  518. data/lib/pubid/ietf/identifiers/serialization.rb +51 -0
  519. data/lib/pubid/ietf/identifiers/std.rb +36 -0
  520. data/lib/pubid/ietf/identifiers.rb +14 -0
  521. data/lib/pubid/ietf/parser.rb +61 -0
  522. data/lib/pubid/ietf/renderer.rb +64 -0
  523. data/lib/pubid/ietf/urn_generator.rb +37 -0
  524. data/lib/pubid/ietf/urn_parser.rb +43 -0
  525. data/lib/pubid/ietf.rb +85 -0
  526. data/lib/pubid/iho/builder.rb +37 -0
  527. data/lib/pubid/iho/identifier.rb +7 -0
  528. data/lib/pubid/iho/identifiers/base.rb +75 -0
  529. data/lib/pubid/iho/identifiers/bibliographic.rb +16 -0
  530. data/lib/pubid/iho/identifiers/circular_letter.rb +15 -0
  531. data/lib/pubid/iho/identifiers/miscellaneous.rb +16 -0
  532. data/lib/pubid/iho/identifiers/publication.rb +15 -0
  533. data/lib/pubid/iho/identifiers/standard.rb +15 -0
  534. data/lib/pubid/iho/identifiers.rb +13 -0
  535. data/lib/pubid/iho/parser.rb +68 -0
  536. data/lib/pubid/iho/renderer.rb +30 -0
  537. data/lib/pubid/iho/urn_generator.rb +29 -0
  538. data/lib/pubid/iho/urn_parser.rb +58 -0
  539. data/lib/pubid/iho.rb +77 -0
  540. data/lib/pubid/isbn/builder.rb +44 -0
  541. data/lib/pubid/isbn/check_digit.rb +53 -0
  542. data/lib/pubid/isbn/identifier.rb +81 -0
  543. data/lib/pubid/isbn/identifiers/book.rb +30 -0
  544. data/lib/pubid/isbn/identifiers.rb +9 -0
  545. data/lib/pubid/isbn/parser.rb +45 -0
  546. data/lib/pubid/isbn/renderer.rb +16 -0
  547. data/lib/pubid/isbn.rb +52 -0
  548. data/lib/pubid/iso/builder.rb +316 -0
  549. data/lib/pubid/iso/bundled_identifier.rb +138 -0
  550. data/lib/pubid/iso/combined_identifier.rb +24 -0
  551. data/lib/pubid/iso/components/code.rb +24 -0
  552. data/lib/pubid/iso/components/publisher.rb +62 -0
  553. data/lib/pubid/iso/components.rb +10 -0
  554. data/lib/pubid/iso/format_resolver.rb +45 -0
  555. data/lib/pubid/iso/identifier.rb +318 -0
  556. data/lib/pubid/iso/identifiers/addendum.rb +107 -0
  557. data/lib/pubid/iso/identifiers/amendment.rb +132 -0
  558. data/lib/pubid/iso/identifiers/corrigendum.rb +108 -0
  559. data/lib/pubid/iso/identifiers/data.rb +75 -0
  560. data/lib/pubid/iso/identifiers/directives.rb +65 -0
  561. data/lib/pubid/iso/identifiers/directives_supplement.rb +148 -0
  562. data/lib/pubid/iso/identifiers/extract.rb +30 -0
  563. data/lib/pubid/iso/identifiers/guide.rb +99 -0
  564. data/lib/pubid/iso/identifiers/international_standard.rb +168 -0
  565. data/lib/pubid/iso/identifiers/international_standardized_profile.rb +94 -0
  566. data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +95 -0
  567. data/lib/pubid/iso/identifiers/pas.rb +93 -0
  568. data/lib/pubid/iso/identifiers/recommendation.rb +45 -0
  569. data/lib/pubid/iso/identifiers/supplement.rb +95 -0
  570. data/lib/pubid/iso/identifiers/tc_document.rb +137 -0
  571. data/lib/pubid/iso/identifiers/technical_report.rb +103 -0
  572. data/lib/pubid/iso/identifiers/technical_specification.rb +102 -0
  573. data/lib/pubid/iso/identifiers/technology_trends_assessments.rb +95 -0
  574. data/lib/pubid/iso/identifiers.rb +32 -0
  575. data/lib/pubid/iso/normalizer.rb +89 -0
  576. data/lib/pubid/iso/parser.rb +534 -0
  577. data/lib/pubid/iso/rendering_style.rb +120 -0
  578. data/lib/pubid/iso/single_identifier.rb +60 -0
  579. data/lib/pubid/iso/supplement_identifier.rb +53 -0
  580. data/lib/pubid/iso/urn_generator.rb +313 -0
  581. data/lib/pubid/iso/urn_parser.rb +442 -0
  582. data/lib/pubid/iso/utilities.rb +86 -0
  583. data/lib/pubid/iso.rb +236 -0
  584. data/lib/pubid/itu/builder.rb +360 -0
  585. data/lib/pubid/itu/components/code.rb +84 -0
  586. data/lib/pubid/itu/components/designation.rb +35 -0
  587. data/lib/pubid/itu/components/sector.rb +46 -0
  588. data/lib/pubid/itu/components/series.rb +25 -0
  589. data/lib/pubid/itu/components.rb +12 -0
  590. data/lib/pubid/itu/i18n.rb +9 -0
  591. data/lib/pubid/itu/i18n.yaml +30 -0
  592. data/lib/pubid/itu/identifier.rb +4 -0
  593. data/lib/pubid/itu/identifiers/addendum.rb +15 -0
  594. data/lib/pubid/itu/identifiers/amendment.rb +19 -0
  595. data/lib/pubid/itu/identifiers/annex.rb +83 -0
  596. data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
  597. data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
  598. data/lib/pubid/itu/identifiers/base.rb +482 -0
  599. data/lib/pubid/itu/identifiers/combined_identifier.rb +121 -0
  600. data/lib/pubid/itu/identifiers/corrigendum.rb +35 -0
  601. data/lib/pubid/itu/identifiers/errata.rb +15 -0
  602. data/lib/pubid/itu/identifiers/handbook.rb +38 -0
  603. data/lib/pubid/itu/identifiers/question.rb +63 -0
  604. data/lib/pubid/itu/identifiers/recommendation.rb +15 -0
  605. data/lib/pubid/itu/identifiers/report.rb +39 -0
  606. data/lib/pubid/itu/identifiers/special_publication.rb +31 -0
  607. data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
  608. data/lib/pubid/itu/identifiers/supplement.rb +149 -0
  609. data/lib/pubid/itu/identifiers.rb +25 -0
  610. data/lib/pubid/itu/model.rb +111 -0
  611. data/lib/pubid/itu/parser.rb +679 -0
  612. data/lib/pubid/itu/urn_generator.rb +135 -0
  613. data/lib/pubid/itu/urn_parser.rb +31 -0
  614. data/lib/pubid/itu.rb +78 -0
  615. data/lib/pubid/jcgm/builder.rb +106 -0
  616. data/lib/pubid/jcgm/components/publisher.rb +20 -0
  617. data/lib/pubid/jcgm/components.rb +9 -0
  618. data/lib/pubid/jcgm/identifier.rb +21 -0
  619. data/lib/pubid/jcgm/identifiers/amendment.rb +24 -0
  620. data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
  621. data/lib/pubid/jcgm/identifiers/guide.rb +21 -0
  622. data/lib/pubid/jcgm/identifiers/gum_guide.rb +39 -0
  623. data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
  624. data/lib/pubid/jcgm/identifiers.rb +13 -0
  625. data/lib/pubid/jcgm/parser.rb +151 -0
  626. data/lib/pubid/jcgm/renderer.rb +89 -0
  627. data/lib/pubid/jcgm/single_identifier.rb +118 -0
  628. data/lib/pubid/jcgm/supplement_identifier.rb +51 -0
  629. data/lib/pubid/jcgm/urn_generator.rb +116 -0
  630. data/lib/pubid/jcgm/urn_parser.rb +177 -0
  631. data/lib/pubid/jcgm.rb +86 -0
  632. data/lib/pubid/jis/builder.rb +116 -0
  633. data/lib/pubid/jis/identifier.rb +194 -0
  634. data/lib/pubid/jis/identifiers/amendment.rb +16 -0
  635. data/lib/pubid/jis/identifiers/corrigendum.rb +16 -0
  636. data/lib/pubid/jis/identifiers/explanation.rb +22 -0
  637. data/lib/pubid/jis/identifiers/japanese_industrial_standard.rb +16 -0
  638. data/lib/pubid/jis/identifiers/standard.rb +28 -0
  639. data/lib/pubid/jis/identifiers/technical_report.rb +32 -0
  640. data/lib/pubid/jis/identifiers/technical_specification.rb +32 -0
  641. data/lib/pubid/jis/identifiers.rb +17 -0
  642. data/lib/pubid/jis/parser.rb +135 -0
  643. data/lib/pubid/jis/renderer.rb +69 -0
  644. data/lib/pubid/jis/single_identifier.rb +31 -0
  645. data/lib/pubid/jis/supplement_identifier.rb +50 -0
  646. data/lib/pubid/jis/urn_generator.rb +25 -0
  647. data/lib/pubid/jis/urn_parser.rb +23 -0
  648. data/lib/pubid/jis.rb +69 -0
  649. data/lib/pubid/lutaml/no_store_registration.rb +30 -0
  650. data/lib/pubid/nist/builder.rb +481 -0
  651. data/lib/pubid/nist/caster.rb +1234 -0
  652. data/lib/pubid/nist/circular_supplement_builder.rb +293 -0
  653. data/lib/pubid/nist/components/code.rb +27 -0
  654. data/lib/pubid/nist/components/edition.rb +134 -0
  655. data/lib/pubid/nist/components/issue_number.rb +28 -0
  656. data/lib/pubid/nist/components/part.rb +77 -0
  657. data/lib/pubid/nist/components/stage.rb +53 -0
  658. data/lib/pubid/nist/components/supplement.rb +191 -0
  659. data/lib/pubid/nist/components/translation.rb +42 -0
  660. data/lib/pubid/nist/components/update.rb +103 -0
  661. data/lib/pubid/nist/components/version.rb +35 -0
  662. data/lib/pubid/nist/components/volume.rb +32 -0
  663. data/lib/pubid/nist/components.rb +18 -0
  664. data/lib/pubid/nist/configuration.rb +87 -0
  665. data/lib/pubid/nist/identifier.rb +8 -0
  666. data/lib/pubid/nist/identifiers/base.rb +744 -0
  667. data/lib/pubid/nist/identifiers/circular.rb +80 -0
  668. data/lib/pubid/nist/identifiers/circular_supplement.rb +60 -0
  669. data/lib/pubid/nist/identifiers/commercial_standard.rb +42 -0
  670. data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +58 -0
  671. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +69 -0
  672. data/lib/pubid/nist/identifiers/crpl_report.rb +138 -0
  673. data/lib/pubid/nist/identifiers/dated_document.rb +49 -0
  674. data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +95 -0
  675. data/lib/pubid/nist/identifiers/grant_contractor_report.rb +36 -0
  676. data/lib/pubid/nist/identifiers/handbook.rb +58 -0
  677. data/lib/pubid/nist/identifiers/internal_report.rb +64 -0
  678. data/lib/pubid/nist/identifiers/letter_circular.rb +46 -0
  679. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +74 -0
  680. data/lib/pubid/nist/identifiers/monograph.rb +80 -0
  681. data/lib/pubid/nist/identifiers/ncstar.rb +41 -0
  682. data/lib/pubid/nist/identifiers/nsrds.rb +41 -0
  683. data/lib/pubid/nist/identifiers/owmwp.rb +35 -0
  684. data/lib/pubid/nist/identifiers/report.rb +77 -0
  685. data/lib/pubid/nist/identifiers/special_publication.rb +46 -0
  686. data/lib/pubid/nist/identifiers/technical_note.rb +91 -0
  687. data/lib/pubid/nist/identifiers.rb +33 -0
  688. data/lib/pubid/nist/parser.rb +752 -0
  689. data/lib/pubid/nist/parser_output_normalizer.rb +233 -0
  690. data/lib/pubid/nist/preprocessor.rb +443 -0
  691. data/lib/pubid/nist/renderer.rb +43 -0
  692. data/lib/pubid/nist/router.rb +149 -0
  693. data/lib/pubid/nist/series/base.rb +58 -0
  694. data/lib/pubid/nist/series/crpl.rb +13 -0
  695. data/lib/pubid/nist/series/fips.rb +14 -0
  696. data/lib/pubid/nist/series/ir.rb +57 -0
  697. data/lib/pubid/nist/series/letter_preserving.rb +15 -0
  698. data/lib/pubid/nist/series/mono.rb +19 -0
  699. data/lib/pubid/nist/series/ncstar.rb +20 -0
  700. data/lib/pubid/nist/series.rb +49 -0
  701. data/lib/pubid/nist/supplement_identifier.rb +84 -0
  702. data/lib/pubid/nist/urn_generator.rb +133 -0
  703. data/lib/pubid/nist/urn_parser.rb +67 -0
  704. data/lib/pubid/nist.rb +138 -0
  705. data/lib/pubid/oasis/builder.rb +79 -0
  706. data/lib/pubid/oasis/identifier.rb +160 -0
  707. data/lib/pubid/oasis/identifiers/standard.rb +29 -0
  708. data/lib/pubid/oasis/identifiers.rb +9 -0
  709. data/lib/pubid/oasis/parser.rb +34 -0
  710. data/lib/pubid/oasis/renderer.rb +29 -0
  711. data/lib/pubid/oasis/urn_generator.rb +25 -0
  712. data/lib/pubid/oasis/urn_parser.rb +22 -0
  713. data/lib/pubid/oasis.rb +79 -0
  714. data/lib/pubid/ogc/builder.rb +33 -0
  715. data/lib/pubid/ogc/identifier.rb +81 -0
  716. data/lib/pubid/ogc/identifiers/document.rb +26 -0
  717. data/lib/pubid/ogc/identifiers.rb +10 -0
  718. data/lib/pubid/ogc/parser.rb +40 -0
  719. data/lib/pubid/ogc/renderer.rb +33 -0
  720. data/lib/pubid/ogc/urn_generator.rb +14 -0
  721. data/lib/pubid/ogc/urn_parser.rb +22 -0
  722. data/lib/pubid/ogc.rb +71 -0
  723. data/lib/pubid/oiml/builder.rb +270 -0
  724. data/lib/pubid/oiml/components/code.rb +37 -0
  725. data/lib/pubid/oiml/components.rb +9 -0
  726. data/lib/pubid/oiml/identifier.rb +64 -0
  727. data/lib/pubid/oiml/identifiers/amendment.rb +13 -0
  728. data/lib/pubid/oiml/identifiers/annex.rb +29 -0
  729. data/lib/pubid/oiml/identifiers/basic_publication.rb +15 -0
  730. data/lib/pubid/oiml/identifiers/bulletin.rb +137 -0
  731. data/lib/pubid/oiml/identifiers/code_number.rb +90 -0
  732. data/lib/pubid/oiml/identifiers/document.rb +15 -0
  733. data/lib/pubid/oiml/identifiers/errata.rb +15 -0
  734. data/lib/pubid/oiml/identifiers/expert_report.rb +15 -0
  735. data/lib/pubid/oiml/identifiers/guide.rb +15 -0
  736. data/lib/pubid/oiml/identifiers/recommendation.rb +15 -0
  737. data/lib/pubid/oiml/identifiers/seminar_report.rb +15 -0
  738. data/lib/pubid/oiml/identifiers/vocabulary.rb +15 -0
  739. data/lib/pubid/oiml/identifiers.rb +20 -0
  740. data/lib/pubid/oiml/parser.rb +274 -0
  741. data/lib/pubid/oiml/renderer.rb +232 -0
  742. data/lib/pubid/oiml/single_identifier.rb +113 -0
  743. data/lib/pubid/oiml/supplement_identifier.rb +88 -0
  744. data/lib/pubid/oiml/urn_generator.rb +78 -0
  745. data/lib/pubid/oiml/urn_parser.rb +39 -0
  746. data/lib/pubid/oiml.rb +81 -0
  747. data/lib/pubid/omg/builder.rb +19 -0
  748. data/lib/pubid/omg/identifier.rb +47 -0
  749. data/lib/pubid/omg/identifiers/specification.rb +32 -0
  750. data/lib/pubid/omg/identifiers.rb +9 -0
  751. data/lib/pubid/omg/parser.rb +40 -0
  752. data/lib/pubid/omg/renderer.rb +19 -0
  753. data/lib/pubid/omg.rb +51 -0
  754. data/lib/pubid/parser/common_parse_methods.rb +13 -0
  755. data/lib/pubid/parser/common_parse_rules.rb +56 -0
  756. data/lib/pubid/parser/grammar.rb +74 -0
  757. data/lib/pubid/parser.rb +9 -0
  758. data/lib/pubid/parsers/base.rb +11 -0
  759. data/lib/pubid/parsers/mr_string.rb +206 -0
  760. data/lib/pubid/plateau/builder.rb +54 -0
  761. data/lib/pubid/plateau/identifier.rb +4 -0
  762. data/lib/pubid/plateau/identifiers/annex.rb +16 -0
  763. data/lib/pubid/plateau/identifiers/base.rb +55 -0
  764. data/lib/pubid/plateau/identifiers/handbook.rb +28 -0
  765. data/lib/pubid/plateau/identifiers/technical_report.rb +16 -0
  766. data/lib/pubid/plateau/identifiers.rb +11 -0
  767. data/lib/pubid/plateau/parser.rb +73 -0
  768. data/lib/pubid/plateau/renderer.rb +51 -0
  769. data/lib/pubid/plateau/supplement_identifier.rb +68 -0
  770. data/lib/pubid/plateau/urn_generator.rb +29 -0
  771. data/lib/pubid/plateau/urn_parser.rb +43 -0
  772. data/lib/pubid/plateau.rb +82 -0
  773. data/lib/pubid/prefixes_support.rb +51 -0
  774. data/lib/pubid/renderers/annotator.rb +233 -0
  775. data/lib/pubid/renderers/base.rb +66 -0
  776. data/lib/pubid/renderers/directives_renderer.rb +75 -0
  777. data/lib/pubid/renderers/guide_renderer.rb +26 -0
  778. data/lib/pubid/renderers/human_readable.rb +83 -0
  779. data/lib/pubid/renderers/iwa_renderer.rb +20 -0
  780. data/lib/pubid/renderers/mr_string.rb +64 -0
  781. data/lib/pubid/renderers/supplement_renderer.rb +36 -0
  782. data/lib/pubid/renderers/urn.rb +11 -0
  783. data/lib/pubid/renderers.rb +15 -0
  784. data/lib/pubid/rendering/context.rb +168 -0
  785. data/lib/pubid/rendering/date.rb +27 -0
  786. data/lib/pubid/rendering/language.rb +21 -0
  787. data/lib/pubid/rendering/numbering.rb +42 -0
  788. data/lib/pubid/rendering/publisher.rb +25 -0
  789. data/lib/pubid/rendering/stage.rb +38 -0
  790. data/lib/pubid/rendering/supplement.rb +46 -0
  791. data/lib/pubid/rendering.rb +13 -0
  792. data/lib/pubid/sae/builder.rb +32 -0
  793. data/lib/pubid/sae/components/code.rb +9 -0
  794. data/lib/pubid/sae/components/date.rb +27 -0
  795. data/lib/pubid/sae/components/type.rb +23 -0
  796. data/lib/pubid/sae/components.rb +11 -0
  797. data/lib/pubid/sae/identifier.rb +4 -0
  798. data/lib/pubid/sae/identifiers/base.rb +47 -0
  799. data/lib/pubid/sae/identifiers.rb +8 -0
  800. data/lib/pubid/sae/parser.rb +55 -0
  801. data/lib/pubid/sae/renderer.rb +36 -0
  802. data/lib/pubid/sae/urn_generator.rb +30 -0
  803. data/lib/pubid/sae/urn_parser.rb +36 -0
  804. data/lib/pubid/sae.rb +66 -0
  805. data/lib/pubid/tgpp/builder.rb +41 -0
  806. data/lib/pubid/tgpp/identifier.rb +107 -0
  807. data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
  808. data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
  809. data/lib/pubid/tgpp/identifiers.rb +11 -0
  810. data/lib/pubid/tgpp/parser.rb +78 -0
  811. data/lib/pubid/tgpp/renderer.rb +52 -0
  812. data/lib/pubid/tgpp/urn_generator.rb +39 -0
  813. data/lib/pubid/tgpp/urn_parser.rb +30 -0
  814. data/lib/pubid/tgpp.rb +83 -0
  815. data/lib/pubid/type_resolver.rb +59 -0
  816. data/lib/pubid/un/builder.rb +42 -0
  817. data/lib/pubid/un/identifier.rb +40 -0
  818. data/lib/pubid/un/identifiers/document.rb +24 -0
  819. data/lib/pubid/un/identifiers.rb +9 -0
  820. data/lib/pubid/un/parser.rb +25 -0
  821. data/lib/pubid/un/renderer.rb +11 -0
  822. data/lib/pubid/un.rb +46 -0
  823. data/lib/pubid/urn_generator/base.rb +110 -0
  824. data/lib/pubid/urn_parser/base.rb +81 -0
  825. data/lib/pubid/urn_parser/errors.rb +16 -0
  826. data/lib/pubid/urn_parser.rb +14 -0
  827. data/lib/pubid/utils/string_normalizer.rb +196 -0
  828. data/lib/pubid/utils.rb +7 -0
  829. data/lib/pubid/version.rb +3 -1
  830. data/lib/pubid/w3c/builder.rb +55 -0
  831. data/lib/pubid/w3c/identifier.rb +130 -0
  832. data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
  833. data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
  834. data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
  835. data/lib/pubid/w3c/identifiers/note.rb +30 -0
  836. data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
  837. data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
  838. data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
  839. data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
  840. data/lib/pubid/w3c/identifiers/standard.rb +12 -0
  841. data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
  842. data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
  843. data/lib/pubid/w3c/identifiers.rb +25 -0
  844. data/lib/pubid/w3c/parser.rb +43 -0
  845. data/lib/pubid/w3c/renderer.rb +35 -0
  846. data/lib/pubid/w3c/urn_generator.rb +18 -0
  847. data/lib/pubid/w3c/urn_parser.rb +36 -0
  848. data/lib/pubid/w3c.rb +67 -0
  849. data/lib/pubid/xsf/builder.rb +17 -0
  850. data/lib/pubid/xsf/identifier.rb +66 -0
  851. data/lib/pubid/xsf/identifiers/xep.rb +31 -0
  852. data/lib/pubid/xsf/identifiers.rb +9 -0
  853. data/lib/pubid/xsf/parser.rb +25 -0
  854. data/lib/pubid/xsf/renderer.rb +23 -0
  855. data/lib/pubid/xsf/urn_generator.rb +13 -0
  856. data/lib/pubid/xsf/urn_parser.rb +18 -0
  857. data/lib/pubid/xsf.rb +81 -0
  858. data/lib/pubid.rb +551 -13
  859. data/lib/tasks/docs.rake +37 -0
  860. data/lib/tasks/export.rake +39 -0
  861. data/lib/tasks/website-data.json +7546 -0
  862. metadata +875 -171
  863. data/lib/pubid/registry.rb +0 -30
@@ -0,0 +1,163 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ # Turns the parse tree into the matching concrete identifier. Each root
6
+ # branch tags its subtree with a distinct key, so dispatch is a lookup on
7
+ # which key the parser produced.
8
+ class Builder
9
+ def self.build(parsed_data)
10
+ new.build(parsed_data)
11
+ end
12
+
13
+ def build(data)
14
+ if data[:committee_short]
15
+ build_committee(data[:committee_short], form: "short")
16
+ elsif data[:committee_long_en]
17
+ build_committee(data[:committee_long_en], form: "long", language: "E")
18
+ elsif data[:committee_bare]
19
+ # Bare MRA form: no type word, so build_committee yields nil type.
20
+ build_committee(data[:committee_bare], form: "short")
21
+ elsif data[:committee_long_fr]
22
+ build_committee(data[:committee_long_fr], form: "long", language: "F")
23
+ elsif data[:meeting_en]
24
+ build_meeting(data[:meeting_en])
25
+ elsif data[:meeting_fr]
26
+ build_meeting(data[:meeting_fr], language: "F")
27
+ elsif data.key?(:metrologia)
28
+ build_metrologia(data[:metrologia])
29
+ elsif data[:si_brochure]
30
+ build_si_brochure(data[:si_brochure])
31
+ elsif data[:si_brochure_variant]
32
+ build_si_brochure_variant(data[:si_brochure_variant])
33
+ elsif data.key?(:si_brochure_section)
34
+ build_si_brochure_section(data[:si_brochure_section])
35
+ elsif data[:mep]
36
+ build_mep(data[:mep])
37
+ elsif data[:guide]
38
+ build_guide(data[:guide])
39
+ else
40
+ raise "Unrecognized BIPM parse tree: #{data.inspect}"
41
+ end
42
+ end
43
+
44
+ private
45
+
46
+ # `group` and `language` are normalized here, so a historic committee
47
+ # name (CCDS) and a two-letter language code (EN/FR) never reach an
48
+ # attribute — the index stores only the current name and the one-letter
49
+ # code BIPM prints.
50
+ def build_committee(node, form:, language: nil)
51
+ Identifiers::CommitteeDocument.new(
52
+ group: Identifier.normalize_group(node[:group]),
53
+ type_code: Identifier::TYPE_WORD_TO_CODE[node[:type_word].to_s],
54
+ number: node[:number]&.to_s,
55
+ year: node[:year]&.to_s&.to_i,
56
+ language: Identifier.normalize_language(language || node[:language]),
57
+ form: form,
58
+ )
59
+ end
60
+
61
+ def build_meeting(node, language: nil)
62
+ Identifiers::Meeting.new(
63
+ group: Identifier.normalize_group(node[:group]),
64
+ number: node[:number].to_s,
65
+ year: node[:year]&.to_s&.to_i,
66
+ language: Identifier.normalize_language(language || node[:language]),
67
+ )
68
+ end
69
+
70
+ # `number` is the volume, so every article of a volume clusters into one
71
+ # relaton-index bucket (the IETF draft-slug / IANA registry-slug
72
+ # convention). It is nil only for the journal-level record, which carries
73
+ # no volume at all.
74
+ #
75
+ # It is deliberately redundant with `volume`, which stays because the
76
+ # renderer and the URN generator read it. Two limits of that redundancy,
77
+ # both accepted rather than engineered around (see the note above
78
+ # NUMBER_SOURCE_ATTRIBUTES in identifier.rb for the half that IS
79
+ # handled):
80
+ #
81
+ # * THE BUILDER IS THE CONSTRUCTOR OF RECORD. A caller that bypasses it
82
+ # — `MetrologiaArticle.new(volume: 51, …)` — gets a nil `number` and
83
+ # so an empty index key. Deriving it in `initialize` instead would
84
+ # cover that, but `#exclude` rebuilds through `self.class.new`, so it
85
+ # would also silently re-fill a `number` the caller just excluded.
86
+ # * NO SELF-HEALING ACROSS from_hash. lutaml assigns attributes AFTER
87
+ # `initialize`, so a legacy pre-`number` index row (one carrying only
88
+ # `volume`) deserializes with `number` nil and no error at all —
89
+ # lutaml ignores unknown keys and relaton's `id_supported?` skips its
90
+ # round-trip check for concrete subclasses, which every BIPM id is.
91
+ # relaton-data-bipm must regenerate index-v2 to gain the key. This is
92
+ # weaker than the IEEE `CodeNumber` mixin, which rebuilds `code_obj`
93
+ # from its split columns after `from_hash`.
94
+ def build_metrologia(node)
95
+ node = {} unless node.is_a?(Hash)
96
+ Identifiers::MetrologiaArticle.new(
97
+ number: node[:volume]&.to_s,
98
+ issue: node[:issue]&.to_s,
99
+ article: node[:article]&.to_s,
100
+ )
101
+ end
102
+
103
+ # The SI Brochure has no document number of its own, so the edition is
104
+ # the index key — it clusters the English and French records of one
105
+ # edition. The grammar makes `edition` mandatory here, so it is never nil.
106
+ def build_si_brochure(node)
107
+ Identifiers::SiBrochure.new(
108
+ number: node[:edition].to_s,
109
+ edition: node[:edition].to_s,
110
+ version: node[:version].to_s,
111
+ years: node[:years].to_s,
112
+ language: Identifier.normalize_language(node[:language]),
113
+ )
114
+ end
115
+
116
+ # The derived products (Appendix N, Concise, FAQ) carry no edition, so
117
+ # the variant name is their key. The grammar makes it mandatory here.
118
+ def build_si_brochure_variant(node)
119
+ variant = node[:variant].to_s
120
+ Identifiers::SiBrochure.new(number: variant, variant: variant)
121
+ end
122
+
123
+ # A bare or sectioned reference names no edition, so it gets no key: it is
124
+ # a partial reference that wildcards every edition. The bare form captures
125
+ # nothing, so the parser hands back a slice rather than a hash.
126
+ def build_si_brochure_section(node)
127
+ node = {} unless node.is_a?(Hash)
128
+ Identifiers::SiBrochure.new(part: node[:part]&.to_s)
129
+ end
130
+
131
+ # The Appendix/Annex/Part tail is the full-content spelling of the SAME
132
+ # document, so it stays out of the key.
133
+ def build_mep(node)
134
+ Identifiers::Mep.new(
135
+ **mep_codes(node),
136
+ appendix: node[:appendix]&.to_s,
137
+ annex: node[:annex]&.to_s,
138
+ part: node[:part]&.to_s,
139
+ )
140
+ end
141
+
142
+ # A MEP is identified by its unit code, or by the report code for the
143
+ # `Rapport BIPM-YYYY/NN` variant; exactly one of the two is set, and
144
+ # whichever it is becomes the relaton index key.
145
+ def mep_codes(node)
146
+ mep_code = node[:mep_code]&.to_s
147
+ report_code = node[:report_code]&.to_s
148
+ { number: mep_code || report_code, mep_code: mep_code,
149
+ report_code: report_code }
150
+ end
151
+
152
+ def build_guide(node)
153
+ Identifiers::Guide.new(
154
+ group: Identifier.normalize_group(node[:group]),
155
+ guide_kind: node[:guide_kind].to_s,
156
+ number: node[:number].to_s,
157
+ appendix: node[:appendix]&.to_s,
158
+ part: node[:part]&.to_s,
159
+ )
160
+ end
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,285 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ # Base class for every BIPM identifier AND the flavor's parse/create entry
6
+ # point — mirrors Pubid::Jis::Identifier. Concrete identifiers under
7
+ # Pubid::Bipm::Identifiers descend from this class.
8
+ #
9
+ # BIPM has several unrelated document families (committee documents,
10
+ # meetings, the Metrologia journal, the SI Brochure and its appendices,
11
+ # mises en pratique, and Consultative-Committee guides) with no shared
12
+ # numbering, so every family-specific attribute lives here as a flat,
13
+ # nil-defaulted attribute and is used only by the classes that need it. The
14
+ # canonical `to_hash` drops any attribute at its default/empty value, so an
15
+ # unused attribute never appears in a family's serialized hash.
16
+ class Identifier < ::Pubid::Identifier
17
+ # Committee acronyms BIPM owns (JCGM excluded — see Pubid::Jcgm).
18
+ GROUPS = %w[
19
+ CIPM CGPM JCRB CCTF CCQM CCT CCL CCAUV CCU CCM CCEM CCPR CCRI
20
+ ].freeze
21
+
22
+ # Historic committee names consumer references still use. BIPM renamed the
23
+ # CCDS (Comité Consultatif pour la Définition de la Seconde) to CCTF in
24
+ # 1997 and the index keys the current name, so an alias is resolved at
25
+ # parse time and never stored. Extend the map, not the parser, to add one.
26
+ GROUP_ALIASES = { "CCDS" => "CCTF" }.freeze
27
+
28
+ # Every group token the grammar accepts, current names and aliases alike.
29
+ PARSEABLE_GROUPS = (GROUPS + GROUP_ALIASES.keys).freeze
30
+
31
+ # Two-letter codes consumer references use for the one-letter language
32
+ # codes BIPM prints. Resolved at parse time, so only "E"/"F" is stored.
33
+ LANGUAGE_ALIASES = { "EN" => "E", "FR" => "F" }.freeze
34
+
35
+ # Committee document type codes and their printed long-form names. Note
36
+ # DECL prints as "Statement" in BOTH languages in the source data.
37
+ TYPE_CODES = %w[REC RES DECN ACT DECL].freeze
38
+ TYPE_NAME_EN = {
39
+ "REC" => "Recommendation", "RES" => "Resolution",
40
+ "DECN" => "Decision", "ACT" => "Action", "DECL" => "Statement"
41
+ }.freeze
42
+ TYPE_NAME_FR = {
43
+ "REC" => "Recommandation", "RES" => "Résolution",
44
+ "DECN" => "Décision", "ACT" => "Action", "DECL" => "Statement"
45
+ }.freeze
46
+ # Printed type words that are not the canonical name of their code. BIPM
47
+ # prints DECL as "Statement" in both languages, but a reference spells the
48
+ # word out; without these the parser matched "Declaration" and then mapped
49
+ # it to NO code, so the renderer emitted a corrupt "CGPM 1 (1971)".
50
+ TYPE_WORD_ALIASES = {
51
+ "Declaration" => "DECL", "Déclaration" => "DECL"
52
+ }.freeze
53
+
54
+ # Every printed type word (abbrev + English + French + alias) → code.
55
+ TYPE_WORD_TO_CODE = TYPE_CODES.each_with_object({}) do |code, map|
56
+ map[code] = code
57
+ map[TYPE_NAME_EN[code]] = code
58
+ map[TYPE_NAME_FR[code]] = code
59
+ end.merge(TYPE_WORD_ALIASES).freeze
60
+
61
+ # Shared attributes (flat). Booleans/strings carry no default so they stay
62
+ # nil and drop from the serialized hash unless set.
63
+ attribute :group, :string
64
+ attribute :type_code, :string # REC/RES/DECN/ACT/DECL (avoids base `type`)
65
+ attribute :number, :string # may be hyphenated ("10-1") or nil
66
+ attribute :year, :integer
67
+ attribute :language, :string # "E"/"F"; nil = language-neutral
68
+ # Surface style of committee documents: "short" (abbreviated key form) vs
69
+ # "long" (full type-word name). Defaults to "short" so it drops from the
70
+ # canonical hash for the indexed primary form.
71
+ attribute :form, :string, default: "short"
72
+ # Metrologia journal fields. `volume` is NOT stored — it is exactly the
73
+ # index key, so MetrologiaArticle derives it from `number` (the IANA
74
+ # `registry` / IETF `series` pattern) rather than serializing both.
75
+ attribute :issue, :string # may be alphanumeric ("1A")
76
+ attribute :article, :string
77
+ # SI Brochure fields.
78
+ attribute :edition, :string # "9e"
79
+ attribute :version, :string # "v3.01"
80
+ attribute :years, :string # "2019/2024"
81
+ # SI Brochure appendix/derived variant: "Appendix 3", "Concise", "FAQ".
82
+ attribute :variant, :string
83
+ # Mise en pratique (MEP) fields.
84
+ attribute :mep_code, :string # "S1", "KUPRTM"
85
+ attribute :report_code, :string # MEP report variant: "BIPM-2019/05"
86
+ # Consultative-Committee guide kind ("MeP"/"RSI"); group + number reused.
87
+ attribute :guide_kind, :string
88
+ # Full-content "Appendix N [Annex N] Part N.M" tail shared by MEP + guide
89
+ # primary-docidentifier forms (nil for the bare short docnumber spelling).
90
+ attribute :appendix, :string
91
+ attribute :annex, :string
92
+ attribute :part, :string
93
+
94
+ # Attributes `Builder` derives `number` from for the families that have no
95
+ # document number of their own. Excluding one of these has to clear
96
+ # `number` too, or a wildcarded identifier would keep a stale index key —
97
+ # the "reset the WHOLE cluster, not just the scalar" lesson CLAUDE.md
98
+ # records for CSA's year and IEEE's year/month/day. `:volume` is listed
99
+ # even though it is no longer an attribute: the base loop skips it, but
100
+ # `exclude(:volume)` must still clear the key it derives from.
101
+ NUMBER_SOURCE_ATTRIBUTES = %i[
102
+ volume edition variant mep_code report_code
103
+ ].freeze
104
+
105
+ # Polymorphic type map for lutaml::Model key_value (de)serialization:
106
+ # maps each subclass's polymorphic_name to its class name so a stored hash
107
+ # rebuilds the correct identifier type via from_hash.
108
+ BIPM_TYPE_MAP = {
109
+ "pubid:bipm:committee-document" =>
110
+ "Pubid::Bipm::Identifiers::CommitteeDocument",
111
+ "pubid:bipm:meeting" => "Pubid::Bipm::Identifiers::Meeting",
112
+ "pubid:bipm:metrologia-article" =>
113
+ "Pubid::Bipm::Identifiers::MetrologiaArticle",
114
+ "pubid:bipm:si-brochure" => "Pubid::Bipm::Identifiers::SiBrochure",
115
+ "pubid:bipm:mep" => "Pubid::Bipm::Identifiers::Mep",
116
+ "pubid:bipm:guide" => "Pubid::Bipm::Identifiers::Guide",
117
+ }.freeze
118
+
119
+ key_value do
120
+ map "_type", to: :_type, polymorphic_map: BIPM_TYPE_MAP
121
+ map "group", to: :group
122
+ map "type_code", to: :type_code
123
+ map "number", to: :number
124
+ map "year", to: :year
125
+ map "language", to: :language
126
+ map "form", to: :form
127
+ map "issue", to: :issue
128
+ map "article", to: :article
129
+ map "edition", to: :edition
130
+ map "version", to: :version
131
+ map "years", to: :years
132
+ map "variant", to: :variant
133
+ map "mep_code", to: :mep_code
134
+ map "report_code", to: :report_code
135
+ map "guide_kind", to: :guide_kind
136
+ map "appendix", to: :appendix
137
+ map "annex", to: :annex
138
+ map "part", to: :part
139
+ end
140
+
141
+ # Publisher is always "BIPM". A plain constant (not a `publisher` method)
142
+ # so it doesn't shadow the inherited lutaml `publisher` attribute, which
143
+ # would otherwise fail serialization type validation.
144
+ PUBLISHER = "BIPM"
145
+
146
+ # French connective before a committee acronym: "de la" for the (feminine)
147
+ # CGPM, "du" for every other (masculine) committee.
148
+ def self.french_connective(group)
149
+ group == "CGPM" ? "de la" : "du"
150
+ end
151
+
152
+ # Resolve a historic committee name to the name the index keys.
153
+ def self.normalize_group(token)
154
+ name = token.to_s
155
+ GROUP_ALIASES.fetch(name, name)
156
+ end
157
+
158
+ # Resolve a two-letter language code to the one-letter code BIPM prints.
159
+ def self.normalize_language(token)
160
+ return nil if token.nil?
161
+
162
+ code = token.to_s
163
+ LANGUAGE_ALIASES.fetch(code, code)
164
+ end
165
+
166
+ def long?
167
+ form == "long"
168
+ end
169
+
170
+ # BIPM keeps the publication year in its own `year` integer attribute
171
+ # rather than the base `date` component, so the base #exclude's
172
+ # :year->:date remap would nil the (unused) inherited `date` and leave
173
+ # `year` intact. Clear `year` directly when either alias is excluded so
174
+ # `matches?(row, ignore: [:year])` treats a partial (date-less) reference
175
+ # as a year wildcard.
176
+ def exclude(*args)
177
+ result = super
178
+ result.year = nil if args.include?(:year) || args.include?(:date)
179
+ result.number = nil if args.intersect?(NUMBER_SOURCE_ATTRIBUTES)
180
+ result
181
+ end
182
+
183
+ # Basic string representation. Delegates to renderer.
184
+ def to_s(**opts)
185
+ render(format: :human, **opts)
186
+ end
187
+
188
+ # --- MR string / slug -------------------------------------------------
189
+ #
190
+ # `to_slug` is what consumers use as an output FILENAME, so every BIPM
191
+ # identifier needs a non-empty, filename-safe, non-colliding MR. None of
192
+ # the base ::Pubid::Identifier hooks work here unchanged, because BIPM
193
+ # models each of them with its own flat attribute rather than the shared
194
+ # component the base expects. Each override below says which.
195
+ #
196
+ # The number segment and the family discriminator are supplied per leaf
197
+ # (`mr_number_with_part` / `mr_type`), because BIPM's six families share
198
+ # no numbering.
199
+ #
200
+ # Three deliberate collapses — MR is a canonical DOCUMENT slug, so
201
+ # alternate print spellings of one document share it (the URN already
202
+ # collapses the first two): `form` (short vs long committee spelling) and
203
+ # the MEP/Guide `appendix`/`annex`/`part` full-content tail are omitted,
204
+ # while `language` is kept because the E and F records are distinct
205
+ # documents upstream.
206
+
207
+ # BIPM keeps its publisher in the PUBLISHER constant rather than the
208
+ # inherited `publisher` attribute (which would fail type validation), so
209
+ # the base hook — `publisher&.to_s` — is nil. The JIS/IANA shape.
210
+ def mr_publisher
211
+ PUBLISHER.downcase
212
+ end
213
+
214
+ # BIPM stores the publication year in its own :integer attribute rather
215
+ # than a Components::Date, so the base hook reads an unset `date`.
216
+ def mr_year
217
+ year&.to_s
218
+ end
219
+
220
+ # BIPM's `edition` is a plain :string ("9e"), not a Components::Edition,
221
+ # so the base hook's `edition.number` raises NoMethodError. SiBrochure
222
+ # folds the edition into its own number segment instead.
223
+ def mr_edition
224
+ nil
225
+ end
226
+
227
+ # BIPM has a single `language` string, not the base's `languages`
228
+ # collection.
229
+ def mr_languages
230
+ language&.to_s&.downcase
231
+ end
232
+
233
+ # BIPM uses its own `type_code` attribute rather than a typed_stage, so
234
+ # the base hook is always nil; the leaves supply the discriminator.
235
+ def mr_type
236
+ nil
237
+ end
238
+
239
+ # Join the parts of a number segment into one filename-safe token.
240
+ #
241
+ # The sanitisation is by CHARSET, not an enumerated escape list, so a
242
+ # field added later cannot leak an unsafe character: everything outside
243
+ # [a-z0-9] collapses to `-`. BIPM needs at least three of those today —
244
+ # a `/` (the MEP report code "BIPM-2019/05"), a space (the SI Brochure
245
+ # variant "Appendix 3") and a `.` (the brochure version "v3.01"). The
246
+ # dot matters beyond filename safety: Renderers::MrString joins SEGMENTS
247
+ # with ".", so a dot inside one would break the documented segment
248
+ # structure.
249
+ #
250
+ # Caveat: `-` is both the intra-segment join and a substitute, so two
251
+ # different field splits could in principle produce one slug. That
252
+ # cannot happen with today's grammar — none of `group`, `guide_kind`,
253
+ # `mep_code`, `issue` or `article` admits a `-`, and `number`'s own
254
+ # internal `-` ("10-1") is unambiguous because the `group` before it
255
+ # cannot contain one. A future hyphen-bearing free-text field would
256
+ # need a different join.
257
+ def mr_slug(*parts)
258
+ slug = parts.compact.map(&:to_s).reject(&:empty?).join("-").downcase
259
+ slug = slug.gsub(/[^a-z0-9]+/, "-").gsub(/\A-+|-+\z/, "")
260
+ slug unless slug.empty?
261
+ end
262
+
263
+ # Parse a BIPM identifier string into an identifier object.
264
+ # @param identifier [String] the BIPM identifier string
265
+ # @return [Identifier] the appropriate identifier object
266
+ # @raise [Pubid::Errors::ParseError] if parsing fails
267
+ def self.parse(identifier)
268
+ unless identifier.is_a?(String)
269
+ raise Pubid::Errors::InvalidInputError,
270
+ Pubid::INPUT_NOT_A_STRING_MESSAGE
271
+ end
272
+
273
+ if identifier.length > Pubid::MAX_INPUT_LENGTH
274
+ raise Pubid::Errors::InvalidInputError, Pubid::INPUT_TOO_LONG_MESSAGE
275
+ end
276
+
277
+ # Normalize legacy/docnumber-style spellings before parsing
278
+ # (data/bipm/update_codes.yaml), mirroring Pubid::Ccsds / Pubid::Plateau.
279
+ normalized = Core::UpdateCodes.apply(identifier, :bipm)
280
+ parsed = Parser.parse(normalized)
281
+ Builder.build(parsed)
282
+ end
283
+ end
284
+ end
285
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ module Identifiers
6
+ # A committee document: a Recommendation (REC), Resolution (RES),
7
+ # Decision (DECN), Action (ACT) or Declaration (DECL) issued by one of the
8
+ # BIPM committees.
9
+ #
10
+ # Printed forms (all round-trip):
11
+ # "CCTF REC 2 (2012)" short, language-neutral
12
+ # "CCTF REC 2 (2012, E)" short, with language
13
+ # "CGPM DECL (1889)" number-less
14
+ # "CCL Recommendation 1 (2001)" full English name (form: "long")
15
+ # "Recommandation 1 du CCL (2001)" full French name (form: "long")
16
+ class CommitteeDocument < Identifier
17
+ def self.type
18
+ { key: :committee_document, web: :committee_document,
19
+ title: "Committee Document", short: "committee-document" }
20
+ end
21
+
22
+ # MR: `bipm.<type>.<group>-<number>.<year>[.<lang>]`. The type code
23
+ # discriminates REC/RES/DECN/ACT/DECL; the bare CIPM MRA form has none.
24
+ def mr_type
25
+ type_code&.downcase
26
+ end
27
+
28
+ # The group has to be in the number segment or `CCTF REC 2` and
29
+ # `CCEM REC 2` would share a slug.
30
+ def mr_number_with_part
31
+ mr_slug(group, number)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ module Identifiers
6
+ # A Consultative-Committee guideline document (realization / calibration
7
+ # guide). Printed from its short docnumber form, the relaton index key.
8
+ #
9
+ # Printed forms (all round-trip):
10
+ # "CCL-GD-MeP-1" metre realization guide
11
+ # "CCEM-GD-RSI-1" ampere realization guide
12
+ # "CCM-GD-RSI-2" kilogram dissemination guide
13
+ #
14
+ # Shape: <committee>-GD-<kind>-<number>, where <kind> is "MeP" (mise en
15
+ # pratique guide) or "RSI" (réalisation du SI guide). The committee reuses
16
+ # the shared `group` attribute; the trailing sequence reuses `number`.
17
+ class Guide < Identifier
18
+ def self.type
19
+ { key: :guide, web: :guide, title: "Guide", short: "guide" }
20
+ end
21
+
22
+ # MR: `bipm.guide.<group>-<kind>-<number>`. Both the committee and the
23
+ # kind are needed — the trailing sequence restarts per committee, so
24
+ # `CCL-GD-MeP-1` and `CCEM-GD-RSI-1` both carry number "1".
25
+ def mr_type
26
+ "guide"
27
+ end
28
+
29
+ def mr_number_with_part
30
+ mr_slug(group, guide_kind, number)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ module Identifiers
6
+ # A committee meeting (proceedings). Printed with a naive ordinal derived
7
+ # from the first number component's last digit (as the source data
8
+ # generates it: "11st", "12nd", "13rd"), and ranges keep that first
9
+ # component's ordinal ("100-1th").
10
+ #
11
+ # Printed forms (all round-trip):
12
+ # "CGPM 17th Meeting (1983)" English (language nil)
13
+ # "CCAUV 11st Meeting (2017)" naive ordinal
14
+ # "CIPM 100-1th Meeting (2011)" range
15
+ # "CCAUV 10<sup>e</sup> réunion (2015)" French (language "F")
16
+ class Meeting < Identifier
17
+ def self.type
18
+ { key: :meeting, web: :meeting, title: "Meeting", short: "meeting" }
19
+ end
20
+
21
+ # English ordinal suffix from the first number component's last digit.
22
+ # Naive (matches the source data): 1→st, 2→nd, 3→rd, else→th — no
23
+ # 11/12/13 exception, so "11" → "11st", and a range "22-23" → "22-23nd".
24
+ def self.ordinal_suffix(number)
25
+ first = number.to_s.split("-").first.to_s
26
+ case first[-1]
27
+ when "1" then "st"
28
+ when "2" then "nd"
29
+ when "3" then "rd"
30
+ else "th"
31
+ end
32
+ end
33
+
34
+ # "15" → "15th", "100-1" → "100-1th".
35
+ def ordinal_en
36
+ "#{number}#{self.class.ordinal_suffix(number)}"
37
+ end
38
+
39
+ # MR: `bipm.meeting.<group>-<number>.<year>`. The English and French
40
+ # spellings of one meeting collapse onto the same slug on purpose.
41
+ def mr_type
42
+ "meeting"
43
+ end
44
+
45
+ # The group has to be in the number segment or the 17th CGPM and the
46
+ # 17th CIPM meeting would share a slug.
47
+ def mr_number_with_part
48
+ mr_slug(group, number)
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ module Identifiers
6
+ # A mise en pratique (MEP) of an SI base-unit definition, and the related
7
+ # BIPM report variant. Printed from the short docnumber form that relaton
8
+ # uses as the index key — NOT the long "Appendix 2 Part x" content string.
9
+ #
10
+ # Printed forms (all round-trip):
11
+ # "SI MEP S1" standard MEP code (unit letter + number)
12
+ # "SI MEP KUPRTM" alphabetic MEP code
13
+ # "Rapport BIPM-2019/05" report variant (mep_code absent, report_code set)
14
+ class Mep < Identifier
15
+ def self.type
16
+ { key: :mep, web: :mep, title: "Mise en pratique", short: "mep" }
17
+ end
18
+
19
+ # MR: `bipm.mep.<code>`. Exactly one of `mep_code` / `report_code` is
20
+ # set; the report code carries a `/` that `mr_slug` sanitises away. The
21
+ # full-content "Appendix 2 Part x" tail is the same document, so it
22
+ # stays out of the slug.
23
+ def mr_type
24
+ "mep"
25
+ end
26
+
27
+ def mr_number_with_part
28
+ mr_slug(mep_code || report_code)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Bipm
5
+ module Identifiers
6
+ # A Metrologia journal reference, at volume, volume+issue, or
7
+ # volume+issue+article granularity. Issue may be alphanumeric ("1A") and
8
+ # the article keeps its printed form ("06007", "S138").
9
+ #
10
+ # Printed forms (all round-trip):
11
+ # "Metrologia 51" volume only
12
+ # "Metrologia 1 1" volume + issue
13
+ # "Metrologia 51 1 128" volume + issue + article
14
+ class MetrologiaArticle < Identifier
15
+ GROUP = "Metrologia"
16
+
17
+ def self.type
18
+ { key: :metrologia_article, web: :metrologia_article,
19
+ title: "Metrologia Article", short: "metrologia-article" }
20
+ end
21
+
22
+ # MR: `bipm.metrologia[.<volume>[-<issue>[-<article>]]]`.
23
+ # The volume IS the index key, so it is derived from `number` instead
24
+ # of being stored beside it — storing both would duplicate the same
25
+ # value in every one of the 6,204 published article rows. Kept as an
26
+ # Integer because that is the public type consumers already read
27
+ # (`Relaton::Bipm::Bibliography#id_hash` calls `pubid.volume`).
28
+ #
29
+ # Safe as a plain method only because `volume` is no longer a lutaml
30
+ # attribute anywhere in the hierarchy — a method that shadows a
31
+ # generated accessor corrupts attribute resolution (CLAUDE.md).
32
+ def volume
33
+ number&.to_i
34
+ end
35
+
36
+ def mr_type
37
+ "metrologia"
38
+ end
39
+
40
+ # `number` is only the volume (it is the CLUSTERING relaton-index key),
41
+ # so per-article distinctness has to come from here: the full triple.
42
+ def mr_number_with_part
43
+ mr_slug(volume, issue, article)
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end