pubid 2.0.0.pre.alpha.7 → 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 (485) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +9 -50
  3. data/data/bipm/update_codes.yaml +9 -0
  4. data/data/iec/update_codes.yaml +3 -0
  5. data/data/ieee/update_codes.yaml +107 -1
  6. data/data/nist/series.yaml +155 -0
  7. data/data/nist/update_codes.yaml +8 -0
  8. data/lib/pubid/adobe/builder.rb +52 -0
  9. data/lib/pubid/adobe/identifier.rb +49 -0
  10. data/lib/pubid/adobe/identifiers/publication.rb +31 -0
  11. data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
  12. data/lib/pubid/adobe/identifiers.rb +10 -0
  13. data/lib/pubid/adobe/parser.rb +128 -0
  14. data/lib/pubid/adobe/renderer.rb +39 -0
  15. data/lib/pubid/adobe/urn_generator.rb +42 -0
  16. data/lib/pubid/adobe/urn_parser.rb +69 -0
  17. data/lib/pubid/adobe.rb +60 -0
  18. data/lib/pubid/amca/builder.rb +2 -2
  19. data/lib/pubid/amca/identifier.rb +1 -3
  20. data/lib/pubid/amca/identifiers/base.rb +1 -6
  21. data/lib/pubid/amca/identifiers/interpretation.rb +1 -1
  22. data/lib/pubid/amca/identifiers/publication.rb +1 -1
  23. data/lib/pubid/amca/identifiers/standard.rb +1 -1
  24. data/lib/pubid/amca/identifiers.rb +0 -1
  25. data/lib/pubid/amca/single_identifier.rb +1 -1
  26. data/lib/pubid/amca.rb +3 -3
  27. data/lib/pubid/ashrae/builder.rb +22 -22
  28. data/lib/pubid/ashrae/identifier.rb +3 -4
  29. data/lib/pubid/ashrae/identifiers/addenda_package.rb +1 -1
  30. data/lib/pubid/ashrae/identifiers/addendum.rb +1 -1
  31. data/lib/pubid/ashrae/identifiers/base.rb +14 -8
  32. data/lib/pubid/ashrae/identifiers/combined_addenda.rb +1 -1
  33. data/lib/pubid/ashrae/identifiers.rb +0 -1
  34. data/lib/pubid/ashrae/parser.rb +14 -9
  35. data/lib/pubid/ashrae/renderer.rb +19 -19
  36. data/lib/pubid/ashrae/single_identifier.rb +1 -1
  37. data/lib/pubid/ashrae/supplement_identifier.rb +6 -6
  38. data/lib/pubid/ashrae.rb +3 -3
  39. data/lib/pubid/bipm/builder.rb +107 -0
  40. data/lib/pubid/bipm/identifier.rb +160 -0
  41. data/lib/pubid/bipm/identifiers/committee_document.rb +24 -0
  42. data/lib/pubid/bipm/identifiers/guide.rb +24 -0
  43. data/lib/pubid/bipm/identifiers/meeting.rb +41 -0
  44. data/lib/pubid/bipm/identifiers/mep.rb +21 -0
  45. data/lib/pubid/bipm/identifiers/metrologia_article.rb +24 -0
  46. data/lib/pubid/bipm/identifiers/si_brochure.rb +20 -0
  47. data/lib/pubid/bipm/identifiers.rb +15 -0
  48. data/lib/pubid/bipm/parser.rb +184 -0
  49. data/lib/pubid/bipm/renderer.rb +110 -0
  50. data/lib/pubid/bipm/urn_generator.rb +58 -0
  51. data/lib/pubid/bipm/urn_parser.rb +52 -0
  52. data/lib/pubid/bipm.rb +86 -0
  53. data/lib/pubid/bsi/builder.rb +14 -14
  54. data/lib/pubid/bsi/identifier.rb +0 -1
  55. data/lib/pubid/bsi/identifiers/addendum_document.rb +2 -2
  56. data/lib/pubid/bsi/identifiers/amendment.rb +4 -4
  57. data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +6 -0
  58. data/lib/pubid/bsi/identifiers/corrigendum.rb +4 -4
  59. data/lib/pubid/bsi/identifiers/expert_commentary.rb +5 -5
  60. data/lib/pubid/bsi/identifiers/supplement_document.rb +2 -2
  61. data/lib/pubid/bsi/identifiers/value_added_publication.rb +6 -6
  62. data/lib/pubid/bsi/renderer.rb +8 -8
  63. data/lib/pubid/bsi/single_identifier.rb +48 -0
  64. data/lib/pubid/builder/base.rb +5 -3
  65. data/lib/pubid/bundled_identifier.rb +3 -3
  66. data/lib/pubid/calconnect/builder.rb +38 -0
  67. data/lib/pubid/calconnect/identifier.rb +117 -0
  68. data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
  69. data/lib/pubid/calconnect/identifiers.rb +9 -0
  70. data/lib/pubid/calconnect/parser.rb +54 -0
  71. data/lib/pubid/calconnect/renderer.rb +36 -0
  72. data/lib/pubid/calconnect/urn_generator.rb +33 -0
  73. data/lib/pubid/calconnect/urn_parser.rb +34 -0
  74. data/lib/pubid/calconnect.rb +77 -0
  75. data/lib/pubid/ccsds/builder.rb +1 -1
  76. data/lib/pubid/ccsds/identifier.rb +1 -1
  77. data/lib/pubid/ccsds/identifiers/corrigendum.rb +2 -2
  78. data/lib/pubid/ccsds/supplement_identifier.rb +6 -6
  79. data/lib/pubid/ccsds/urn_generator.rb +3 -3
  80. data/lib/pubid/cen_cenelec/builder.rb +46 -12
  81. data/lib/pubid/cen_cenelec/identifiers/amendment.rb +2 -2
  82. data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +6 -0
  83. data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +2 -2
  84. data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +60 -3
  85. data/lib/pubid/cen_cenelec/identifiers/fragment.rb +2 -2
  86. data/lib/pubid/cen_cenelec/renderer.rb +5 -5
  87. data/lib/pubid/cen_cenelec/supplement_identifier.rb +5 -5
  88. data/lib/pubid/cen_cenelec/urn_generator.rb +1 -1
  89. data/lib/pubid/cen_cenelec.rb +76 -72
  90. data/lib/pubid/cie/builder.rb +139 -24
  91. data/lib/pubid/cie/identifier.rb +7 -3
  92. data/lib/pubid/cie/identifiers/bundle.rb +32 -4
  93. data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
  94. data/lib/pubid/cie/identifiers/conference.rb +9 -4
  95. data/lib/pubid/cie/identifiers/corrigendum.rb +17 -23
  96. data/lib/pubid/cie/identifiers/dual_published.rb +4 -4
  97. data/lib/pubid/cie/identifiers/identical.rb +7 -7
  98. data/lib/pubid/cie/identifiers/joint_published.rb +8 -8
  99. data/lib/pubid/cie/identifiers/proceedings.rb +39 -0
  100. data/lib/pubid/cie/identifiers/standard.rb +33 -7
  101. data/lib/pubid/cie/identifiers/supplement.rb +24 -22
  102. data/lib/pubid/cie/identifiers/tutorial_bundle.rb +6 -2
  103. data/lib/pubid/cie/identifiers.rb +2 -0
  104. data/lib/pubid/cie/parser.rb +54 -5
  105. data/lib/pubid/cie/single_identifier.rb +40 -1
  106. data/lib/pubid/cie/supplement_identifier.rb +29 -16
  107. data/lib/pubid/cie/urn_generator.rb +11 -8
  108. data/lib/pubid/cie.rb +0 -1
  109. data/lib/pubid/components/date.rb +21 -5
  110. data/lib/pubid/csa/builder.rb +1 -1
  111. data/lib/pubid/csa/composite_identifier.rb +17 -1
  112. data/lib/pubid/csa/identifier.rb +48 -3
  113. data/lib/pubid/csa/identifiers/bundled.rb +6 -0
  114. data/lib/pubid/csa/identifiers/combined.rb +6 -0
  115. data/lib/pubid/csa/identifiers/package.rb +2 -2
  116. data/lib/pubid/csa/parser.rb +6 -6
  117. data/lib/pubid/csa/wrapper_identifier.rb +17 -0
  118. data/lib/pubid/doi/builder.rb +18 -0
  119. data/lib/pubid/doi/identifier.rb +46 -0
  120. data/lib/pubid/doi/identifiers/resource.rb +30 -0
  121. data/lib/pubid/doi/identifiers.rb +9 -0
  122. data/lib/pubid/doi/parser.rb +52 -0
  123. data/lib/pubid/doi/renderer.rb +13 -0
  124. data/lib/pubid/doi.rb +55 -0
  125. data/lib/pubid/easc/builder.rb +55 -0
  126. data/lib/pubid/easc/identifier.rb +61 -0
  127. data/lib/pubid/easc/identifiers/pmg.rb +20 -0
  128. data/lib/pubid/easc/identifiers/rmg.rb +19 -0
  129. data/lib/pubid/easc/identifiers.rb +10 -0
  130. data/lib/pubid/easc/parser.rb +80 -0
  131. data/lib/pubid/easc/renderer.rb +48 -0
  132. data/lib/pubid/easc/urn_generator.rb +46 -0
  133. data/lib/pubid/easc/urn_parser.rb +57 -0
  134. data/lib/pubid/easc.rb +52 -0
  135. data/lib/pubid/ecma/builder.rb +31 -0
  136. data/lib/pubid/ecma/identifier.rb +76 -0
  137. data/lib/pubid/ecma/identifiers/memento.rb +30 -0
  138. data/lib/pubid/ecma/identifiers/standard.rb +31 -0
  139. data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
  140. data/lib/pubid/ecma/identifiers.rb +11 -0
  141. data/lib/pubid/ecma/parser.rb +41 -0
  142. data/lib/pubid/ecma/renderer.rb +46 -0
  143. data/lib/pubid/ecma/urn_generator.rb +25 -0
  144. data/lib/pubid/ecma/urn_parser.rb +35 -0
  145. data/lib/pubid/ecma.rb +67 -0
  146. data/lib/pubid/etsi/builder.rb +7 -3
  147. data/lib/pubid/etsi/identifier.rb +1 -3
  148. data/lib/pubid/etsi/identifiers/base.rb +28 -10
  149. data/lib/pubid/etsi/identifiers/etsi_standard.rb +128 -4
  150. data/lib/pubid/etsi/identifiers/supplement_identifier.rb +35 -3
  151. data/lib/pubid/etsi/identifiers.rb +0 -1
  152. data/lib/pubid/etsi/parser.rb +8 -2
  153. data/lib/pubid/etsi/renderer.rb +8 -2
  154. data/lib/pubid/etsi.rb +5 -5
  155. data/lib/pubid/export/exporter.rb +2 -1
  156. data/lib/pubid/export/flavor_exporter.rb +18 -3
  157. data/lib/pubid/gb/builder.rb +45 -0
  158. data/lib/pubid/gb/identifier.rb +64 -0
  159. data/lib/pubid/gb/identifiers/standard.rb +34 -0
  160. data/lib/pubid/gb/identifiers.rb +9 -0
  161. data/lib/pubid/gb/parser.rb +63 -0
  162. data/lib/pubid/gb/renderer.rb +35 -0
  163. data/lib/pubid/gb.rb +87 -0
  164. data/lib/pubid/gost/builder.rb +148 -0
  165. data/lib/pubid/gost/identifier.rb +49 -0
  166. data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
  167. data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
  168. data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
  169. data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
  170. data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
  171. data/lib/pubid/gost/identifiers.rb +13 -0
  172. data/lib/pubid/gost/parser.rb +97 -0
  173. data/lib/pubid/gost/renderer.rb +48 -0
  174. data/lib/pubid/gost/urn_generator.rb +46 -0
  175. data/lib/pubid/gost/urn_parser.rb +52 -0
  176. data/lib/pubid/gost.rb +49 -0
  177. data/lib/pubid/iala/builder.rb +22 -27
  178. data/lib/pubid/iala/identifier.rb +27 -2
  179. data/lib/pubid/iala/identifiers/advice.rb +1 -1
  180. data/lib/pubid/iala/identifiers/annex.rb +14 -12
  181. data/lib/pubid/iala/identifiers/general_assembly.rb +5 -2
  182. data/lib/pubid/iala/identifiers/guideline.rb +3 -1
  183. data/lib/pubid/iala/identifiers/letter.rb +1 -1
  184. data/lib/pubid/iala/identifiers/manual.rb +3 -1
  185. data/lib/pubid/iala/identifiers/model_course.rb +3 -1
  186. data/lib/pubid/iala/identifiers/recommendation.rb +3 -1
  187. data/lib/pubid/iala/identifiers/report.rb +1 -1
  188. data/lib/pubid/iala/identifiers/resolution.rb +1 -1
  189. data/lib/pubid/iala/identifiers/standard.rb +3 -1
  190. data/lib/pubid/iala/identifiers.rb +0 -1
  191. data/lib/pubid/iala/renderer.rb +1 -1
  192. data/lib/pubid/iala/urn_generator.rb +1 -1
  193. data/lib/pubid/iala/urn_parser.rb +19 -2
  194. data/lib/pubid/iala.rb +4 -4
  195. data/lib/pubid/iana/builder.rb +20 -0
  196. data/lib/pubid/iana/identifier.rb +72 -0
  197. data/lib/pubid/iana/identifiers/registry.rb +33 -0
  198. data/lib/pubid/iana/identifiers.rb +9 -0
  199. data/lib/pubid/iana/parser.rb +38 -0
  200. data/lib/pubid/iana/renderer.rb +29 -0
  201. data/lib/pubid/iana/urn_generator.rb +15 -0
  202. data/lib/pubid/iana/urn_parser.rb +24 -0
  203. data/lib/pubid/iana.rb +69 -0
  204. data/lib/pubid/identifier.rb +210 -23
  205. data/lib/pubid/idf/builder.rb +1 -1
  206. data/lib/pubid/idf/parser.rb +2 -2
  207. data/lib/pubid/idf/renderer.rb +1 -1
  208. data/lib/pubid/idf/supplement_identifier.rb +3 -3
  209. data/lib/pubid/iec/builder.rb +35 -25
  210. data/lib/pubid/iec/identifier.rb +47 -2
  211. data/lib/pubid/iec/identifiers/base.rb +2 -2
  212. data/lib/pubid/iec/identifiers/consolidated_identifier.rb +6 -0
  213. data/lib/pubid/iec/identifiers/fragment_identifier.rb +11 -11
  214. data/lib/pubid/iec/identifiers/international_standard.rb +8 -5
  215. data/lib/pubid/iec/identifiers/sheet_identifier.rb +12 -12
  216. data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
  217. data/lib/pubid/iec/identifiers/technical_report.rb +1 -1
  218. data/lib/pubid/iec/identifiers/technical_specification.rb +1 -1
  219. data/lib/pubid/iec/identifiers/vap_identifier.rb +12 -12
  220. data/lib/pubid/iec/identifiers.rb +1 -0
  221. data/lib/pubid/iec/parser.rb +51 -10
  222. data/lib/pubid/iec/renderer.rb +18 -8
  223. data/lib/pubid/iec/single_identifier.rb +1 -1
  224. data/lib/pubid/iec/supplement_identifier.rb +32 -19
  225. data/lib/pubid/iec.rb +1 -6
  226. data/lib/pubid/ieee/aiee/builder.rb +17 -3
  227. data/lib/pubid/ieee/aiee/identifier.rb +45 -61
  228. data/lib/pubid/ieee/builder.rb +341 -68
  229. data/lib/pubid/ieee/compaction.rb +121 -0
  230. data/lib/pubid/ieee/components/draft.rb +47 -7
  231. data/lib/pubid/ieee/identifier.rb +1 -3
  232. data/lib/pubid/ieee/identifiers/adopted_standard.rb +30 -5
  233. data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
  234. data/lib/pubid/ieee/identifiers/base.rb +106 -13
  235. data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
  236. data/lib/pubid/ieee/identifiers/conformance_identifier.rb +6 -2
  237. data/lib/pubid/ieee/identifiers/corrigendum.rb +17 -2
  238. data/lib/pubid/ieee/identifiers/csa_dual_published.rb +3 -3
  239. data/lib/pubid/ieee/identifiers/dual_identifier.rb +3 -3
  240. data/lib/pubid/ieee/identifiers/dual_published.rb +3 -3
  241. data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +102 -5
  242. data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +2 -1
  243. data/lib/pubid/ieee/identifiers/joint_development.rb +56 -11
  244. data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +1 -1
  245. data/lib/pubid/ieee/identifiers/nesc/base.rb +90 -19
  246. data/lib/pubid/ieee/identifiers/nesc/draft.rb +20 -5
  247. data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
  248. data/lib/pubid/ieee/identifiers/nesc/handbook.rb +16 -5
  249. data/lib/pubid/ieee/identifiers/nesc/redline.rb +11 -2
  250. data/lib/pubid/ieee/identifiers/nesc/standard.rb +18 -3
  251. data/lib/pubid/ieee/identifiers/nesc.rb +1 -0
  252. data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +3 -3
  253. data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +14 -6
  254. data/lib/pubid/ieee/identifiers/redlined_standard.rb +4 -4
  255. data/lib/pubid/ieee/identifiers/si_standard.rb +4 -1
  256. data/lib/pubid/ieee/identifiers/standard.rb +4 -1
  257. data/lib/pubid/ieee/identifiers/supplement_identifier.rb +26 -7
  258. data/lib/pubid/ieee/identifiers.rb +2 -1
  259. data/lib/pubid/ieee/ire/builder.rb +7 -6
  260. data/lib/pubid/ieee/ire/identifier.rb +48 -33
  261. data/lib/pubid/ieee/nesc/builder.rb +33 -20
  262. data/lib/pubid/ieee/nesc/parser.rb +15 -14
  263. data/lib/pubid/ieee/parser.rb +461 -43
  264. data/lib/pubid/ieee/pre_parser.rb +1 -1
  265. data/lib/pubid/ieee/renderer.rb +154 -57
  266. data/lib/pubid/ieee/typed_stages.rb +12 -1
  267. data/lib/pubid/ieee/urn_generator.rb +3 -5
  268. data/lib/pubid/ieee.rb +56 -3
  269. data/lib/pubid/ietf/builder.rb +62 -0
  270. data/lib/pubid/ietf/identifier.rb +5 -0
  271. data/lib/pubid/ietf/identifiers/base.rb +75 -0
  272. data/lib/pubid/ietf/identifiers/bcp.rb +25 -0
  273. data/lib/pubid/ietf/identifiers/fyi.rb +25 -0
  274. data/lib/pubid/ietf/identifiers/internet_draft.rb +29 -0
  275. data/lib/pubid/ietf/identifiers/rfc.rb +25 -0
  276. data/lib/pubid/ietf/identifiers/std.rb +25 -0
  277. data/lib/pubid/ietf/identifiers.rb +13 -0
  278. data/lib/pubid/ietf/parser.rb +43 -0
  279. data/lib/pubid/ietf/renderer.rb +26 -0
  280. data/lib/pubid/ietf/urn_generator.rb +23 -0
  281. data/lib/pubid/ietf/urn_parser.rb +35 -0
  282. data/lib/pubid/ietf.rb +76 -0
  283. data/lib/pubid/iho/identifier.rb +1 -3
  284. data/lib/pubid/iho/identifiers/base.rb +1 -7
  285. data/lib/pubid/iho/identifiers/bibliographic.rb +1 -1
  286. data/lib/pubid/iho/identifiers/circular_letter.rb +1 -1
  287. data/lib/pubid/iho/identifiers/miscellaneous.rb +1 -1
  288. data/lib/pubid/iho/identifiers/publication.rb +1 -1
  289. data/lib/pubid/iho/identifiers/standard.rb +1 -1
  290. data/lib/pubid/iho/identifiers.rb +0 -1
  291. data/lib/pubid/iho.rb +7 -7
  292. data/lib/pubid/isbn/builder.rb +44 -0
  293. data/lib/pubid/isbn/check_digit.rb +53 -0
  294. data/lib/pubid/isbn/identifier.rb +63 -0
  295. data/lib/pubid/isbn/identifiers/book.rb +30 -0
  296. data/lib/pubid/isbn/identifiers.rb +9 -0
  297. data/lib/pubid/isbn/parser.rb +45 -0
  298. data/lib/pubid/isbn/renderer.rb +16 -0
  299. data/lib/pubid/isbn.rb +52 -0
  300. data/lib/pubid/iso/builder.rb +9 -4
  301. data/lib/pubid/iso/combined_identifier.rb +2 -2
  302. data/lib/pubid/iso/identifier.rb +17 -1
  303. data/lib/pubid/iso/identifiers/directives_supplement.rb +8 -8
  304. data/lib/pubid/iso/normalizer.rb +2 -2
  305. data/lib/pubid/iso/parser.rb +16 -12
  306. data/lib/pubid/iso/supplement_identifier.rb +19 -6
  307. data/lib/pubid/iso/urn_generator.rb +4 -1
  308. data/lib/pubid/iso/urn_parser.rb +1 -1
  309. data/lib/pubid/itu/builder.rb +230 -29
  310. data/lib/pubid/itu/components/code.rb +48 -5
  311. data/lib/pubid/itu/components/designation.rb +35 -0
  312. data/lib/pubid/itu/components.rb +1 -0
  313. data/lib/pubid/itu/identifier.rb +1 -3
  314. data/lib/pubid/itu/identifiers/addendum.rb +15 -0
  315. data/lib/pubid/itu/identifiers/amendment.rb +6 -28
  316. data/lib/pubid/itu/identifiers/annex.rb +13 -2
  317. data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
  318. data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
  319. data/lib/pubid/itu/identifiers/base.rb +341 -23
  320. data/lib/pubid/itu/identifiers/combined_identifier.rb +99 -23
  321. data/lib/pubid/itu/identifiers/corrigendum.rb +16 -23
  322. data/lib/pubid/itu/identifiers/errata.rb +15 -0
  323. data/lib/pubid/itu/identifiers/handbook.rb +38 -0
  324. data/lib/pubid/itu/identifiers/question.rb +63 -0
  325. data/lib/pubid/itu/identifiers/recommendation.rb +3 -2
  326. data/lib/pubid/itu/identifiers/report.rb +39 -0
  327. data/lib/pubid/itu/identifiers/special_publication.rb +3 -1
  328. data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
  329. data/lib/pubid/itu/identifiers/supplement.rb +119 -14
  330. data/lib/pubid/itu/identifiers.rb +10 -1
  331. data/lib/pubid/itu/model.rb +1 -1
  332. data/lib/pubid/itu/parser.rb +480 -26
  333. data/lib/pubid/itu/urn_generator.rb +36 -6
  334. data/lib/pubid/itu/urn_parser.rb +8 -0
  335. data/lib/pubid/itu.rb +11 -3
  336. data/lib/pubid/jcgm/builder.rb +23 -13
  337. data/lib/pubid/jcgm/identifiers/amendment.rb +0 -2
  338. data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
  339. data/lib/pubid/jcgm/identifiers/gum_guide.rb +3 -3
  340. data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
  341. data/lib/pubid/jcgm/identifiers.rb +2 -0
  342. data/lib/pubid/jcgm/parser.rb +66 -6
  343. data/lib/pubid/jcgm/renderer.rb +26 -12
  344. data/lib/pubid/jcgm/single_identifier.rb +74 -5
  345. data/lib/pubid/jcgm/supplement_identifier.rb +39 -4
  346. data/lib/pubid/jcgm/urn_generator.rb +21 -13
  347. data/lib/pubid/jcgm/urn_parser.rb +15 -3
  348. data/lib/pubid/jis/identifier.rb +52 -0
  349. data/lib/pubid/nist/builder.rb +29 -9
  350. data/lib/pubid/nist/caster.rb +7 -45
  351. data/lib/pubid/nist/circular_supplement_builder.rb +7 -5
  352. data/lib/pubid/nist/components/supplement.rb +5 -2
  353. data/lib/pubid/nist/configuration.rb +7 -1
  354. data/lib/pubid/nist/identifier.rb +1 -3
  355. data/lib/pubid/nist/identifiers/base.rb +121 -37
  356. data/lib/pubid/nist/identifiers/circular.rb +1 -1
  357. data/lib/pubid/nist/identifiers/commercial_standard.rb +1 -1
  358. data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +1 -1
  359. data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +1 -1
  360. data/lib/pubid/nist/identifiers/crpl_report.rb +1 -1
  361. data/lib/pubid/nist/identifiers/dated_document.rb +1 -1
  362. data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +1 -1
  363. data/lib/pubid/nist/identifiers/grant_contractor_report.rb +1 -1
  364. data/lib/pubid/nist/identifiers/handbook.rb +1 -1
  365. data/lib/pubid/nist/identifiers/internal_report.rb +1 -1
  366. data/lib/pubid/nist/identifiers/letter_circular.rb +1 -1
  367. data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +1 -1
  368. data/lib/pubid/nist/identifiers/monograph.rb +1 -1
  369. data/lib/pubid/nist/identifiers/ncstar.rb +2 -2
  370. data/lib/pubid/nist/identifiers/nsrds.rb +1 -1
  371. data/lib/pubid/nist/identifiers/owmwp.rb +1 -1
  372. data/lib/pubid/nist/identifiers/report.rb +1 -1
  373. data/lib/pubid/nist/identifiers/special_publication.rb +10 -1
  374. data/lib/pubid/nist/identifiers/technical_note.rb +1 -1
  375. data/lib/pubid/nist/identifiers.rb +0 -1
  376. data/lib/pubid/nist/parser.rb +29 -4
  377. data/lib/pubid/nist/preprocessor.rb +15 -0
  378. data/lib/pubid/nist/router.rb +3 -2
  379. data/lib/pubid/nist/series/ir.rb +0 -3
  380. data/lib/pubid/nist/supplement_identifier.rb +9 -9
  381. data/lib/pubid/nist.rb +13 -12
  382. data/lib/pubid/oasis/builder.rb +77 -0
  383. data/lib/pubid/oasis/identifier.rb +82 -0
  384. data/lib/pubid/oasis/identifiers/standard.rb +29 -0
  385. data/lib/pubid/oasis/identifiers.rb +9 -0
  386. data/lib/pubid/oasis/parser.rb +34 -0
  387. data/lib/pubid/oasis/renderer.rb +29 -0
  388. data/lib/pubid/oasis/urn_generator.rb +25 -0
  389. data/lib/pubid/oasis/urn_parser.rb +22 -0
  390. data/lib/pubid/oasis.rb +74 -0
  391. data/lib/pubid/ogc/builder.rb +33 -0
  392. data/lib/pubid/ogc/identifier.rb +77 -0
  393. data/lib/pubid/ogc/identifiers/document.rb +26 -0
  394. data/lib/pubid/ogc/identifiers.rb +10 -0
  395. data/lib/pubid/ogc/parser.rb +40 -0
  396. data/lib/pubid/ogc/renderer.rb +33 -0
  397. data/lib/pubid/ogc/urn_generator.rb +14 -0
  398. data/lib/pubid/ogc/urn_parser.rb +22 -0
  399. data/lib/pubid/ogc.rb +71 -0
  400. data/lib/pubid/oiml/builder.rb +31 -7
  401. data/lib/pubid/oiml/identifier.rb +9 -1
  402. data/lib/pubid/oiml/parser.rb +11 -12
  403. data/lib/pubid/oiml/renderer.rb +13 -13
  404. data/lib/pubid/oiml/single_identifier.rb +20 -0
  405. data/lib/pubid/oiml/supplement_identifier.rb +9 -9
  406. data/lib/pubid/oiml/urn_parser.rb +23 -6
  407. data/lib/pubid/oiml.rb +4 -0
  408. data/lib/pubid/omg/builder.rb +19 -0
  409. data/lib/pubid/omg/identifier.rb +44 -0
  410. data/lib/pubid/omg/identifiers/specification.rb +32 -0
  411. data/lib/pubid/omg/identifiers.rb +9 -0
  412. data/lib/pubid/omg/parser.rb +40 -0
  413. data/lib/pubid/omg/renderer.rb +19 -0
  414. data/lib/pubid/omg.rb +51 -0
  415. data/lib/pubid/parsers/mr_string.rb +101 -7
  416. data/lib/pubid/plateau/builder.rb +8 -4
  417. data/lib/pubid/plateau/identifier.rb +1 -3
  418. data/lib/pubid/plateau/identifiers/base.rb +1 -6
  419. data/lib/pubid/plateau/identifiers/handbook.rb +1 -1
  420. data/lib/pubid/plateau/identifiers/technical_report.rb +1 -1
  421. data/lib/pubid/plateau/identifiers.rb +0 -1
  422. data/lib/pubid/plateau/parser.rb +15 -5
  423. data/lib/pubid/plateau/renderer.rb +1 -1
  424. data/lib/pubid/plateau/supplement_identifier.rb +11 -11
  425. data/lib/pubid/plateau.rb +4 -4
  426. data/lib/pubid/renderers/human_readable.rb +3 -1
  427. data/lib/pubid/renderers/mr_string.rb +46 -4
  428. data/lib/pubid/renderers/supplement_renderer.rb +1 -1
  429. data/lib/pubid/rendering/supplement.rb +4 -4
  430. data/lib/pubid/sae/builder.rb +1 -1
  431. data/lib/pubid/sae/identifier.rb +1 -3
  432. data/lib/pubid/sae/identifiers/base.rb +10 -7
  433. data/lib/pubid/sae/identifiers.rb +0 -1
  434. data/lib/pubid/sae.rb +3 -3
  435. data/lib/pubid/tgpp/builder.rb +41 -0
  436. data/lib/pubid/tgpp/identifier.rb +91 -0
  437. data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
  438. data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
  439. data/lib/pubid/tgpp/identifiers.rb +11 -0
  440. data/lib/pubid/tgpp/parser.rb +62 -0
  441. data/lib/pubid/tgpp/renderer.rb +36 -0
  442. data/lib/pubid/tgpp/urn_generator.rb +20 -0
  443. data/lib/pubid/tgpp/urn_parser.rb +28 -0
  444. data/lib/pubid/tgpp.rb +78 -0
  445. data/lib/pubid/type_resolver.rb +59 -0
  446. data/lib/pubid/un/builder.rb +42 -0
  447. data/lib/pubid/un/identifier.rb +37 -0
  448. data/lib/pubid/un/identifiers/document.rb +24 -0
  449. data/lib/pubid/un/identifiers.rb +9 -0
  450. data/lib/pubid/un/parser.rb +25 -0
  451. data/lib/pubid/un/renderer.rb +11 -0
  452. data/lib/pubid/un.rb +46 -0
  453. data/lib/pubid/version.rb +1 -1
  454. data/lib/pubid/w3c/builder.rb +55 -0
  455. data/lib/pubid/w3c/identifier.rb +101 -0
  456. data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
  457. data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
  458. data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
  459. data/lib/pubid/w3c/identifiers/note.rb +30 -0
  460. data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
  461. data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
  462. data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
  463. data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
  464. data/lib/pubid/w3c/identifiers/standard.rb +12 -0
  465. data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
  466. data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
  467. data/lib/pubid/w3c/identifiers.rb +25 -0
  468. data/lib/pubid/w3c/parser.rb +43 -0
  469. data/lib/pubid/w3c/renderer.rb +35 -0
  470. data/lib/pubid/w3c/urn_generator.rb +18 -0
  471. data/lib/pubid/w3c/urn_parser.rb +36 -0
  472. data/lib/pubid/w3c.rb +67 -0
  473. data/lib/pubid/xsf/builder.rb +17 -0
  474. data/lib/pubid/xsf/identifier.rb +62 -0
  475. data/lib/pubid/xsf/identifiers/xep.rb +31 -0
  476. data/lib/pubid/xsf/identifiers.rb +9 -0
  477. data/lib/pubid/xsf/parser.rb +25 -0
  478. data/lib/pubid/xsf/renderer.rb +23 -0
  479. data/lib/pubid/xsf/urn_generator.rb +13 -0
  480. data/lib/pubid/xsf/urn_parser.rb +18 -0
  481. data/lib/pubid/xsf.rb +76 -0
  482. data/lib/pubid.rb +25 -1
  483. metadata +205 -4
  484. data/lib/pubid/cie/components/code.rb +0 -80
  485. data/lib/pubid/iala/identifiers/base.rb +0 -14
