pubid 2.0.0.pre.alpha.8 → 2.0.0.pre.alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/bipm/update_codes.yaml +9 -0
- data/data/iec/update_codes.yaml +3 -0
- data/data/ieee/update_codes.yaml +107 -1
- data/data/nist/series.yaml +155 -0
- data/data/nist/update_codes.yaml +8 -0
- data/lib/pubid/adobe/builder.rb +52 -0
- data/lib/pubid/adobe/identifier.rb +49 -0
- data/lib/pubid/adobe/identifiers/publication.rb +31 -0
- data/lib/pubid/adobe/identifiers/tech_note.rb +32 -0
- data/lib/pubid/adobe/identifiers.rb +10 -0
- data/lib/pubid/adobe/parser.rb +128 -0
- data/lib/pubid/adobe/renderer.rb +39 -0
- data/lib/pubid/adobe/urn_generator.rb +42 -0
- data/lib/pubid/adobe/urn_parser.rb +69 -0
- data/lib/pubid/adobe.rb +60 -0
- data/lib/pubid/amca/builder.rb +2 -2
- data/lib/pubid/amca/identifier.rb +1 -3
- data/lib/pubid/amca/identifiers/base.rb +1 -6
- data/lib/pubid/amca/identifiers/interpretation.rb +1 -1
- data/lib/pubid/amca/identifiers/publication.rb +1 -1
- data/lib/pubid/amca/identifiers/standard.rb +1 -1
- data/lib/pubid/amca/identifiers.rb +0 -1
- data/lib/pubid/amca/single_identifier.rb +1 -1
- data/lib/pubid/amca.rb +3 -3
- data/lib/pubid/ashrae/builder.rb +22 -22
- data/lib/pubid/ashrae/identifier.rb +3 -4
- data/lib/pubid/ashrae/identifiers/addenda_package.rb +1 -1
- data/lib/pubid/ashrae/identifiers/addendum.rb +1 -1
- data/lib/pubid/ashrae/identifiers/base.rb +14 -8
- data/lib/pubid/ashrae/identifiers/combined_addenda.rb +1 -1
- data/lib/pubid/ashrae/identifiers.rb +0 -1
- data/lib/pubid/ashrae/parser.rb +14 -9
- data/lib/pubid/ashrae/renderer.rb +19 -19
- data/lib/pubid/ashrae/single_identifier.rb +1 -1
- data/lib/pubid/ashrae/supplement_identifier.rb +6 -6
- data/lib/pubid/ashrae.rb +3 -3
- data/lib/pubid/bipm/builder.rb +107 -0
- data/lib/pubid/bipm/identifier.rb +160 -0
- data/lib/pubid/bipm/identifiers/committee_document.rb +24 -0
- data/lib/pubid/bipm/identifiers/guide.rb +24 -0
- data/lib/pubid/bipm/identifiers/meeting.rb +41 -0
- data/lib/pubid/bipm/identifiers/mep.rb +21 -0
- data/lib/pubid/bipm/identifiers/metrologia_article.rb +24 -0
- data/lib/pubid/bipm/identifiers/si_brochure.rb +20 -0
- data/lib/pubid/bipm/identifiers.rb +15 -0
- data/lib/pubid/bipm/parser.rb +184 -0
- data/lib/pubid/bipm/renderer.rb +110 -0
- data/lib/pubid/bipm/urn_generator.rb +58 -0
- data/lib/pubid/bipm/urn_parser.rb +52 -0
- data/lib/pubid/bipm.rb +86 -0
- data/lib/pubid/bsi/builder.rb +14 -14
- data/lib/pubid/bsi/identifier.rb +0 -1
- data/lib/pubid/bsi/identifiers/addendum_document.rb +2 -2
- data/lib/pubid/bsi/identifiers/amendment.rb +4 -4
- data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +6 -0
- data/lib/pubid/bsi/identifiers/corrigendum.rb +4 -4
- data/lib/pubid/bsi/identifiers/expert_commentary.rb +5 -5
- data/lib/pubid/bsi/identifiers/supplement_document.rb +2 -2
- data/lib/pubid/bsi/identifiers/value_added_publication.rb +6 -6
- data/lib/pubid/bsi/renderer.rb +8 -8
- data/lib/pubid/bsi/single_identifier.rb +48 -0
- data/lib/pubid/builder/base.rb +5 -3
- data/lib/pubid/bundled_identifier.rb +3 -3
- data/lib/pubid/calconnect/builder.rb +38 -0
- data/lib/pubid/calconnect/identifier.rb +117 -0
- data/lib/pubid/calconnect/identifiers/standard.rb +29 -0
- data/lib/pubid/calconnect/identifiers.rb +9 -0
- data/lib/pubid/calconnect/parser.rb +54 -0
- data/lib/pubid/calconnect/renderer.rb +36 -0
- data/lib/pubid/calconnect/urn_generator.rb +33 -0
- data/lib/pubid/calconnect/urn_parser.rb +34 -0
- data/lib/pubid/calconnect.rb +77 -0
- data/lib/pubid/ccsds/builder.rb +1 -1
- data/lib/pubid/ccsds/identifier.rb +1 -1
- data/lib/pubid/ccsds/identifiers/corrigendum.rb +2 -2
- data/lib/pubid/ccsds/supplement_identifier.rb +6 -6
- data/lib/pubid/ccsds/urn_generator.rb +3 -3
- data/lib/pubid/cen_cenelec/builder.rb +46 -12
- data/lib/pubid/cen_cenelec/identifiers/amendment.rb +2 -2
- data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +6 -0
- data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +2 -2
- data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +60 -3
- data/lib/pubid/cen_cenelec/identifiers/fragment.rb +2 -2
- data/lib/pubid/cen_cenelec/renderer.rb +5 -5
- data/lib/pubid/cen_cenelec/supplement_identifier.rb +5 -5
- data/lib/pubid/cen_cenelec/urn_generator.rb +1 -1
- data/lib/pubid/cen_cenelec.rb +76 -72
- data/lib/pubid/cie/builder.rb +139 -24
- data/lib/pubid/cie/identifier.rb +7 -3
- data/lib/pubid/cie/identifiers/bundle.rb +32 -4
- data/lib/pubid/cie/identifiers/code_attributes.rb +52 -0
- data/lib/pubid/cie/identifiers/conference.rb +9 -4
- data/lib/pubid/cie/identifiers/corrigendum.rb +17 -23
- data/lib/pubid/cie/identifiers/dual_published.rb +4 -4
- data/lib/pubid/cie/identifiers/identical.rb +7 -7
- data/lib/pubid/cie/identifiers/joint_published.rb +8 -8
- data/lib/pubid/cie/identifiers/proceedings.rb +39 -0
- data/lib/pubid/cie/identifiers/standard.rb +33 -7
- data/lib/pubid/cie/identifiers/supplement.rb +24 -22
- data/lib/pubid/cie/identifiers/tutorial_bundle.rb +6 -2
- data/lib/pubid/cie/identifiers.rb +2 -0
- data/lib/pubid/cie/parser.rb +54 -5
- data/lib/pubid/cie/single_identifier.rb +40 -1
- data/lib/pubid/cie/supplement_identifier.rb +29 -16
- data/lib/pubid/cie/urn_generator.rb +11 -8
- data/lib/pubid/cie.rb +0 -1
- data/lib/pubid/components/date.rb +21 -5
- data/lib/pubid/csa/builder.rb +1 -1
- data/lib/pubid/csa/composite_identifier.rb +17 -1
- data/lib/pubid/csa/identifier.rb +48 -3
- data/lib/pubid/csa/identifiers/bundled.rb +6 -0
- data/lib/pubid/csa/identifiers/combined.rb +6 -0
- data/lib/pubid/csa/identifiers/package.rb +2 -2
- data/lib/pubid/csa/parser.rb +6 -6
- data/lib/pubid/csa/wrapper_identifier.rb +17 -0
- data/lib/pubid/doi/builder.rb +18 -0
- data/lib/pubid/doi/identifier.rb +46 -0
- data/lib/pubid/doi/identifiers/resource.rb +30 -0
- data/lib/pubid/doi/identifiers.rb +9 -0
- data/lib/pubid/doi/parser.rb +52 -0
- data/lib/pubid/doi/renderer.rb +13 -0
- data/lib/pubid/doi.rb +55 -0
- data/lib/pubid/easc/builder.rb +55 -0
- data/lib/pubid/easc/identifier.rb +61 -0
- data/lib/pubid/easc/identifiers/pmg.rb +20 -0
- data/lib/pubid/easc/identifiers/rmg.rb +19 -0
- data/lib/pubid/easc/identifiers.rb +10 -0
- data/lib/pubid/easc/parser.rb +80 -0
- data/lib/pubid/easc/renderer.rb +48 -0
- data/lib/pubid/easc/urn_generator.rb +46 -0
- data/lib/pubid/easc/urn_parser.rb +57 -0
- data/lib/pubid/easc.rb +52 -0
- data/lib/pubid/ecma/builder.rb +31 -0
- data/lib/pubid/ecma/identifier.rb +76 -0
- data/lib/pubid/ecma/identifiers/memento.rb +30 -0
- data/lib/pubid/ecma/identifiers/standard.rb +31 -0
- data/lib/pubid/ecma/identifiers/technical_report.rb +31 -0
- data/lib/pubid/ecma/identifiers.rb +11 -0
- data/lib/pubid/ecma/parser.rb +41 -0
- data/lib/pubid/ecma/renderer.rb +46 -0
- data/lib/pubid/ecma/urn_generator.rb +25 -0
- data/lib/pubid/ecma/urn_parser.rb +35 -0
- data/lib/pubid/ecma.rb +67 -0
- data/lib/pubid/etsi/builder.rb +7 -3
- data/lib/pubid/etsi/identifier.rb +1 -3
- data/lib/pubid/etsi/identifiers/base.rb +28 -10
- data/lib/pubid/etsi/identifiers/etsi_standard.rb +128 -4
- data/lib/pubid/etsi/identifiers/supplement_identifier.rb +35 -3
- data/lib/pubid/etsi/identifiers.rb +0 -1
- data/lib/pubid/etsi/parser.rb +8 -2
- data/lib/pubid/etsi/renderer.rb +8 -2
- data/lib/pubid/etsi.rb +5 -5
- data/lib/pubid/export/exporter.rb +2 -1
- data/lib/pubid/export/flavor_exporter.rb +18 -3
- data/lib/pubid/gb/builder.rb +45 -0
- data/lib/pubid/gb/identifier.rb +64 -0
- data/lib/pubid/gb/identifiers/standard.rb +34 -0
- data/lib/pubid/gb/identifiers.rb +9 -0
- data/lib/pubid/gb/parser.rb +63 -0
- data/lib/pubid/gb/renderer.rb +35 -0
- data/lib/pubid/gb.rb +87 -0
- data/lib/pubid/gost/builder.rb +148 -0
- data/lib/pubid/gost/identifier.rb +49 -0
- data/lib/pubid/gost/identifiers/foreign_reference.rb +25 -0
- data/lib/pubid/gost/identifiers/harmonized.rb +39 -0
- data/lib/pubid/gost/identifiers/identical_adoption.rb +39 -0
- data/lib/pubid/gost/identifiers/interstate_standard.rb +20 -0
- data/lib/pubid/gost/identifiers/national_standard.rb +19 -0
- data/lib/pubid/gost/identifiers.rb +13 -0
- data/lib/pubid/gost/parser.rb +97 -0
- data/lib/pubid/gost/renderer.rb +48 -0
- data/lib/pubid/gost/urn_generator.rb +46 -0
- data/lib/pubid/gost/urn_parser.rb +52 -0
- data/lib/pubid/gost.rb +49 -0
- data/lib/pubid/iala/builder.rb +22 -27
- data/lib/pubid/iala/identifier.rb +27 -2
- data/lib/pubid/iala/identifiers/advice.rb +1 -1
- data/lib/pubid/iala/identifiers/annex.rb +10 -10
- data/lib/pubid/iala/identifiers/general_assembly.rb +5 -2
- data/lib/pubid/iala/identifiers/guideline.rb +3 -1
- data/lib/pubid/iala/identifiers/letter.rb +1 -1
- data/lib/pubid/iala/identifiers/manual.rb +3 -1
- data/lib/pubid/iala/identifiers/model_course.rb +3 -1
- data/lib/pubid/iala/identifiers/recommendation.rb +3 -1
- data/lib/pubid/iala/identifiers/report.rb +1 -1
- data/lib/pubid/iala/identifiers/resolution.rb +1 -1
- data/lib/pubid/iala/identifiers/standard.rb +3 -1
- data/lib/pubid/iala/identifiers.rb +0 -1
- data/lib/pubid/iala/renderer.rb +1 -1
- data/lib/pubid/iala/urn_generator.rb +1 -1
- data/lib/pubid/iala/urn_parser.rb +19 -2
- data/lib/pubid/iala.rb +4 -4
- data/lib/pubid/iana/builder.rb +20 -0
- data/lib/pubid/iana/identifier.rb +72 -0
- data/lib/pubid/iana/identifiers/registry.rb +33 -0
- data/lib/pubid/iana/identifiers.rb +9 -0
- data/lib/pubid/iana/parser.rb +38 -0
- data/lib/pubid/iana/renderer.rb +29 -0
- data/lib/pubid/iana/urn_generator.rb +15 -0
- data/lib/pubid/iana/urn_parser.rb +24 -0
- data/lib/pubid/iana.rb +69 -0
- data/lib/pubid/identifier.rb +210 -23
- data/lib/pubid/idf/builder.rb +1 -1
- data/lib/pubid/idf/parser.rb +2 -2
- data/lib/pubid/idf/renderer.rb +1 -1
- data/lib/pubid/idf/supplement_identifier.rb +3 -3
- data/lib/pubid/iec/builder.rb +35 -25
- data/lib/pubid/iec/identifier.rb +47 -2
- data/lib/pubid/iec/identifiers/base.rb +2 -2
- data/lib/pubid/iec/identifiers/consolidated_identifier.rb +6 -0
- data/lib/pubid/iec/identifiers/fragment_identifier.rb +11 -11
- data/lib/pubid/iec/identifiers/international_standard.rb +8 -5
- data/lib/pubid/iec/identifiers/sheet_identifier.rb +12 -12
- data/lib/pubid/iec/identifiers/technical_group.rb +30 -0
- data/lib/pubid/iec/identifiers/technical_report.rb +1 -1
- data/lib/pubid/iec/identifiers/technical_specification.rb +1 -1
- data/lib/pubid/iec/identifiers/vap_identifier.rb +12 -12
- data/lib/pubid/iec/identifiers.rb +1 -0
- data/lib/pubid/iec/parser.rb +51 -10
- data/lib/pubid/iec/renderer.rb +18 -8
- data/lib/pubid/iec/single_identifier.rb +1 -1
- data/lib/pubid/iec/supplement_identifier.rb +32 -19
- data/lib/pubid/iec.rb +1 -6
- data/lib/pubid/ieee/aiee/builder.rb +17 -3
- data/lib/pubid/ieee/aiee/identifier.rb +45 -61
- data/lib/pubid/ieee/builder.rb +341 -68
- data/lib/pubid/ieee/compaction.rb +121 -0
- data/lib/pubid/ieee/components/draft.rb +47 -7
- data/lib/pubid/ieee/identifier.rb +1 -3
- data/lib/pubid/ieee/identifiers/adopted_standard.rb +30 -5
- data/lib/pubid/ieee/identifiers/amendment.rb +40 -0
- data/lib/pubid/ieee/identifiers/base.rb +106 -13
- data/lib/pubid/ieee/identifiers/code_number.rb +82 -0
- data/lib/pubid/ieee/identifiers/conformance_identifier.rb +6 -2
- data/lib/pubid/ieee/identifiers/corrigendum.rb +17 -2
- data/lib/pubid/ieee/identifiers/csa_dual_published.rb +3 -3
- data/lib/pubid/ieee/identifiers/dual_identifier.rb +3 -3
- data/lib/pubid/ieee/identifiers/dual_published.rb +3 -3
- data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +102 -5
- data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +2 -1
- data/lib/pubid/ieee/identifiers/joint_development.rb +56 -11
- data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +1 -1
- data/lib/pubid/ieee/identifiers/nesc/base.rb +90 -19
- data/lib/pubid/ieee/identifiers/nesc/draft.rb +20 -5
- data/lib/pubid/ieee/identifiers/nesc/edition.rb +32 -0
- data/lib/pubid/ieee/identifiers/nesc/handbook.rb +16 -5
- data/lib/pubid/ieee/identifiers/nesc/redline.rb +11 -2
- data/lib/pubid/ieee/identifiers/nesc/standard.rb +18 -3
- data/lib/pubid/ieee/identifiers/nesc.rb +1 -0
- data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +3 -3
- data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +14 -6
- data/lib/pubid/ieee/identifiers/redlined_standard.rb +4 -4
- data/lib/pubid/ieee/identifiers/si_standard.rb +4 -1
- data/lib/pubid/ieee/identifiers/standard.rb +4 -1
- data/lib/pubid/ieee/identifiers/supplement_identifier.rb +26 -7
- data/lib/pubid/ieee/identifiers.rb +2 -1
- data/lib/pubid/ieee/ire/builder.rb +7 -6
- data/lib/pubid/ieee/ire/identifier.rb +48 -33
- data/lib/pubid/ieee/nesc/builder.rb +33 -20
- data/lib/pubid/ieee/nesc/parser.rb +15 -14
- data/lib/pubid/ieee/parser.rb +461 -43
- data/lib/pubid/ieee/pre_parser.rb +1 -1
- data/lib/pubid/ieee/renderer.rb +154 -57
- data/lib/pubid/ieee/typed_stages.rb +12 -1
- data/lib/pubid/ieee/urn_generator.rb +3 -5
- data/lib/pubid/ieee.rb +56 -3
- data/lib/pubid/ietf/builder.rb +62 -0
- data/lib/pubid/ietf/identifier.rb +5 -0
- data/lib/pubid/ietf/identifiers/base.rb +75 -0
- data/lib/pubid/ietf/identifiers/bcp.rb +25 -0
- data/lib/pubid/ietf/identifiers/fyi.rb +25 -0
- data/lib/pubid/ietf/identifiers/internet_draft.rb +29 -0
- data/lib/pubid/ietf/identifiers/rfc.rb +25 -0
- data/lib/pubid/ietf/identifiers/std.rb +25 -0
- data/lib/pubid/ietf/identifiers.rb +13 -0
- data/lib/pubid/ietf/parser.rb +43 -0
- data/lib/pubid/ietf/renderer.rb +26 -0
- data/lib/pubid/ietf/urn_generator.rb +23 -0
- data/lib/pubid/ietf/urn_parser.rb +35 -0
- data/lib/pubid/ietf.rb +76 -0
- data/lib/pubid/iho/identifier.rb +1 -3
- data/lib/pubid/iho/identifiers/base.rb +1 -7
- data/lib/pubid/iho/identifiers/bibliographic.rb +1 -1
- data/lib/pubid/iho/identifiers/circular_letter.rb +1 -1
- data/lib/pubid/iho/identifiers/miscellaneous.rb +1 -1
- data/lib/pubid/iho/identifiers/publication.rb +1 -1
- data/lib/pubid/iho/identifiers/standard.rb +1 -1
- data/lib/pubid/iho/identifiers.rb +0 -1
- data/lib/pubid/iho.rb +7 -7
- data/lib/pubid/isbn/builder.rb +44 -0
- data/lib/pubid/isbn/check_digit.rb +53 -0
- data/lib/pubid/isbn/identifier.rb +63 -0
- data/lib/pubid/isbn/identifiers/book.rb +30 -0
- data/lib/pubid/isbn/identifiers.rb +9 -0
- data/lib/pubid/isbn/parser.rb +45 -0
- data/lib/pubid/isbn/renderer.rb +16 -0
- data/lib/pubid/isbn.rb +52 -0
- data/lib/pubid/iso/builder.rb +9 -4
- data/lib/pubid/iso/combined_identifier.rb +2 -2
- data/lib/pubid/iso/identifier.rb +17 -1
- data/lib/pubid/iso/identifiers/directives_supplement.rb +8 -8
- data/lib/pubid/iso/normalizer.rb +2 -2
- data/lib/pubid/iso/parser.rb +16 -12
- data/lib/pubid/iso/supplement_identifier.rb +19 -6
- data/lib/pubid/iso/urn_generator.rb +4 -1
- data/lib/pubid/iso/urn_parser.rb +1 -1
- data/lib/pubid/itu/builder.rb +230 -29
- data/lib/pubid/itu/components/code.rb +48 -5
- data/lib/pubid/itu/components/designation.rb +35 -0
- data/lib/pubid/itu/components.rb +1 -0
- data/lib/pubid/itu/identifier.rb +1 -3
- data/lib/pubid/itu/identifiers/addendum.rb +15 -0
- data/lib/pubid/itu/identifiers/amendment.rb +6 -28
- data/lib/pubid/itu/identifiers/annex.rb +13 -2
- data/lib/pubid/itu/identifiers/annex_of_recommendation.rb +87 -0
- data/lib/pubid/itu/identifiers/appendix_of_recommendation.rb +92 -0
- data/lib/pubid/itu/identifiers/base.rb +341 -23
- data/lib/pubid/itu/identifiers/combined_identifier.rb +99 -23
- data/lib/pubid/itu/identifiers/corrigendum.rb +16 -23
- data/lib/pubid/itu/identifiers/errata.rb +15 -0
- data/lib/pubid/itu/identifiers/handbook.rb +38 -0
- data/lib/pubid/itu/identifiers/question.rb +63 -0
- data/lib/pubid/itu/identifiers/recommendation.rb +3 -2
- data/lib/pubid/itu/identifiers/report.rb +39 -0
- data/lib/pubid/itu/identifiers/special_publication.rb +3 -1
- data/lib/pubid/itu/identifiers/standard_serialization.rb +58 -0
- data/lib/pubid/itu/identifiers/supplement.rb +119 -14
- data/lib/pubid/itu/identifiers.rb +10 -1
- data/lib/pubid/itu/model.rb +1 -1
- data/lib/pubid/itu/parser.rb +480 -26
- data/lib/pubid/itu/urn_generator.rb +36 -6
- data/lib/pubid/itu/urn_parser.rb +8 -0
- data/lib/pubid/itu.rb +11 -3
- data/lib/pubid/jcgm/builder.rb +23 -13
- data/lib/pubid/jcgm/identifiers/amendment.rb +0 -2
- data/lib/pubid/jcgm/identifiers/corrigendum.rb +34 -0
- data/lib/pubid/jcgm/identifiers/gum_guide.rb +3 -3
- data/lib/pubid/jcgm/identifiers/meeting.rb +47 -0
- data/lib/pubid/jcgm/identifiers.rb +2 -0
- data/lib/pubid/jcgm/parser.rb +66 -6
- data/lib/pubid/jcgm/renderer.rb +26 -12
- data/lib/pubid/jcgm/single_identifier.rb +74 -5
- data/lib/pubid/jcgm/supplement_identifier.rb +39 -4
- data/lib/pubid/jcgm/urn_generator.rb +21 -13
- data/lib/pubid/jcgm/urn_parser.rb +15 -3
- data/lib/pubid/jis/identifier.rb +52 -0
- data/lib/pubid/nist/builder.rb +29 -9
- data/lib/pubid/nist/caster.rb +7 -45
- data/lib/pubid/nist/circular_supplement_builder.rb +7 -5
- data/lib/pubid/nist/components/supplement.rb +5 -2
- data/lib/pubid/nist/configuration.rb +7 -1
- data/lib/pubid/nist/identifier.rb +1 -3
- data/lib/pubid/nist/identifiers/base.rb +121 -37
- data/lib/pubid/nist/identifiers/circular.rb +1 -1
- data/lib/pubid/nist/identifiers/commercial_standard.rb +1 -1
- data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +1 -1
- data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +1 -1
- data/lib/pubid/nist/identifiers/crpl_report.rb +1 -1
- data/lib/pubid/nist/identifiers/dated_document.rb +1 -1
- data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +1 -1
- data/lib/pubid/nist/identifiers/grant_contractor_report.rb +1 -1
- data/lib/pubid/nist/identifiers/handbook.rb +1 -1
- data/lib/pubid/nist/identifiers/internal_report.rb +1 -1
- data/lib/pubid/nist/identifiers/letter_circular.rb +1 -1
- data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +1 -1
- data/lib/pubid/nist/identifiers/monograph.rb +1 -1
- data/lib/pubid/nist/identifiers/ncstar.rb +2 -2
- data/lib/pubid/nist/identifiers/nsrds.rb +1 -1
- data/lib/pubid/nist/identifiers/owmwp.rb +1 -1
- data/lib/pubid/nist/identifiers/report.rb +1 -1
- data/lib/pubid/nist/identifiers/special_publication.rb +10 -1
- data/lib/pubid/nist/identifiers/technical_note.rb +1 -1
- data/lib/pubid/nist/identifiers.rb +0 -1
- data/lib/pubid/nist/parser.rb +26 -3
- data/lib/pubid/nist/preprocessor.rb +15 -0
- data/lib/pubid/nist/router.rb +2 -2
- data/lib/pubid/nist/series/ir.rb +0 -3
- data/lib/pubid/nist/supplement_identifier.rb +9 -9
- data/lib/pubid/nist.rb +12 -12
- data/lib/pubid/oasis/builder.rb +77 -0
- data/lib/pubid/oasis/identifier.rb +82 -0
- data/lib/pubid/oasis/identifiers/standard.rb +29 -0
- data/lib/pubid/oasis/identifiers.rb +9 -0
- data/lib/pubid/oasis/parser.rb +34 -0
- data/lib/pubid/oasis/renderer.rb +29 -0
- data/lib/pubid/oasis/urn_generator.rb +25 -0
- data/lib/pubid/oasis/urn_parser.rb +22 -0
- data/lib/pubid/oasis.rb +74 -0
- data/lib/pubid/ogc/builder.rb +33 -0
- data/lib/pubid/ogc/identifier.rb +77 -0
- data/lib/pubid/ogc/identifiers/document.rb +26 -0
- data/lib/pubid/ogc/identifiers.rb +10 -0
- data/lib/pubid/ogc/parser.rb +40 -0
- data/lib/pubid/ogc/renderer.rb +33 -0
- data/lib/pubid/ogc/urn_generator.rb +14 -0
- data/lib/pubid/ogc/urn_parser.rb +22 -0
- data/lib/pubid/ogc.rb +71 -0
- data/lib/pubid/oiml/builder.rb +31 -7
- data/lib/pubid/oiml/identifier.rb +9 -1
- data/lib/pubid/oiml/parser.rb +11 -12
- data/lib/pubid/oiml/renderer.rb +13 -13
- data/lib/pubid/oiml/single_identifier.rb +20 -0
- data/lib/pubid/oiml/supplement_identifier.rb +9 -9
- data/lib/pubid/oiml/urn_parser.rb +23 -6
- data/lib/pubid/oiml.rb +4 -0
- data/lib/pubid/omg/builder.rb +19 -0
- data/lib/pubid/omg/identifier.rb +44 -0
- data/lib/pubid/omg/identifiers/specification.rb +32 -0
- data/lib/pubid/omg/identifiers.rb +9 -0
- data/lib/pubid/omg/parser.rb +40 -0
- data/lib/pubid/omg/renderer.rb +19 -0
- data/lib/pubid/omg.rb +51 -0
- data/lib/pubid/parsers/mr_string.rb +101 -7
- data/lib/pubid/plateau/builder.rb +8 -4
- data/lib/pubid/plateau/identifier.rb +1 -3
- data/lib/pubid/plateau/identifiers/base.rb +1 -6
- data/lib/pubid/plateau/identifiers/handbook.rb +1 -1
- data/lib/pubid/plateau/identifiers/technical_report.rb +1 -1
- data/lib/pubid/plateau/identifiers.rb +0 -1
- data/lib/pubid/plateau/parser.rb +15 -5
- data/lib/pubid/plateau/renderer.rb +1 -1
- data/lib/pubid/plateau/supplement_identifier.rb +11 -11
- data/lib/pubid/plateau.rb +4 -4
- data/lib/pubid/renderers/human_readable.rb +3 -1
- data/lib/pubid/renderers/mr_string.rb +46 -4
- data/lib/pubid/renderers/supplement_renderer.rb +1 -1
- data/lib/pubid/rendering/supplement.rb +4 -4
- data/lib/pubid/sae/builder.rb +1 -1
- data/lib/pubid/sae/identifier.rb +1 -3
- data/lib/pubid/sae/identifiers/base.rb +10 -7
- data/lib/pubid/sae/identifiers.rb +0 -1
- data/lib/pubid/sae.rb +3 -3
- data/lib/pubid/tgpp/builder.rb +41 -0
- data/lib/pubid/tgpp/identifier.rb +91 -0
- data/lib/pubid/tgpp/identifiers/technical_report.rb +32 -0
- data/lib/pubid/tgpp/identifiers/technical_specification.rb +33 -0
- data/lib/pubid/tgpp/identifiers.rb +11 -0
- data/lib/pubid/tgpp/parser.rb +62 -0
- data/lib/pubid/tgpp/renderer.rb +36 -0
- data/lib/pubid/tgpp/urn_generator.rb +20 -0
- data/lib/pubid/tgpp/urn_parser.rb +28 -0
- data/lib/pubid/tgpp.rb +78 -0
- data/lib/pubid/type_resolver.rb +59 -0
- data/lib/pubid/un/builder.rb +42 -0
- data/lib/pubid/un/identifier.rb +37 -0
- data/lib/pubid/un/identifiers/document.rb +24 -0
- data/lib/pubid/un/identifiers.rb +9 -0
- data/lib/pubid/un/parser.rb +25 -0
- data/lib/pubid/un/renderer.rb +11 -0
- data/lib/pubid/un.rb +46 -0
- data/lib/pubid/version.rb +1 -1
- data/lib/pubid/w3c/builder.rb +55 -0
- data/lib/pubid/w3c/identifier.rb +101 -0
- data/lib/pubid/w3c/identifiers/candidate_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/candidate_recommendation_draft.rb +31 -0
- data/lib/pubid/w3c/identifiers/draft_note.rb +31 -0
- data/lib/pubid/w3c/identifiers/note.rb +30 -0
- data/lib/pubid/w3c/identifiers/obsolete_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/proposed_edited_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/proposed_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/standard.rb +12 -0
- data/lib/pubid/w3c/identifiers/superseded_recommendation.rb +31 -0
- data/lib/pubid/w3c/identifiers/working_draft.rb +30 -0
- data/lib/pubid/w3c/identifiers.rb +25 -0
- data/lib/pubid/w3c/parser.rb +43 -0
- data/lib/pubid/w3c/renderer.rb +35 -0
- data/lib/pubid/w3c/urn_generator.rb +18 -0
- data/lib/pubid/w3c/urn_parser.rb +36 -0
- data/lib/pubid/w3c.rb +67 -0
- data/lib/pubid/xsf/builder.rb +17 -0
- data/lib/pubid/xsf/identifier.rb +62 -0
- data/lib/pubid/xsf/identifiers/xep.rb +31 -0
- data/lib/pubid/xsf/identifiers.rb +9 -0
- data/lib/pubid/xsf/parser.rb +25 -0
- data/lib/pubid/xsf/renderer.rb +23 -0
- data/lib/pubid/xsf/urn_generator.rb +13 -0
- data/lib/pubid/xsf/urn_parser.rb +18 -0
- data/lib/pubid/xsf.rb +76 -0
- data/lib/pubid.rb +25 -1
- metadata +205 -4
- data/lib/pubid/cie/components/code.rb +0 -80
- data/lib/pubid/iala/identifiers/base.rb +0 -14
|
@@ -56,48 +56,48 @@ module Pubid
|
|
|
56
56
|
|
|
57
57
|
# Addendum: "ASHRAE Addendum a to Standard 15-2001"
|
|
58
58
|
def render_addendum(id)
|
|
59
|
-
return id.
|
|
59
|
+
return id.base.to_s unless id.base
|
|
60
60
|
|
|
61
|
-
base_type = id.
|
|
61
|
+
base_type = id.base.type || "Standard"
|
|
62
62
|
|
|
63
63
|
if id.copublisher
|
|
64
|
-
"#{id.copublisher} Addendum #{id.addendum_code} to #{id.
|
|
64
|
+
"#{id.copublisher} Addendum #{id.addendum_code} to #{id.base}"
|
|
65
65
|
else
|
|
66
|
-
result = "ASHRAE Addendum #{id.addendum_code} to #{base_type} #{id.
|
|
67
|
-
result += "-#{id.
|
|
66
|
+
result = "ASHRAE Addendum #{id.addendum_code} to #{base_type} #{id.base.code}"
|
|
67
|
+
result += "-#{id.base.year}" if id.base.year
|
|
68
68
|
result
|
|
69
69
|
end.tap { |r| r << " (#{id.addendum_date})" if id.addendum_date }
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
# AddendaPackage: "ASHRAE Standard 52.2-1999: Addenda Supplement Package"
|
|
73
73
|
def render_addenda_package(id)
|
|
74
|
-
return id.
|
|
74
|
+
return id.base.to_s unless id.base
|
|
75
75
|
|
|
76
|
-
result = "ASHRAE #{id.
|
|
77
|
-
result += "-#{id.
|
|
76
|
+
result = "ASHRAE #{id.base.type || 'Standard'} #{id.base.code}"
|
|
77
|
+
result += "-#{id.base.year}" if id.base.year
|
|
78
78
|
result += ": Addenda #{id.package_description}" if id.package_description
|
|
79
79
|
result
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
# CombinedAddenda: "ASHRAE Addenda c and d to Standard 15-1994"
|
|
83
83
|
def render_combined_addenda(id)
|
|
84
|
-
return id.
|
|
84
|
+
return id.base.to_s unless id.base
|
|
85
85
|
|
|
86
|
-
base_type = id.
|
|
86
|
+
base_type = id.base.type || "Standard"
|
|
87
87
|
if id.addendum_codes
|
|
88
|
-
result = "ASHRAE Addenda #{id.addendum_codes} to #{base_type} #{id.
|
|
88
|
+
result = "ASHRAE Addenda #{id.addendum_codes} to #{base_type} #{id.base.code}"
|
|
89
89
|
else
|
|
90
|
-
result = "ASHRAE Addenda to #{base_type} #{id.
|
|
90
|
+
result = "ASHRAE Addenda to #{base_type} #{id.base.code}"
|
|
91
91
|
end
|
|
92
|
-
result += "-#{id.
|
|
92
|
+
result += "-#{id.base.year}" if id.base.year
|
|
93
93
|
result
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# Errata: "ASHRAE Guideline 0-2005 Errata (September 28, 2011)"
|
|
97
97
|
def render_errata(id)
|
|
98
|
-
return id.
|
|
98
|
+
return id.base.to_s unless id.base
|
|
99
99
|
|
|
100
|
-
result = id.
|
|
100
|
+
result = id.base.to_s
|
|
101
101
|
result += " Errata"
|
|
102
102
|
result += " (#{id.errata_date})" if id.errata_date
|
|
103
103
|
result
|
|
@@ -105,11 +105,11 @@ module Pubid
|
|
|
105
105
|
|
|
106
106
|
# Interpretation: "Interpretations for Standard 15.2-2022"
|
|
107
107
|
def render_interpretation(id)
|
|
108
|
-
return id.
|
|
108
|
+
return id.base.to_s unless id.base
|
|
109
109
|
|
|
110
|
-
base_type = id.
|
|
111
|
-
result = "Interpretations for #{base_type} #{id.
|
|
112
|
-
result += "-#{id.
|
|
110
|
+
base_type = id.base.type || "Standard"
|
|
111
|
+
result = "Interpretations for #{base_type} #{id.base.code}"
|
|
112
|
+
result += "-#{id.base.year}" if id.base.year
|
|
113
113
|
result
|
|
114
114
|
end
|
|
115
115
|
end
|
|
@@ -6,17 +6,17 @@ module Pubid
|
|
|
6
6
|
module Ashrae
|
|
7
7
|
# Base class for supplement identifiers (addendums, errata, interpretations)
|
|
8
8
|
# Supplements modify or add to a base document
|
|
9
|
-
class SupplementIdentifier <
|
|
10
|
-
attribute :
|
|
9
|
+
class SupplementIdentifier < Identifier
|
|
10
|
+
attribute :base, Identifier, polymorphic: true
|
|
11
11
|
|
|
12
|
-
# Delegate publisher to
|
|
12
|
+
# Delegate publisher to base
|
|
13
13
|
def publisher
|
|
14
|
-
|
|
14
|
+
base&.publisher
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
# Delegate code to
|
|
17
|
+
# Delegate code to base
|
|
18
18
|
def code
|
|
19
|
-
|
|
19
|
+
base&.code
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
data/lib/pubid/ashrae.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Pubid
|
|
|
9
9
|
PREFIXES = ["ASHRAE"].freeze
|
|
10
10
|
|
|
11
11
|
autoload :Builder, "#{__dir__}/ashrae/builder"
|
|
12
|
-
autoload :Identifier, "#{__dir__}/ashrae/
|
|
12
|
+
autoload :Identifier, "#{__dir__}/ashrae/identifiers/base"
|
|
13
13
|
autoload :Identifiers, "#{__dir__}/ashrae/identifiers"
|
|
14
14
|
autoload :Parser, "#{__dir__}/ashrae/parser"
|
|
15
15
|
autoload :Renderer, "#{__dir__}/ashrae/renderer"
|
|
@@ -68,5 +68,5 @@ end
|
|
|
68
68
|
Pubid::Registry.register(:ashrae, Pubid::Ashrae)
|
|
69
69
|
|
|
70
70
|
# Per-flavor format registry: inherits global formats, overrides :human
|
|
71
|
-
Pubid::Ashrae::
|
|
72
|
-
Pubid::Ashrae::
|
|
71
|
+
Pubid::Ashrae::Identifier.format_registry = Pubid::FormatRegistry.new(parent: Pubid::Identifier.format_registry)
|
|
72
|
+
Pubid::Ashrae::Identifier.format_registry.register(:human, renderer: Pubid::Ashrae::Renderer)
|
|
@@ -0,0 +1,107 @@
|
|
|
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[:mep]
|
|
34
|
+
build_mep(data[:mep])
|
|
35
|
+
elsif data[:guide]
|
|
36
|
+
build_guide(data[:guide])
|
|
37
|
+
else
|
|
38
|
+
raise "Unrecognized BIPM parse tree: #{data.inspect}"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def build_committee(node, form:, language: nil)
|
|
45
|
+
Identifiers::CommitteeDocument.new(
|
|
46
|
+
group: node[:group].to_s,
|
|
47
|
+
type_code: Identifier::TYPE_WORD_TO_CODE[node[:type_word].to_s],
|
|
48
|
+
number: node[:number]&.to_s,
|
|
49
|
+
year: node[:year]&.to_s&.to_i,
|
|
50
|
+
language: language || node[:language]&.to_s,
|
|
51
|
+
form: form,
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def build_meeting(node, language: nil)
|
|
56
|
+
Identifiers::Meeting.new(
|
|
57
|
+
group: node[:group].to_s,
|
|
58
|
+
number: node[:number].to_s,
|
|
59
|
+
year: node[:year]&.to_s&.to_i,
|
|
60
|
+
language: language || node[:language]&.to_s,
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def build_metrologia(node)
|
|
65
|
+
node = {} unless node.is_a?(Hash)
|
|
66
|
+
Identifiers::MetrologiaArticle.new(
|
|
67
|
+
volume: node[:volume]&.to_s&.to_i,
|
|
68
|
+
issue: node[:issue]&.to_s,
|
|
69
|
+
article: node[:article]&.to_s,
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def build_si_brochure(node)
|
|
74
|
+
Identifiers::SiBrochure.new(
|
|
75
|
+
edition: node[:edition].to_s,
|
|
76
|
+
version: node[:version].to_s,
|
|
77
|
+
years: node[:years].to_s,
|
|
78
|
+
language: node[:language]&.to_s,
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def build_si_brochure_variant(node)
|
|
83
|
+
Identifiers::SiBrochure.new(variant: node[:variant].to_s)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def build_mep(node)
|
|
87
|
+
Identifiers::Mep.new(
|
|
88
|
+
mep_code: node[:mep_code]&.to_s,
|
|
89
|
+
report_code: node[:report_code]&.to_s,
|
|
90
|
+
appendix: node[:appendix]&.to_s,
|
|
91
|
+
annex: node[:annex]&.to_s,
|
|
92
|
+
part: node[:part]&.to_s,
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def build_guide(node)
|
|
97
|
+
Identifiers::Guide.new(
|
|
98
|
+
group: node[:group].to_s,
|
|
99
|
+
guide_kind: node[:guide_kind].to_s,
|
|
100
|
+
number: node[:number].to_s,
|
|
101
|
+
appendix: node[:appendix]&.to_s,
|
|
102
|
+
part: node[:part]&.to_s,
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
# Committee document type codes and their printed long-form names. Note
|
|
23
|
+
# DECL prints as "Statement" in BOTH languages in the source data.
|
|
24
|
+
TYPE_CODES = %w[REC RES DECN ACT DECL].freeze
|
|
25
|
+
TYPE_NAME_EN = {
|
|
26
|
+
"REC" => "Recommendation", "RES" => "Resolution",
|
|
27
|
+
"DECN" => "Decision", "ACT" => "Action", "DECL" => "Statement"
|
|
28
|
+
}.freeze
|
|
29
|
+
TYPE_NAME_FR = {
|
|
30
|
+
"REC" => "Recommandation", "RES" => "Résolution",
|
|
31
|
+
"DECN" => "Décision", "ACT" => "Action", "DECL" => "Statement"
|
|
32
|
+
}.freeze
|
|
33
|
+
# Every printed type word (abbrev + English + French) → canonical code.
|
|
34
|
+
TYPE_WORD_TO_CODE = TYPE_CODES.each_with_object({}) do |code, map|
|
|
35
|
+
map[code] = code
|
|
36
|
+
map[TYPE_NAME_EN[code]] = code
|
|
37
|
+
map[TYPE_NAME_FR[code]] = code
|
|
38
|
+
end.freeze
|
|
39
|
+
|
|
40
|
+
# Shared attributes (flat). Booleans/strings carry no default so they stay
|
|
41
|
+
# nil and drop from the serialized hash unless set.
|
|
42
|
+
attribute :group, :string
|
|
43
|
+
attribute :type_code, :string # REC/RES/DECN/ACT/DECL (avoids base `type`)
|
|
44
|
+
attribute :number, :string # may be hyphenated ("10-1") or nil
|
|
45
|
+
attribute :year, :integer
|
|
46
|
+
attribute :language, :string # "E"/"F"; nil = language-neutral
|
|
47
|
+
# Surface style of committee documents: "short" (abbreviated key form) vs
|
|
48
|
+
# "long" (full type-word name). Defaults to "short" so it drops from the
|
|
49
|
+
# canonical hash for the indexed primary form.
|
|
50
|
+
attribute :form, :string, default: "short"
|
|
51
|
+
# Metrologia journal fields.
|
|
52
|
+
attribute :volume, :integer
|
|
53
|
+
attribute :issue, :string # may be alphanumeric ("1A")
|
|
54
|
+
attribute :article, :string
|
|
55
|
+
# SI Brochure fields.
|
|
56
|
+
attribute :edition, :string # "9e"
|
|
57
|
+
attribute :version, :string # "v3.01"
|
|
58
|
+
attribute :years, :string # "2019/2024"
|
|
59
|
+
# SI Brochure appendix/derived variant: "Appendix 3", "Concise", "FAQ".
|
|
60
|
+
attribute :variant, :string
|
|
61
|
+
# Mise en pratique (MEP) fields.
|
|
62
|
+
attribute :mep_code, :string # "S1", "KUPRTM"
|
|
63
|
+
attribute :report_code, :string # MEP report variant: "BIPM-2019/05"
|
|
64
|
+
# Consultative-Committee guide kind ("MeP"/"RSI"); group + number reused.
|
|
65
|
+
attribute :guide_kind, :string
|
|
66
|
+
# Full-content "Appendix N [Annex N] Part N.M" tail shared by MEP + guide
|
|
67
|
+
# primary-docidentifier forms (nil for the bare short docnumber spelling).
|
|
68
|
+
attribute :appendix, :string
|
|
69
|
+
attribute :annex, :string
|
|
70
|
+
attribute :part, :string
|
|
71
|
+
|
|
72
|
+
# Polymorphic type map for lutaml::Model key_value (de)serialization:
|
|
73
|
+
# maps each subclass's polymorphic_name to its class name so a stored hash
|
|
74
|
+
# rebuilds the correct identifier type via from_hash.
|
|
75
|
+
BIPM_TYPE_MAP = {
|
|
76
|
+
"pubid:bipm:committee-document" =>
|
|
77
|
+
"Pubid::Bipm::Identifiers::CommitteeDocument",
|
|
78
|
+
"pubid:bipm:meeting" => "Pubid::Bipm::Identifiers::Meeting",
|
|
79
|
+
"pubid:bipm:metrologia-article" =>
|
|
80
|
+
"Pubid::Bipm::Identifiers::MetrologiaArticle",
|
|
81
|
+
"pubid:bipm:si-brochure" => "Pubid::Bipm::Identifiers::SiBrochure",
|
|
82
|
+
"pubid:bipm:mep" => "Pubid::Bipm::Identifiers::Mep",
|
|
83
|
+
"pubid:bipm:guide" => "Pubid::Bipm::Identifiers::Guide",
|
|
84
|
+
}.freeze
|
|
85
|
+
|
|
86
|
+
key_value do
|
|
87
|
+
map "_type", to: :_type, polymorphic_map: BIPM_TYPE_MAP
|
|
88
|
+
map "group", to: :group
|
|
89
|
+
map "type_code", to: :type_code
|
|
90
|
+
map "number", to: :number
|
|
91
|
+
map "year", to: :year
|
|
92
|
+
map "language", to: :language
|
|
93
|
+
map "form", to: :form
|
|
94
|
+
map "volume", to: :volume
|
|
95
|
+
map "issue", to: :issue
|
|
96
|
+
map "article", to: :article
|
|
97
|
+
map "edition", to: :edition
|
|
98
|
+
map "version", to: :version
|
|
99
|
+
map "years", to: :years
|
|
100
|
+
map "variant", to: :variant
|
|
101
|
+
map "mep_code", to: :mep_code
|
|
102
|
+
map "report_code", to: :report_code
|
|
103
|
+
map "guide_kind", to: :guide_kind
|
|
104
|
+
map "appendix", to: :appendix
|
|
105
|
+
map "annex", to: :annex
|
|
106
|
+
map "part", to: :part
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Publisher is always "BIPM". A plain constant (not a `publisher` method)
|
|
110
|
+
# so it doesn't shadow the inherited lutaml `publisher` attribute, which
|
|
111
|
+
# would otherwise fail serialization type validation.
|
|
112
|
+
PUBLISHER = "BIPM"
|
|
113
|
+
|
|
114
|
+
# French connective before a committee acronym: "de la" for the (feminine)
|
|
115
|
+
# CGPM, "du" for every other (masculine) committee.
|
|
116
|
+
def self.french_connective(group)
|
|
117
|
+
group == "CGPM" ? "de la" : "du"
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def long?
|
|
121
|
+
form == "long"
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# BIPM keeps the publication year in its own `year` integer attribute
|
|
125
|
+
# rather than the base `date` component, so the base #exclude's
|
|
126
|
+
# :year->:date remap would nil the (unused) inherited `date` and leave
|
|
127
|
+
# `year` intact. Clear `year` directly when either alias is excluded so
|
|
128
|
+
# `matches?(row, ignore: [:year])` treats a partial (date-less) reference
|
|
129
|
+
# as a year wildcard.
|
|
130
|
+
def exclude(*args)
|
|
131
|
+
result = super
|
|
132
|
+
result.year = nil if args.include?(:year) || args.include?(:date)
|
|
133
|
+
result
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Basic string representation. Delegates to renderer.
|
|
137
|
+
def to_s(**opts)
|
|
138
|
+
render(format: :human, **opts)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Parse a BIPM identifier string into an identifier object.
|
|
142
|
+
# @param identifier [String] the BIPM identifier string
|
|
143
|
+
# @return [Identifier] the appropriate identifier object
|
|
144
|
+
# @raise [RuntimeError] if parsing fails
|
|
145
|
+
def self.parse(identifier)
|
|
146
|
+
if identifier.length > Pubid::MAX_INPUT_LENGTH
|
|
147
|
+
raise ArgumentError, Pubid::INPUT_TOO_LONG_MESSAGE
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Normalize legacy/docnumber-style spellings before parsing
|
|
151
|
+
# (data/bipm/update_codes.yaml), mirroring Pubid::Ccsds / Pubid::Plateau.
|
|
152
|
+
normalized = Core::UpdateCodes.apply(identifier, :bipm)
|
|
153
|
+
parsed = Parser.parse(normalized)
|
|
154
|
+
Builder.build(parsed)
|
|
155
|
+
rescue Parslet::ParseFailed => e
|
|
156
|
+
raise "Failed to parse BIPM identifier '#{identifier}': #{e.message}"
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Bipm
|
|
5
|
+
module Identifiers
|
|
6
|
+
# The SI Brochure — a single bespoke record. The English form drops the
|
|
7
|
+
# "sur le SI" phrase the French form carries.
|
|
8
|
+
#
|
|
9
|
+
# Printed forms (both round-trip):
|
|
10
|
+
# "BIPM SI Brochure 9e v3.01 (2019/2024, E)"
|
|
11
|
+
# "BIPM SI Brochure sur le SI 9e v3.01 (2019/2024, F)"
|
|
12
|
+
class SiBrochure < Identifier
|
|
13
|
+
def self.type
|
|
14
|
+
{ key: :si_brochure, web: :si_brochure,
|
|
15
|
+
title: "SI Brochure", short: "si-brochure" }
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Bipm
|
|
5
|
+
# Namespace for concrete BIPM identifier types.
|
|
6
|
+
module Identifiers
|
|
7
|
+
autoload :CommitteeDocument, "#{__dir__}/identifiers/committee_document"
|
|
8
|
+
autoload :Guide, "#{__dir__}/identifiers/guide"
|
|
9
|
+
autoload :Meeting, "#{__dir__}/identifiers/meeting"
|
|
10
|
+
autoload :Mep, "#{__dir__}/identifiers/mep"
|
|
11
|
+
autoload :MetrologiaArticle, "#{__dir__}/identifiers/metrologia_article"
|
|
12
|
+
autoload :SiBrochure, "#{__dir__}/identifiers/si_brochure"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|