@@ -9,6 +9,11 @@ module Pubid
9
9
  return Identifiers::WorkingDocument
10
10
  end
11
11
 
12
+ # Check for technical group (committee identifier, no document number)
13
+ if parsed_hash[:technical_committee] && !parsed_hash[:wd_number]
14
+ return Identifiers::TechnicalGroup
15
+ end
16
+
12
17
  # Check for working document
13
18
  if parsed_hash[:technical_committee] && parsed_hash[:wd_number]
14
19
  return Identifiers::WorkingDocument
@@ -24,15 +29,15 @@ module Pubid
24
29
 
25
30
  def build(parsed_hash)
26
31
  # Handle sheet_supplement_identifier pattern:
27
- # {base_identifier: {...}, sheet_number: ..., sheet_year: ..., type_with_stage: "COR", number_with_part: "1", date: "1995"}
32
+ # {base: {...}, sheet_number: ..., sheet_year: ..., type_with_stage: "COR", number_with_part: "1", date: "1995"}
28
33
  # This is a Corrigendum/Amendment wrapping a SheetIdentifier
29
- if parsed_hash[:base_identifier] && (parsed_hash[:sheet_number] || parsed_hash[:sheet_year]) && parsed_hash[:type_with_stage]
34
+ if parsed_hash[:base] && (parsed_hash[:sheet_number] || parsed_hash[:sheet_year]) && parsed_hash[:type_with_stage]
30
35
  # Extract sheet info first
31
36
  sheet_number = parsed_hash.delete(:sheet_number)
32
37
  sheet_year = parsed_hash.delete(:sheet_year)
33
38
 
34
39
  # Build the base identifier (IEC 60695-2-1 with /1:1994 -> SheetIdentifier)
35
- base_parsed = parsed_hash[:base_identifier].dup
40
+ base_parsed = parsed_hash[:base].dup
36
41
  base_parsed[:sheet_number] = sheet_number
37
42
  base_parsed[:sheet_year] = sheet_year if sheet_year
38
43
  sheet_id = wrap_with_sheet(build(base_parsed), sheet_number,
@@ -68,10 +73,10 @@ module Pubid
68
73
  return wrap_with_supplement(sheet_id, supplement)
69
74
  end
70
75
 
71
- # Handle sheet_identifier pattern: {base_identifier: {...}, sheet_number: ..., sheet_year: ...}
72
- if parsed_hash[:base_identifier] && (parsed_hash[:sheet_number] || parsed_hash[:sheet_year])
76
+ # Handle sheet_identifier pattern: {base: {...}, sheet_number: ..., sheet_year: ...}
77
+ if parsed_hash[:base] && (parsed_hash[:sheet_number] || parsed_hash[:sheet_year])
73
78
  # Build the base identifier first
74
- base_id = build(parsed_hash[:base_identifier])
79
+ base_id = build(parsed_hash[:base])
75
80
  # Wrap with SheetIdentifier
76
81
  sheet_number = parsed_hash.delete(:sheet_number)
77
82
  sheet_year = parsed_hash.delete(:sheet_year)
@@ -105,8 +110,8 @@ module Pubid
105
110
  fragment_edition = parsed_hash.delete(:edition)
106
111
 
107
112
  # Build the base identifier (Amendment/Corrigendum) directly
108
- if parsed_hash[:base_identifier]
109
- base_id = build(parsed_hash[:base_identifier])
113
+ if parsed_hash[:base]
114
+ base_id = build(parsed_hash[:base])
110
115
  return wrap_with_fragment(base_id, fragment_number,
111
116
  fragment_edition, fragment_typed_stage)
112
117
  end
@@ -235,10 +240,10 @@ module Pubid
235
240
  end
236
241
 
237
242
  # Wrap identifier with FragmentIdentifier for /FRAGN notation
238
- def wrap_with_fragment(base_identifier, fragment_number,
243
+ def wrap_with_fragment(base, fragment_number,
239
244
  edition_data = nil, typed_stage = nil)
240
245
  fragment = Identifiers::FragmentIdentifier.new(
241
- base_identifier: base_identifier,
246
+ base: base,
242
247
  fragment_number: fragment_number,
243
248
  )
244
249
 
@@ -254,25 +259,25 @@ module Pubid
254
259
  end
255
260
 
256
261
  # Wrap identifier with SheetIdentifier for /N:YEAR notation
257
- def wrap_with_sheet(base_identifier, sheet_number, sheet_year)
262
+ def wrap_with_sheet(base, sheet_number, sheet_year)
258
263
  # Only pass year if it's present
259
264
  year_value = sheet_year&.to_s
260
265
 
261
266
  Identifiers::SheetIdentifier.new(
262
- base_identifier: base_identifier,
267
+ base: base,
263
268
  sheet_number: sheet_number.to_s,
264
269
  year: year_value,
265
270
  )
266
271
  end
267
272
 
268
273
  # Wrap base identifier with supplement (Amendment/Corrigendum)
269
- def wrap_with_supplement(base_identifier, supplement)
270
- supplement.base_identifier = base_identifier
274
+ def wrap_with_supplement(base, supplement)
275
+ supplement.base = base
271
276
  supplement
272
277
  end
273
278
 
274
279
  # Wrap identifier with ConsolidatedIdentifier for +AMD chains
275
- def wrap_with_consolidated(base_identifier, supplements_data)
280
+ def wrap_with_consolidated(base, supplements_data)
276
281
  supplements = supplements_data.filter_map do |supp|
277
282
  type = supp[:supplement_type].to_s
278
283
  number = supp[:supplement_number].to_s
@@ -295,31 +300,31 @@ module Pubid
295
300
  end
296
301
 
297
302
  Identifiers::ConsolidatedIdentifier.new(
298
- identifiers: [base_identifier] + supplements,
303
+ identifiers: [base] + supplements,
299
304
  )
300
305
  end
301
306
 
302
307
  # Wrap identifier with VapIdentifier for one or more VAP codes
303
308
  # (e.g. "CSV" or "EXV-CMV").
304
- def wrap_with_vap(base_identifier, vap_suffix_data)
309
+ def wrap_with_vap(base, vap_suffix_data)
305
310
  vap = vap_suffix_data.to_s.split("-")
306
311
 
307
312
  # Extract edition - need to go deep for ConsolidatedIdentifier
308
313
  edition = nil
309
- if base_identifier.is_a?(Identifiers::ConsolidatedIdentifier)
314
+ if base.is_a?(Identifiers::ConsolidatedIdentifier)
310
315
  # Edition is on the first identifier (base document)
311
- base_first = base_identifier.identifiers.first
316
+ base_first = base.identifiers.first
312
317
  if base_first && base_first.class.attributes.key?(:edition)
313
318
  edition = base_first.edition
314
319
  base_first.edition = nil
315
320
  end
316
- elsif base_identifier.class.attributes.key?(:edition)
317
- edition = base_identifier.edition
318
- base_identifier.edition = nil
321
+ elsif base.class.attributes.key?(:edition)
322
+ edition = base.edition
323
+ base.edition = nil
319
324
  end
320
325
 
321
326
  Identifiers::VapIdentifier.new(
322
- base_identifier: base_identifier,
327
+ base: base,
323
328
  vap: vap,
324
329
  edition: edition,
325
330
  )
@@ -339,7 +344,7 @@ module Pubid
339
344
 
340
345
  def cast(type, value)
341
346
  case type
342
- when :base_identifier
347
+ when :base
343
348
  # If it has a base identifier, we need to build a supplement
344
349
  # We assume that the base identifier is already a valid Identifier object
345
350
  build(value)
@@ -356,7 +361,7 @@ module Pubid
356
361
  end
357
362
  end
358
363
 
359
- when :technical_committee, :wd_number, :wd_stage, :wd_language, :wp_stage, :wp_type
364
+ when :technical_committee, :subcommittee, :wd_number, :wd_stage, :wd_language, :wp_stage, :wp_type
360
365
  # Working document/programme fields - just return as string
361
366
  value.to_s
362
367
 
@@ -400,6 +405,11 @@ module Pubid
400
405
  when :date
401
406
  parse_date(value)
402
407
 
408
+ when :undated_marker
409
+ # ISO/IEC undated reference (e.g. "IEC 60050:--") — explicit
410
+ # publication-date slot with no year; round-trips via date.render.
411
+ { date: Pubid::Components::Date.new(undated: true) }
412
+
403
413
  when :edition
404
414
  # Coerce to String: the parsed value may be a Parslet::Slice, which
405
415
  # Edition.number (Type::Value) would store verbatim and serialize as a
@@ -84,6 +84,7 @@ module Pubid
84
84
  "pubid:iec:societal-technology-trend-report" => "Pubid::Iec::Identifiers::SocietalTechnologyTrendReport",
85
85
  "pubid:iec:systems-reference-document" => "Pubid::Iec::Identifiers::SystemsReferenceDocument",
86
86
  "pubid:iec:technology-report" => "Pubid::Iec::Identifiers::TechnologyReport",
87
+ "pubid:iec:technical-group" => "Pubid::Iec::Identifiers::TechnicalGroup",
87
88
  "pubid:iec:test-report-form" => "Pubid::Iec::Identifiers::TestReportForm",
88
89
  "pubid:iec:white-paper" => "Pubid::Iec::Identifiers::WhitePaper",
89
90
  "pubid:iec:working-document" => "Pubid::Iec::Identifiers::WorkingDocument",
@@ -129,8 +130,13 @@ module Pubid
129
130
  map "subpart", with: { to: :subpart_to_kv, from: :subpart_from_kv }
130
131
  map "stage_iteration",
131
132
  with: { to: :stage_iteration_to_kv, from: :stage_iteration_from_kv }
132
- # IEC dates are year-only, so flatten the Date component to a scalar year.
133
+ # date serialized flat as year/month/day, nils omitted.
133
134
  map "year", with: { to: :year_to_kv, from: :year_from_kv }
135
+ map "month", with: { to: :month_to_kv, from: :month_from_kv }
136
+ map "day", with: { to: :day_to_kv, from: :day_from_kv }
137
+ # IEC undated reference (e.g. IEC 60050:--). The `false` default is
138
+ # omitted; only the meaningful `true` round-trips via to_hash.
139
+ map "undated", with: { to: :undated_to_kv, from: :undated_from_kv }
134
140
  map "edition", to: :edition, render_default: false
135
141
  map "languages", to: :languages, render_default: false
136
142
  # publisher emitted only when the primary isn't the IEC default;
@@ -183,7 +189,7 @@ module Pubid
183
189
  ::Pubid::Components::Iteration.new(number: value.to_s)
184
190
  end
185
191
 
186
- # --- date <-> scalar year (IEC dates are year-only) ---
192
+ # --- date serialized flat as year/month/day ---
187
193
  def year_to_kv(model, doc)
188
194
  y = model.date&.year
189
195
  return if y.nil? || y.to_s.empty?
@@ -197,6 +203,45 @@ module Pubid
197
203
  (model.date ||= ::Pubid::Components::Date.new).year = value.to_s
198
204
  end
199
205
 
206
+ def month_to_kv(model, doc)
207
+ m = model.date&.month
208
+ return if m.nil? || m.to_s.empty?
209
+
210
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("month", m.to_s))
211
+ end
212
+
213
+ def month_from_kv(model, value)
214
+ return if value.nil? || value.to_s.empty?
215
+
216
+ (model.date ||= ::Pubid::Components::Date.new).month = value.to_s
217
+ end
218
+
219
+ def day_to_kv(model, doc)
220
+ d = model.date&.day
221
+ return if d.nil? || d.to_s.empty?
222
+
223
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("day", d.to_s))
224
+ end
225
+
226
+ def day_from_kv(model, value)
227
+ return if value.nil? || value.to_s.empty?
228
+
229
+ (model.date ||= ::Pubid::Components::Date.new).day = value.to_s
230
+ end
231
+
232
+ # --- date undated flag (IEC undated reference, e.g. IEC 60050:--) ---
233
+ # The `false` default is omitted; only the meaningful `true` round-trips
234
+ # via to_hash / from_hash.
235
+ def undated_to_kv(model, doc)
236
+ return unless model.date&.undated?
237
+
238
+ doc.add_child(Lutaml::KeyValue::DataModel::Element.new("undated", true))
239
+ end
240
+
241
+ def undated_from_kv(model, value)
242
+ (model.date ||= ::Pubid::Components::Date.new).undated = value.to_s == "true"
243
+ end
244
+
200
245
  # --- publisher: primary only when non-default; copublishers as a list ---
201
246
  def publisher_to_kv(model, doc)
202
247
  pub = model.publisher&.body
@@ -31,8 +31,8 @@ module Pubid
31
31
  # Add subpart if present
32
32
  result += "-#{subpart}" if subpart && subpart.to_s != ""
33
33
 
34
- # Add date if present
35
- result += ":#{date.year}" if date
34
+ # Render the date (year[-month[-day]], or `--` for undated).
35
+ result += ":#{date.render}" if date
36
36
 
37
37
  result
38
38
  end
@@ -69,6 +69,12 @@ module Pubid
69
69
  identifiers&.first
70
70
  end
71
71
 
72
+ # The origin document. A consolidated bundle stores its members in
73
+ # `identifiers` (not `base`), so walk the first member to its root.
74
+ def root
75
+ identifiers&.first&.root || self
76
+ end
77
+
72
78
  # Get all supplements (identifiers after first)
73
79
  def supplements
74
80
  identifiers&.drop(1) || []
@@ -8,7 +8,7 @@ module Pubid
8
8
  # Example: "IEC 60050-191/AMD2/FRAG2 ED1" = Fragment 2 of Amendment 2
9
9
  # Fragments are independently approved and have their own lifecycle stages.
10
10
  class FragmentIdentifier < Identifier
11
- attribute :base_identifier, Identifier, polymorphic: true
11
+ attribute :base, Identifier, polymorphic: true
12
12
  attribute :fragment_number, :string
13
13
  attribute :edition, ::Pubid::Components::Edition, default: -> {}
14
14
  # Fragments have their own lifecycle; default to the published FRAG stage
@@ -16,7 +16,7 @@ module Pubid
16
16
  attribute :typed_stage, ::Pubid::Components::TypedStage,
17
17
  default: -> { self.class.published_typed_stage }
18
18
 
19
- # number/date/publisher delegate to base_identifier, but the fragment's
19
+ # number/date/publisher delegate to base, but the fragment's
20
20
  # stage and edition are its own. Serialize the wrapped identifier under
21
21
  # "base" plus the fragment number; suppress only the truly-delegated
22
22
  # common maps (keep stage/edition from the inherited block).
@@ -34,7 +34,7 @@ module Pubid
34
34
  def copublishers_to_kv(_model, _doc); end
35
35
 
36
36
  def base_to_kv(model, doc)
37
- base = model.base_identifier
37
+ base = model.base
38
38
  return unless base
39
39
 
40
40
  doc.add_child(Lutaml::KeyValue::DataModel::Element.new("base",
@@ -42,7 +42,7 @@ module Pubid
42
42
  end
43
43
 
44
44
  def base_from_kv(model, value)
45
- model.base_identifier = ::Pubid::Iec::Identifier.from_hash(value) if value
45
+ model.base = ::Pubid::Iec::Identifier.from_hash(value) if value
46
46
  end
47
47
 
48
48
  TYPED_STAGES = [
@@ -118,29 +118,29 @@ module Pubid
118
118
  web: :fragment_identifier, title: "Fragment", short: "FRAG" }
119
119
  end
120
120
 
121
- # Delegate common attributes to base_identifier
121
+ # Delegate common attributes to base
122
122
  def publisher
123
- base_identifier&.publisher
123
+ base&.publisher
124
124
  end
125
125
 
126
126
  def copublishers
127
- base_identifier&.copublishers
127
+ base&.copublishers
128
128
  end
129
129
 
130
130
  def code
131
- base_identifier&.code
131
+ base&.code
132
132
  end
133
133
 
134
134
  def number
135
- base_identifier&.number
135
+ base&.number
136
136
  end
137
137
 
138
138
  def date
139
- base_identifier&.date
139
+ base&.date
140
140
  end
141
141
 
142
142
  def stage
143
- typed_stage&.to_stage || base_identifier&.stage
143
+ typed_stage&.to_stage || base&.stage
144
144
  end
145
145
  end
146
146
  end
@@ -13,7 +13,7 @@ module Pubid
13
13
  code: :pwi,
14
14
  stage_code: :pwi,
15
15
  type_code: :is,
16
- abbr: ["PWI"],
16
+ abbr: %w[PWI PNW NWIP BWG AWIN AMW],
17
17
  name: "Preliminary Work Item",
18
18
  harmonized_stages: %w[00.00 00.20 00.60 00.98 00.99],
19
19
  ),
@@ -45,7 +45,9 @@ module Pubid
45
45
  code: :cd,
46
46
  stage_code: :cd,
47
47
  type_code: :is,
48
- abbr: ["CD"],
48
+ abbr: %w[CD 2CD 3CD 4CD 5CD 6CD 7CD 8CD 9CD
49
+ ACD A2CD A3CD A4CD A5CD A6CD A7CD A8CD A9CD
50
+ CDM],
49
51
  name: "Committee Draft",
50
52
  harmonized_stages: %w[30.00 30.20 30.60 30.92 30.98 30.99],
51
53
  ),
@@ -53,7 +55,7 @@ module Pubid
53
55
  code: :cdv,
54
56
  stage_code: :cdv,
55
57
  type_code: :is,
56
- abbr: ["CDV"],
58
+ abbr: %w[CDV ACDV CCDV CDVM NCDV],
57
59
  name: "Committee Draft for Vote",
58
60
  harmonized_stages: %w[40.00 40.20 40.60 40.92 40.98 40.99],
59
61
  ),
@@ -61,7 +63,7 @@ module Pubid
61
63
  code: :fdis,
62
64
  stage_code: :fdis,
63
65
  type_code: :is,
64
- abbr: ["FDIS", "PRF"],
66
+ abbr: %w[FDIS PRF NFDIS NADIS RDISH RFDIS CFDIS],
65
67
  name: "Final Draft International Standard",
66
68
  harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
67
69
  ),
@@ -69,7 +71,8 @@ module Pubid
69
71
  code: :is,
70
72
  stage_code: :published,
71
73
  type_code: :is,
72
- abbr: [""],
74
+ abbr: ["", "BPUB", "PPUB", "APUB", "WPUB", "DELPUB",
75
+ "RR", "CAN"],
73
76
  name: "International Standard",
74
77
  harmonized_stages: %w[60.00 60.60 90.20 90.60 90.92 90.93 90.99
75
78
  95.20 95.60 95.92 95.99],
@@ -7,11 +7,11 @@ module Pubid
7
7
  # Single Responsibility: Wraps another identifier with sheet number and year
8
8
  # Example: "IEC 60695-2-1/1:1994" = Sheet 1 of IEC 60695-2-1 from 1994
9
9
  class SheetIdentifier < Identifier
10
- attribute :base_identifier, Identifier, polymorphic: true
10
+ attribute :base, Identifier, polymorphic: true
11
11
  attribute :sheet_number, :string
12
12
  attribute :year, :string, default: -> {}
13
13
 
14
- # Common fields are delegated to base_identifier, so serialize the
14
+ # Common fields are delegated to base, so serialize the
15
15
  # wrapped identifier under "base" plus the sheet number/year; suppress
16
16
  # the delegated common maps (they live inside "base").
17
17
  include Pubid::Iec::DelegatedFieldSuppression
@@ -23,7 +23,7 @@ module Pubid
23
23
  end
24
24
 
25
25
  def base_to_kv(model, doc)
26
- base = model.base_identifier
26
+ base = model.base
27
27
  return unless base
28
28
 
29
29
  doc.add_child(Lutaml::KeyValue::DataModel::Element.new("base",
@@ -31,36 +31,36 @@ module Pubid
31
31
  end
32
32
 
33
33
  def base_from_kv(model, value)
34
- model.base_identifier = ::Pubid::Iec::Identifier.from_hash(value) if value
34
+ model.base = ::Pubid::Iec::Identifier.from_hash(value) if value
35
35
  end
36
36
 
37
- # Delegate common attributes to base_identifier
37
+ # Delegate common attributes to base
38
38
  def publisher
39
- base_identifier&.publisher
39
+ base&.publisher
40
40
  end
41
41
 
42
42
  def copublishers
43
- base_identifier&.copublishers
43
+ base&.copublishers
44
44
  end
45
45
 
46
46
  def code
47
- base_identifier&.code
47
+ base&.code
48
48
  end
49
49
 
50
50
  def number
51
- base_identifier&.number
51
+ base&.number
52
52
  end
53
53
 
54
54
  def date
55
- base_identifier&.date
55
+ base&.date
56
56
  end
57
57
 
58
58
  def stage
59
- base_identifier&.stage
59
+ base&.stage
60
60
  end
61
61
 
62
62
  def typed_stage
63
- base_identifier&.typed_stage
63
+ base&.typed_stage
64
64
  end
65
65
  end
66
66
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pubid
4
+ module Iec
5
+ module Identifiers
6
+ # Technical Group identifier — identifies a committee rather than a
7
+ # publication. Covers:
8
+ #
9
+ # IEC TC 1 (Technical Committee)
10
+ # IEC PC 118 (Project Committee)
11
+ # ISO/IEC JTC 1 (Joint Technical Committee)
12
+ # ISO/IEC JPC 2 (Joint Project Committee)
13
+ # ISO/IEC JTC 1/SC 7 (Joint TC with Subcommittee)
14
+ # IEC SC 100A (Subcommittee with letter suffix)
15
+ # CIS/A (CISPR Subcommittee, bare form)
16
+ # CISPR (CISPR Committee, bare form)
17
+ class TechnicalGroup < Base
18
+ attribute :technical_committee, :string
19
+ attribute :subcommittee, :string
20
+
21
+ TYPED_STAGES = [].freeze
22
+
23
+ def self.type
24
+ { key: :tg,
25
+ web: :technical_group, title: "Technical Group", short: "TG" }
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -53,7 +53,7 @@ module Pubid
53
53
  code: :dtr,
54
54
  stage_code: :draft,
55
55
  type_code: :tr,
56
- abbr: ["DTR"],
56
+ abbr: %w[DTR ADTR CDTR DTRM NDTR DTSM DTRM],
57
57
  name: "Draft Technical Report",
58
58
  harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
59
59
  ),
@@ -53,7 +53,7 @@ module Pubid
53
53
  code: :dts,
54
54
  stage_code: :draft,
55
55
  type_code: :ts,
56
- abbr: ["DTS"],
56
+ abbr: %w[DTS ADTS CDTS NDTS],
57
57
  name: "Draft Technical Specification",
58
58
  harmonized_stages: %w[50.00 50.20 50.60 50.92 50.98 50.99],
59
59
  ),
@@ -7,12 +7,12 @@ module Pubid
7
7
  # Single Responsibility: Wraps another identifier with VAP type suffix
8
8
  # Examples: "IEC 61666:2010+AMD1:2021 CSV"
9
9
  class VapIdentifier < Identifier
10
- attribute :base_identifier, Identifier, polymorphic: true
10
+ attribute :base, Identifier, polymorphic: true
11
11
  # One or more VAP codes (e.g. ["CSV"] or ["EXV", "CMV"]). Plain strings.
12
12
  attribute :vap, :string, collection: true
13
13
  attribute :edition, ::Pubid::Components::Edition, default: -> {}
14
14
 
15
- # number/date/publisher/stage are delegated to base_identifier, so
15
+ # number/date/publisher/stage are delegated to base, so
16
16
  # serialize the wrapped identifier under "base" plus the vap array; the
17
17
  # common fields live inside "base", not at the top level.
18
18
  include Pubid::Iec::DelegatedFieldSuppression
@@ -23,7 +23,7 @@ module Pubid
23
23
  end
24
24
 
25
25
  def base_to_kv(model, doc)
26
- base = model.base_identifier
26
+ base = model.base
27
27
  return unless base
28
28
 
29
29
  doc.add_child(Lutaml::KeyValue::DataModel::Element.new("base",
@@ -31,7 +31,7 @@ module Pubid
31
31
  end
32
32
 
33
33
  def base_from_kv(model, value)
34
- model.base_identifier = ::Pubid::Iec::Identifier.from_hash(value) if value
34
+ model.base = ::Pubid::Iec::Identifier.from_hash(value) if value
35
35
  end
36
36
 
37
37
  # VAP types mapping
@@ -42,33 +42,33 @@ module Pubid
42
42
  "SER" => "Serial version",
43
43
  }.freeze
44
44
 
45
- # Delegate common attributes to base_identifier
45
+ # Delegate common attributes to base
46
46
  def publisher
47
- base_identifier&.publisher
47
+ base&.publisher
48
48
  end
49
49
 
50
50
  def copublishers
51
- base_identifier&.copublishers
51
+ base&.copublishers
52
52
  end
53
53
 
54
54
  def code
55
- base_identifier&.code
55
+ base&.code
56
56
  end
57
57
 
58
58
  def number
59
- base_identifier&.number
59
+ base&.number
60
60
  end
61
61
 
62
62
  def date
63
- base_identifier&.date
63
+ base&.date
64
64
  end
65
65
 
66
66
  def stage
67
- base_identifier&.stage
67
+ base&.stage
68
68
  end
69
69
 
70
70
  def typed_stage
71
- base_identifier&.typed_stage
71
+ base&.typed_stage
72
72
  end
73
73
  end
74
74
  end
@@ -20,6 +20,7 @@ module Pubid
20
20
  autoload :SystemsReferenceDocument, "#{__dir__}/identifiers/systems_reference_document"
21
21
  autoload :TechnicalReport, "#{__dir__}/identifiers/technical_report"
22
22
  autoload :TechnicalSpecification, "#{__dir__}/identifiers/technical_specification"
23
+ autoload :TechnicalGroup, "#{__dir__}/identifiers/technical_group"
23
24
  autoload :TechnologyReport, "#{__dir__}/identifiers/technology_report"
24
25
  autoload :TestReportForm, "#{__dir__}/identifiers/test_report_form"
25
26
  autoload :VapIdentifier, "#{__dir__}/identifiers/vap_identifier"