relaton 2.2.0.pre.alpha.1 → 3.0.0.pre.alpha.2
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/{docs/README.adoc → README.adoc} +165 -38
- data/bin/console +0 -1
- data/lib/relaton/3gpp/bibdata.rb +9 -0
- data/lib/relaton/3gpp/bibitem.rb +9 -0
- data/lib/relaton/3gpp/bibliography.rb +123 -0
- data/lib/relaton/3gpp/data_fetcher.rb +303 -0
- data/lib/relaton/3gpp/docidentifier.rb +114 -0
- data/lib/relaton/3gpp/doctype.rb +9 -0
- data/lib/relaton/3gpp/ext.rb +31 -0
- data/lib/relaton/3gpp/item.rb +18 -0
- data/lib/relaton/3gpp/item_data.rb +15 -0
- data/lib/relaton/3gpp/parser.rb +400 -0
- data/lib/relaton/3gpp/processor.rb +71 -0
- data/lib/relaton/3gpp/release.rb +34 -0
- data/lib/relaton/3gpp/util.rb +8 -0
- data/lib/relaton/3gpp.rb +29 -0
- data/lib/relaton/adobe/bibdata.rb +8 -0
- data/lib/relaton/adobe/bibitem.rb +8 -0
- data/lib/relaton/adobe/bibliography.rb +92 -0
- data/lib/relaton/adobe/docidentifier.rb +49 -0
- data/lib/relaton/adobe/doctype.rb +14 -0
- data/lib/relaton/adobe/ext.rb +32 -0
- data/lib/relaton/adobe/item.rb +15 -0
- data/lib/relaton/adobe/item_base.rb +18 -0
- data/lib/relaton/adobe/item_data.rb +6 -0
- data/lib/relaton/adobe/processor.rb +45 -0
- data/lib/relaton/adobe/util.rb +8 -0
- data/lib/relaton/adobe.rb +37 -0
- data/lib/relaton/bib/converter/asciibib/to_asciibib.rb +663 -0
- data/lib/relaton/bib/converter/asciibib.rb +13 -0
- data/lib/relaton/bib/converter/bibtex/from_bibtex.rb +245 -0
- data/lib/relaton/bib/converter/bibtex/to_bibtex.rb +341 -0
- data/lib/relaton/bib/converter/bibtex.rb +23 -0
- data/lib/relaton/bib/converter/bibxml/from_rfcxml.rb +386 -0
- data/lib/relaton/bib/converter/bibxml/from_rfcxml_referencegroup.rb +71 -0
- data/lib/relaton/bib/converter/bibxml/to_rfcxml.rb +308 -0
- data/lib/relaton/bib/converter/bibxml/to_rfcxml_referencegroup.rb +52 -0
- data/lib/relaton/bib/converter/bibxml.rb +51 -0
- data/lib/relaton/bib/hash_parser_v1.rb +767 -0
- data/lib/relaton/bib/item_data.rb +229 -0
- data/lib/relaton/bib/model/abstract.rb +16 -0
- data/lib/relaton/bib/model/address.rb +22 -0
- data/lib/relaton/bib/model/affiliation.rb +16 -0
- data/lib/relaton/bib/model/bibdata.rb +11 -0
- data/lib/relaton/bib/model/bibdata_shared.rb +12 -0
- data/lib/relaton/bib/model/bibitem.rb +11 -0
- data/lib/relaton/bib/model/bibitem_shared.rb +12 -0
- data/lib/relaton/bib/model/contact.rb +18 -0
- data/lib/relaton/bib/model/contribution_info.rb +15 -0
- data/lib/relaton/bib/model/contributor.rb +29 -0
- data/lib/relaton/bib/model/copyright.rb +27 -0
- data/lib/relaton/bib/model/date.rb +31 -0
- data/lib/relaton/bib/model/depiction.rb +16 -0
- data/lib/relaton/bib/model/docidentifier.rb +49 -0
- data/lib/relaton/bib/model/doctype.rb +14 -0
- data/lib/relaton/bib/model/edition.rb +14 -0
- data/lib/relaton/bib/model/ext.rb +39 -0
- data/lib/relaton/bib/model/extent.rb +16 -0
- data/lib/relaton/bib/model/formattedref.rb +43 -0
- data/lib/relaton/bib/model/full_name_type.rb +64 -0
- data/lib/relaton/bib/model/fullname.rb +11 -0
- data/lib/relaton/bib/model/ics.rb +49 -0
- data/lib/relaton/bib/model/image.rb +28 -0
- data/lib/relaton/bib/model/item.rb +96 -0
- data/lib/relaton/bib/model/item_base.rb +20 -0
- data/lib/relaton/bib/model/item_shared.rb +88 -0
- data/lib/relaton/bib/model/keyword.rb +30 -0
- data/lib/relaton/bib/model/locality.rb +18 -0
- data/lib/relaton/bib/model/locality_stack.rb +14 -0
- data/lib/relaton/bib/model/localized_string.rb +48 -0
- data/lib/relaton/bib/model/localized_string_attrs.rb +24 -0
- data/lib/relaton/bib/model/logo.rb +14 -0
- data/lib/relaton/bib/model/medium.rb +22 -0
- data/lib/relaton/bib/model/note.rb +16 -0
- data/lib/relaton/bib/model/organization.rb +13 -0
- data/lib/relaton/bib/model/organization_type.rb +42 -0
- data/lib/relaton/bib/model/person.rb +36 -0
- data/lib/relaton/bib/model/phone.rb +14 -0
- data/lib/relaton/bib/model/place.rb +33 -0
- data/lib/relaton/bib/model/price.rb +14 -0
- data/lib/relaton/bib/model/relation.rb +43 -0
- data/lib/relaton/bib/model/series.rb +34 -0
- data/lib/relaton/bib/model/size.rb +23 -0
- data/lib/relaton/bib/model/source_locality_stack.rb +14 -0
- data/lib/relaton/bib/model/status.rb +27 -0
- data/lib/relaton/bib/model/structured_identifier.rb +49 -0
- data/lib/relaton/bib/model/subdivision.rb +16 -0
- data/lib/relaton/bib/model/title.rb +56 -0
- data/lib/relaton/bib/model/type/plain_date.rb +16 -0
- data/lib/relaton/bib/model/type/string_date.rb +48 -0
- data/lib/relaton/bib/model/uri.rb +18 -0
- data/lib/relaton/bib/model/validity.rb +16 -0
- data/lib/relaton/bib/model/version.rb +43 -0
- data/lib/relaton/bib/namespace_helper.rb +21 -0
- data/lib/relaton/bib/sanitizer.rb +264 -0
- data/lib/relaton/bib/util.rb +18 -0
- data/lib/relaton/bib/versions.json +35 -0
- data/lib/relaton/bib.rb +46 -0
- data/lib/relaton/bipm/bibliography.rb +231 -0
- data/lib/relaton/bipm/converter/asciibib.rb +64 -0
- data/lib/relaton/bipm/data_fetcher.rb +81 -0
- data/lib/relaton/bipm/data_outcomes_parser.rb +656 -0
- data/lib/relaton/bipm/id_parser.rb +278 -0
- data/lib/relaton/bipm/item_data.rb +47 -0
- data/lib/relaton/bipm/model/bibdata.rb +9 -0
- data/lib/relaton/bipm/model/bibitem.rb +9 -0
- data/lib/relaton/bipm/model/comment_period.rb +13 -0
- data/lib/relaton/bipm/model/doctype.rb +12 -0
- data/lib/relaton/bipm/model/ext.rb +38 -0
- data/lib/relaton/bipm/model/item.rb +11 -0
- data/lib/relaton/bipm/model/structured_identifier.rb +36 -0
- data/lib/relaton/bipm/processor.rb +69 -0
- data/lib/relaton/bipm/rawdata_bipm_metrologia/affiliations.rb +111 -0
- data/lib/relaton/bipm/rawdata_bipm_metrologia/fetcher.rb +172 -0
- data/lib/relaton/bipm/rawdata_bipm_metrologia/niso_jats_parser.rb +353 -0
- data/lib/relaton/bipm/si_brochure_parser.rb +188 -0
- data/lib/relaton/bipm/util.rb +8 -0
- data/lib/relaton/bipm.rb +38 -0
- data/lib/relaton/bsi/bibliography.rb +196 -0
- data/lib/relaton/bsi/hit.rb +28 -0
- data/lib/relaton/bsi/hit_collection.rb +113 -0
- data/lib/relaton/bsi/item_data.rb +13 -0
- data/lib/relaton/bsi/model/bibdata.rb +8 -0
- data/lib/relaton/bsi/model/bibitem.rb +8 -0
- data/lib/relaton/bsi/model/docidentifier.rb +107 -0
- data/lib/relaton/bsi/model/doctype.rb +14 -0
- data/lib/relaton/bsi/model/ext.rb +17 -0
- data/lib/relaton/bsi/model/item.rb +17 -0
- data/lib/relaton/bsi/model/item_base.rb +22 -0
- data/lib/relaton/bsi/model/relation.rb +9 -0
- data/lib/relaton/bsi/processor.rb +43 -0
- data/lib/relaton/bsi/schema.json +24882 -0
- data/lib/relaton/bsi/scraper.rb +288 -0
- data/lib/relaton/bsi/util.rb +8 -0
- data/lib/relaton/bsi.rb +25 -0
- data/lib/relaton/calconnect/bibliography.rb +93 -0
- data/lib/relaton/calconnect/data_fetcher.rb +174 -0
- data/lib/relaton/calconnect/docidentifier.rb +80 -0
- data/lib/relaton/calconnect/hit.rb +14 -0
- data/lib/relaton/calconnect/hit_collection.rb +92 -0
- data/lib/relaton/calconnect/item_data.rb +12 -0
- data/lib/relaton/calconnect/model/bibdata.rb +8 -0
- data/lib/relaton/calconnect/model/bibitem.rb +8 -0
- data/lib/relaton/calconnect/model/doctype.rb +11 -0
- data/lib/relaton/calconnect/model/ext.rb +11 -0
- data/lib/relaton/calconnect/model/item.rb +20 -0
- data/lib/relaton/calconnect/processor.rb +72 -0
- data/lib/relaton/calconnect/scraper.rb +87 -0
- data/lib/relaton/calconnect/util.rb +8 -0
- data/lib/relaton/calconnect.rb +36 -0
- data/lib/relaton/ccsds/bibliography.rb +63 -0
- data/lib/relaton/ccsds/data/fetcher.rb +252 -0
- data/lib/relaton/ccsds/data/iso_references.rb +30 -0
- data/lib/relaton/ccsds/data/parser.rb +194 -0
- data/lib/relaton/ccsds/hit.rb +24 -0
- data/lib/relaton/ccsds/hit_collection.rb +47 -0
- data/lib/relaton/ccsds/item_data.rb +9 -0
- data/lib/relaton/ccsds/model/bibdata.rb +8 -0
- data/lib/relaton/ccsds/model/bibitem.rb +8 -0
- data/lib/relaton/ccsds/model/docidentifier.rb +121 -0
- data/lib/relaton/ccsds/model/doctype.rb +9 -0
- data/lib/relaton/ccsds/model/ext.rb +19 -0
- data/lib/relaton/ccsds/model/item.rb +15 -0
- data/lib/relaton/ccsds/processor.rb +68 -0
- data/lib/relaton/ccsds/util.rb +10 -0
- data/lib/relaton/ccsds.rb +33 -0
- data/lib/relaton/cen/bibliography.rb +149 -0
- data/lib/relaton/cen/committees.yaml +66 -0
- data/lib/relaton/cen/hit.rb +31 -0
- data/lib/relaton/cen/hit_collection.rb +116 -0
- data/lib/relaton/cen/item_data.rb +7 -0
- data/lib/relaton/cen/model/bibdata.rb +8 -0
- data/lib/relaton/cen/model/bibitem.rb +8 -0
- data/lib/relaton/cen/model/docidentifier.rb +100 -0
- data/lib/relaton/cen/model/ext.rb +11 -0
- data/lib/relaton/cen/model/item.rb +14 -0
- data/lib/relaton/cen/model/structured_identifier.rb +9 -0
- data/lib/relaton/cen/processor.rb +45 -0
- data/lib/relaton/cen/scraper.rb +218 -0
- data/lib/relaton/cen/util.rb +8 -0
- data/lib/relaton/cen.rb +30 -0
- data/lib/relaton/cie/bibdata.rb +8 -0
- data/lib/relaton/cie/bibitem.rb +8 -0
- data/lib/relaton/cie/bibliography.rb +31 -0
- data/lib/relaton/cie/data_fetcher.rb +540 -0
- data/lib/relaton/cie/ext.rb +7 -0
- data/lib/relaton/cie/item.rb +11 -0
- data/lib/relaton/cie/item_data.rb +6 -0
- data/lib/relaton/cie/processor.rb +68 -0
- data/lib/relaton/cie/scrapper.rb +52 -0
- data/lib/relaton/cie/util.rb +8 -0
- data/lib/relaton/cie.rb +29 -0
- data/lib/relaton/core/array_wrapper.rb +20 -0
- data/lib/relaton/core/data_fetcher.rb +244 -0
- data/lib/relaton/core/date_parser.rb +42 -0
- data/lib/relaton/core/governor.rb +320 -0
- data/lib/relaton/core/hash_keys_sybolizer.rb +19 -0
- data/lib/relaton/core/hit.rb +49 -0
- data/lib/relaton/core/hit_collection.rb +118 -0
- data/lib/relaton/core/pacer.rb +134 -0
- data/lib/relaton/core/processor.rb +67 -0
- data/lib/relaton/core/request_error.rb +14 -0
- data/lib/relaton/core/workers_pool.rb +45 -0
- data/lib/relaton/core.rb +12 -0
- data/lib/relaton/db/registry.rb +44 -4
- data/lib/relaton/db.rb +0 -1
- data/lib/relaton/doi/crossref.rb +89 -0
- data/lib/relaton/doi/parser.rb +921 -0
- data/lib/relaton/doi/processor.rb +65 -0
- data/lib/relaton/doi/util.rb +8 -0
- data/lib/relaton/doi.rb +20 -0
- data/lib/relaton/easc/bibdata.rb +8 -0
- data/lib/relaton/easc/bibitem.rb +8 -0
- data/lib/relaton/easc/bibliography.rb +95 -0
- data/lib/relaton/easc/docidentifier.rb +100 -0
- data/lib/relaton/easc/doctype.rb +14 -0
- data/lib/relaton/easc/ext.rb +44 -0
- data/lib/relaton/easc/item.rb +13 -0
- data/lib/relaton/easc/item_base.rb +18 -0
- data/lib/relaton/easc/item_data.rb +6 -0
- data/lib/relaton/easc/processor.rb +46 -0
- data/lib/relaton/easc/util.rb +8 -0
- data/lib/relaton/easc.rb +35 -0
- data/lib/relaton/ecma/bibdata.rb +8 -0
- data/lib/relaton/ecma/bibitem.rb +8 -0
- data/lib/relaton/ecma/bibliography.rb +149 -0
- data/lib/relaton/ecma/data_fetcher.rb +162 -0
- data/lib/relaton/ecma/data_parser.rb +49 -0
- data/lib/relaton/ecma/docidentifier.rb +124 -0
- data/lib/relaton/ecma/edition_parser.rb +80 -0
- data/lib/relaton/ecma/ext.rb +7 -0
- data/lib/relaton/ecma/item.rb +13 -0
- data/lib/relaton/ecma/item_data.rb +6 -0
- data/lib/relaton/ecma/memento_parser.rb +60 -0
- data/lib/relaton/ecma/page_fetcher.rb +39 -0
- data/lib/relaton/ecma/parser_common.rb +33 -0
- data/lib/relaton/ecma/processor.rb +69 -0
- data/lib/relaton/ecma/standard_parser.rb +134 -0
- data/lib/relaton/ecma/util.rb +8 -0
- data/lib/relaton/ecma.rb +33 -0
- data/lib/relaton/etsi/bibdata.rb +10 -0
- data/lib/relaton/etsi/bibitem.rb +10 -0
- data/lib/relaton/etsi/bibliography.rb +111 -0
- data/lib/relaton/etsi/data_fetcher.rb +167 -0
- data/lib/relaton/etsi/data_parser.rb +208 -0
- data/lib/relaton/etsi/doctype.rb +30 -0
- data/lib/relaton/etsi/ext.rb +31 -0
- data/lib/relaton/etsi/item.rb +15 -0
- data/lib/relaton/etsi/item_data.rb +6 -0
- data/lib/relaton/etsi/processor.rb +71 -0
- data/lib/relaton/etsi/pubid.rb +37 -0
- data/lib/relaton/etsi/status.rb +13 -0
- data/lib/relaton/etsi/util.rb +8 -0
- data/lib/relaton/etsi.rb +26 -0
- data/lib/relaton/gb/bibdata.rb +8 -0
- data/lib/relaton/gb/bibitem.rb +8 -0
- data/lib/relaton/gb/bibliography.rb +171 -0
- data/lib/relaton/gb/ccs.rb +14 -0
- data/lib/relaton/gb/committee.rb +13 -0
- data/lib/relaton/gb/docidentifier.rb +72 -0
- data/lib/relaton/gb/doctype.rb +9 -0
- data/lib/relaton/gb/ext.rb +36 -0
- data/lib/relaton/gb/gb_scraper.rb +61 -0
- data/lib/relaton/gb/gb_type.rb +20 -0
- data/lib/relaton/gb/hit.rb +48 -0
- data/lib/relaton/gb/hit_collection.rb +19 -0
- data/lib/relaton/gb/item.rb +13 -0
- data/lib/relaton/gb/item_data.rb +6 -0
- data/lib/relaton/gb/processor.rb +49 -0
- data/lib/relaton/gb/project_number.rb +38 -0
- data/lib/relaton/gb/scraper.rb +221 -0
- data/lib/relaton/gb/sec_scraper.rb +92 -0
- data/lib/relaton/gb/stage_name.rb +13 -0
- data/lib/relaton/gb/structured_identifier.rb +26 -0
- data/lib/relaton/gb/t_scraper.rb +126 -0
- data/lib/relaton/gb/util.rb +8 -0
- data/lib/relaton/gb/yaml/prefixes.yaml +200 -0
- data/lib/relaton/gb.rb +33 -0
- data/lib/relaton/gost/bibdata.rb +8 -0
- data/lib/relaton/gost/bibitem.rb +8 -0
- data/lib/relaton/gost/bibliography.rb +107 -0
- data/lib/relaton/gost/docidentifier.rb +80 -0
- data/lib/relaton/gost/doctype.rb +16 -0
- data/lib/relaton/gost/ext.rb +46 -0
- data/lib/relaton/gost/item.rb +15 -0
- data/lib/relaton/gost/item_base.rb +18 -0
- data/lib/relaton/gost/item_data.rb +6 -0
- data/lib/relaton/gost/processor.rb +49 -0
- data/lib/relaton/gost/util.rb +8 -0
- data/lib/relaton/gost.rb +36 -0
- data/lib/relaton/iala/bibdata.rb +8 -0
- data/lib/relaton/iala/bibitem.rb +8 -0
- data/lib/relaton/iala/bibliography.rb +146 -0
- data/lib/relaton/iala/docidentifier.rb +89 -0
- data/lib/relaton/iala/doctype.rb +18 -0
- data/lib/relaton/iala/ext.rb +32 -0
- data/lib/relaton/iala/item.rb +21 -0
- data/lib/relaton/iala/item_base.rb +18 -0
- data/lib/relaton/iala/item_data.rb +6 -0
- data/lib/relaton/iala/processor.rb +43 -0
- data/lib/relaton/iala/relation.rb +7 -0
- data/lib/relaton/iala/util.rb +8 -0
- data/lib/relaton/iala.rb +35 -0
- data/lib/relaton/iana/bibdata.rb +8 -0
- data/lib/relaton/iana/bibitem.rb +8 -0
- data/lib/relaton/iana/bibliography.rb +100 -0
- data/lib/relaton/iana/data_fetcher.rb +101 -0
- data/lib/relaton/iana/item.rb +7 -0
- data/lib/relaton/iana/item_data.rb +6 -0
- data/lib/relaton/iana/parser.rb +146 -0
- data/lib/relaton/iana/processor.rb +70 -0
- data/lib/relaton/iana/util.rb +8 -0
- data/lib/relaton/iana.rb +40 -0
- data/lib/relaton/iec/bibliography.rb +283 -0
- data/lib/relaton/iec/data_fetcher.rb +222 -0
- data/lib/relaton/iec/data_parser.rb +391 -0
- data/lib/relaton/iec/hit.rb +26 -0
- data/lib/relaton/iec/hit_collection.rb +138 -0
- data/lib/relaton/iec/item_data.rb +7 -0
- data/lib/relaton/iec/model/bibdata.rb +8 -0
- data/lib/relaton/iec/model/bibitem.rb +8 -0
- data/lib/relaton/iec/model/docidentifier.rb +135 -0
- data/lib/relaton/iec/model/doctype.rb +12 -0
- data/lib/relaton/iec/model/ext.rb +53 -0
- data/lib/relaton/iec/model/item.rb +20 -0
- data/lib/relaton/iec/model/item_base.rb +12 -0
- data/lib/relaton/iec/model/relation.rb +7 -0
- data/lib/relaton/iec/model/stage_name.rb +13 -0
- data/lib/relaton/iec/processor.rb +74 -0
- data/lib/relaton/iec/statuses.yml +199 -0
- data/lib/relaton/iec/util.rb +8 -0
- data/lib/relaton/iec.rb +98 -0
- data/lib/relaton/ieee/balloting_group.rb +13 -0
- data/lib/relaton/ieee/bibdata.rb +8 -0
- data/lib/relaton/ieee/bibitem.rb +8 -0
- data/lib/relaton/ieee/bibliography.rb +73 -0
- data/lib/relaton/ieee/converter/bibxml/from_rfcxml.rb +10 -0
- data/lib/relaton/ieee/converter/bibxml/from_rfcxml_referencegroup.rb +10 -0
- data/lib/relaton/ieee/converter/bibxml.rb +20 -0
- data/lib/relaton/ieee/data_fetcher.rb +771 -0
- data/lib/relaton/ieee/doctype.rb +9 -0
- data/lib/relaton/ieee/editorial_group.rb +19 -0
- data/lib/relaton/ieee/ext.rb +36 -0
- data/lib/relaton/ieee/idams_parser.rb +330 -0
- data/lib/relaton/ieee/item.rb +11 -0
- data/lib/relaton/ieee/item_data.rb +7 -0
- data/lib/relaton/ieee/processor.rb +71 -0
- data/lib/relaton/ieee/rawbib_id_parser.rb +753 -0
- data/lib/relaton/ieee/util.rb +8 -0
- data/lib/relaton/ieee.rb +30 -0
- data/lib/relaton/ietf/bibdata.rb +8 -0
- data/lib/relaton/ietf/bibitem.rb +8 -0
- data/lib/relaton/ietf/bibliography.rb +35 -0
- data/lib/relaton/ietf/bibxml_parser.rb +232 -0
- data/lib/relaton/ietf/data_fetcher.rb +561 -0
- data/lib/relaton/ietf/doctype.rb +9 -0
- data/lib/relaton/ietf/ext.rb +63 -0
- data/lib/relaton/ietf/item.rb +16 -0
- data/lib/relaton/ietf/item_base.rb +18 -0
- data/lib/relaton/ietf/item_data.rb +6 -0
- data/lib/relaton/ietf/processing_instructions.rb +79 -0
- data/lib/relaton/ietf/processor.rb +72 -0
- data/lib/relaton/ietf/relation.rb +9 -0
- data/lib/relaton/ietf/rfc/abstract.rb +19 -0
- data/lib/relaton/ietf/rfc/author.rb +21 -0
- data/lib/relaton/ietf/rfc/entry.rb +446 -0
- data/lib/relaton/ietf/rfc/entry_date.rb +21 -0
- data/lib/relaton/ietf/rfc/format.rb +19 -0
- data/lib/relaton/ietf/rfc/index.rb +46 -0
- data/lib/relaton/ietf/rfc/is_also.rb +21 -0
- data/lib/relaton/ietf/rfc/keywords.rb +19 -0
- data/lib/relaton/ietf/rfc/rfc_index_namespace.rb +11 -0
- data/lib/relaton/ietf/scraper.rb +101 -0
- data/lib/relaton/ietf/util.rb +8 -0
- data/lib/relaton/ietf/wg_name_resolver.rb +42 -0
- data/lib/relaton/ietf.rb +30 -0
- data/lib/relaton/iho/bibdata.rb +8 -0
- data/lib/relaton/iho/bibitem.rb +8 -0
- data/lib/relaton/iho/bibliography.rb +114 -0
- data/lib/relaton/iho/comment_period.rb +13 -0
- data/lib/relaton/iho/docidentifier.rb +31 -0
- data/lib/relaton/iho/doctype.rb +10 -0
- data/lib/relaton/iho/ext.rb +20 -0
- data/lib/relaton/iho/hash_parser_v1.rb +144 -0
- data/lib/relaton/iho/item.rb +20 -0
- data/lib/relaton/iho/item_base.rb +18 -0
- data/lib/relaton/iho/item_data.rb +6 -0
- data/lib/relaton/iho/processor.rb +54 -0
- data/lib/relaton/iho/relation.rb +9 -0
- data/lib/relaton/iho/structured_identifier.rb +20 -0
- data/lib/relaton/iho/util.rb +8 -0
- data/lib/relaton/iho.rb +27 -0
- data/lib/relaton/index/config.rb +52 -0
- data/lib/relaton/index/file_io.rb +305 -0
- data/lib/relaton/index/file_storage.rb +66 -0
- data/lib/relaton/index/pool.rb +46 -0
- data/lib/relaton/index/shard_source.rb +201 -0
- data/lib/relaton/index/type.rb +210 -0
- data/lib/relaton/index/util.rb +18 -0
- data/lib/relaton/index.rb +61 -0
- data/lib/relaton/isbn/isbn.rb +61 -0
- data/lib/relaton/isbn/open_library.rb +43 -0
- data/lib/relaton/isbn/parser.rb +88 -0
- data/lib/relaton/isbn/processor.rb +48 -0
- data/lib/relaton/isbn/util.rb +8 -0
- data/lib/relaton/isbn.rb +19 -0
- data/lib/relaton/iso/bibliography.rb +412 -0
- data/lib/relaton/iso/data_fetcher.rb +338 -0
- data/lib/relaton/iso/data_parser.rb +458 -0
- data/lib/relaton/iso/hash_parser_v1.rb +177 -0
- data/lib/relaton/iso/hit.rb +57 -0
- data/lib/relaton/iso/hit_collection.rb +196 -0
- data/lib/relaton/iso/item_data.rb +50 -0
- data/lib/relaton/iso/model/bibdata.rb +10 -0
- data/lib/relaton/iso/model/bibitem.rb +8 -0
- data/lib/relaton/iso/model/contributor.rb +6 -0
- data/lib/relaton/iso/model/contributor_info.rb +9 -0
- data/lib/relaton/iso/model/docidentifier.rb +146 -0
- data/lib/relaton/iso/model/doctype.rb +13 -0
- data/lib/relaton/iso/model/ext.rb +35 -0
- data/lib/relaton/iso/model/item.rb +17 -0
- data/lib/relaton/iso/model/item_base.rb +22 -0
- data/lib/relaton/iso/model/organization.rb +9 -0
- data/lib/relaton/iso/model/project_number.rb +22 -0
- data/lib/relaton/iso/model/relation.rb +9 -0
- data/lib/relaton/iso/model/stagename.rb +14 -0
- data/lib/relaton/iso/model/structured_identifier.rb +31 -0
- data/lib/relaton/iso/processor.rb +85 -0
- data/lib/relaton/iso/scraper.rb +635 -0
- data/lib/relaton/iso/type/pubid.rb +50 -0
- data/lib/relaton/iso/util.rb +8 -0
- data/lib/relaton/iso.rb +30 -0
- data/lib/relaton/itu/bibliography.rb +95 -0
- data/lib/relaton/itu/data_crawler_r.rb +664 -0
- data/lib/relaton/itu/data_fetcher.rb +550 -0
- data/lib/relaton/itu/data_merge_r.rb +149 -0
- data/lib/relaton/itu/data_parser_r.rb +214 -0
- data/lib/relaton/itu/data_parser_t.rb +228 -0
- data/lib/relaton/itu/family_cache.rb +177 -0
- data/lib/relaton/itu/governor.rb +56 -0
- data/lib/relaton/itu/hit.rb +28 -0
- data/lib/relaton/itu/hit_collection.rb +299 -0
- data/lib/relaton/itu/item_data.rb +6 -0
- data/lib/relaton/itu/model/approval_stage.rb +13 -0
- data/lib/relaton/itu/model/bibdata.rb +8 -0
- data/lib/relaton/itu/model/bibitem.rb +8 -0
- data/lib/relaton/itu/model/docidentifier.rb +75 -0
- data/lib/relaton/itu/model/doctype.rb +13 -0
- data/lib/relaton/itu/model/ext.rb +47 -0
- data/lib/relaton/itu/model/item.rb +13 -0
- data/lib/relaton/itu/model/meeting.rb +13 -0
- data/lib/relaton/itu/model/meeting_date.rb +15 -0
- data/lib/relaton/itu/model/question.rb +13 -0
- data/lib/relaton/itu/model/recommendation_status.rb +11 -0
- data/lib/relaton/itu/model/structured_identifier.rb +38 -0
- data/lib/relaton/itu/processor.rb +72 -0
- data/lib/relaton/itu/pubid.rb +199 -0
- data/lib/relaton/itu/radio_regulations_parser.rb +70 -0
- data/lib/relaton/itu/recommendation_fields.rb +334 -0
- data/lib/relaton/itu/recommendation_parser.rb +30 -0
- data/lib/relaton/itu/scraper.rb +203 -0
- data/lib/relaton/itu/util.rb +8 -0
- data/lib/relaton/itu.rb +34 -0
- data/lib/relaton/jcgm/bibdata.rb +8 -0
- data/lib/relaton/jcgm/bibitem.rb +8 -0
- data/lib/relaton/jcgm/bibliography.rb +97 -0
- data/lib/relaton/jcgm/data_fetcher.rb +81 -0
- data/lib/relaton/jcgm/docidentifier.rb +102 -0
- data/lib/relaton/jcgm/doctype.rb +12 -0
- data/lib/relaton/jcgm/ext.rb +23 -0
- data/lib/relaton/jcgm/item.rb +20 -0
- data/lib/relaton/jcgm/item_base.rb +18 -0
- data/lib/relaton/jcgm/item_data.rb +6 -0
- data/lib/relaton/jcgm/meetings_parser.rb +175 -0
- data/lib/relaton/jcgm/processor.rb +71 -0
- data/lib/relaton/jcgm/relation.rb +9 -0
- data/lib/relaton/jcgm/structured_identifier.rb +40 -0
- data/lib/relaton/jcgm/util.rb +8 -0
- data/lib/relaton/jcgm.rb +24 -0
- data/lib/relaton/jis/bibdata.rb +8 -0
- data/lib/relaton/jis/bibitem.rb +8 -0
- data/lib/relaton/jis/bibliography.rb +73 -0
- data/lib/relaton/jis/data_fetcher.rb +183 -0
- data/lib/relaton/jis/docidentifier.rb +120 -0
- data/lib/relaton/jis/doctype.rb +9 -0
- data/lib/relaton/jis/ext.rb +13 -0
- data/lib/relaton/jis/hit.rb +88 -0
- data/lib/relaton/jis/hit_collection.rb +128 -0
- data/lib/relaton/jis/item.rb +22 -0
- data/lib/relaton/jis/item_base.rb +26 -0
- data/lib/relaton/jis/item_data.rb +8 -0
- data/lib/relaton/jis/processor.rb +55 -0
- data/lib/relaton/jis/relation.rb +11 -0
- data/lib/relaton/jis/scraper.rb +232 -0
- data/lib/relaton/jis/structured_identifier.rb +13 -0
- data/lib/relaton/jis/util.rb +8 -0
- data/lib/relaton/jis.rb +32 -0
- data/lib/relaton/logger/channels/gh_issue.rb +143 -0
- data/lib/relaton/logger/config.rb +34 -0
- data/lib/relaton/logger/formatter_json.rb +8 -0
- data/lib/relaton/logger/formatter_string.rb +12 -0
- data/lib/relaton/logger/log.rb +64 -0
- data/lib/relaton/logger/log_device.rb +27 -0
- data/lib/relaton/logger/pool.rb +24 -0
- data/lib/relaton/logger.rb +18 -0
- data/lib/relaton/nist/bibdata.rb +8 -0
- data/lib/relaton/nist/bibitem.rb +8 -0
- data/lib/relaton/nist/bibliography.rb +191 -0
- data/lib/relaton/nist/comment_period.rb +15 -0
- data/lib/relaton/nist/data_fetcher.rb +134 -0
- data/lib/relaton/nist/date.rb +7 -0
- data/lib/relaton/nist/docidentifier.rb +165 -0
- data/lib/relaton/nist/doctype.rb +7 -0
- data/lib/relaton/nist/ext.rb +16 -0
- data/lib/relaton/nist/hit.rb +18 -0
- data/lib/relaton/nist/hit_collection.rb +362 -0
- data/lib/relaton/nist/item.rb +19 -0
- data/lib/relaton/nist/item_base.rb +16 -0
- data/lib/relaton/nist/item_data.rb +6 -0
- data/lib/relaton/nist/mods_parser.rb +302 -0
- data/lib/relaton/nist/processor.rb +69 -0
- data/lib/relaton/nist/pubs_export.rb +69 -0
- data/lib/relaton/nist/relation.rb +10 -0
- data/lib/relaton/nist/scraper.rb +293 -0
- data/lib/relaton/nist/series.yaml +49 -0
- data/lib/relaton/nist/util.rb +8 -0
- data/lib/relaton/nist.rb +34 -0
- data/lib/relaton/oasis/bibdata.rb +8 -0
- data/lib/relaton/oasis/bibitem.rb +8 -0
- data/lib/relaton/oasis/bibliography.rb +201 -0
- data/lib/relaton/oasis/browser_agent.rb +71 -0
- data/lib/relaton/oasis/data_fetcher.rb +130 -0
- data/lib/relaton/oasis/data_parser.rb +305 -0
- data/lib/relaton/oasis/data_parser_utils.rb +330 -0
- data/lib/relaton/oasis/data_part_parser.rb +239 -0
- data/lib/relaton/oasis/docidentifier.rb +54 -0
- data/lib/relaton/oasis/doctype.rb +7 -0
- data/lib/relaton/oasis/ext.rb +19 -0
- data/lib/relaton/oasis/item.rb +14 -0
- data/lib/relaton/oasis/item_data.rb +6 -0
- data/lib/relaton/oasis/processor.rb +74 -0
- data/lib/relaton/oasis/util.rb +8 -0
- data/lib/relaton/oasis.rb +41 -0
- data/lib/relaton/ogc/bibdata.rb +8 -0
- data/lib/relaton/ogc/bibitem.rb +8 -0
- data/lib/relaton/ogc/bibliography.rb +64 -0
- data/lib/relaton/ogc/data_fetcher.rb +131 -0
- data/lib/relaton/ogc/docidentifier.rb +111 -0
- data/lib/relaton/ogc/doctype.rb +12 -0
- data/lib/relaton/ogc/ext.rb +15 -0
- data/lib/relaton/ogc/hit.rb +18 -0
- data/lib/relaton/ogc/hit_collection.rb +111 -0
- data/lib/relaton/ogc/item.rb +13 -0
- data/lib/relaton/ogc/item_data.rb +6 -0
- data/lib/relaton/ogc/processor.rb +59 -0
- data/lib/relaton/ogc/scraper.rb +225 -0
- data/lib/relaton/ogc/util.rb +8 -0
- data/lib/relaton/ogc.rb +30 -0
- data/lib/relaton/oiml/bibdata.rb +8 -0
- data/lib/relaton/oiml/bibitem.rb +8 -0
- data/lib/relaton/oiml/bibliography.rb +169 -0
- data/lib/relaton/oiml/docidentifier.rb +48 -0
- data/lib/relaton/oiml/doctype.rb +13 -0
- data/lib/relaton/oiml/ext.rb +42 -0
- data/lib/relaton/oiml/item.rb +20 -0
- data/lib/relaton/oiml/item_base.rb +18 -0
- data/lib/relaton/oiml/item_data.rb +6 -0
- data/lib/relaton/oiml/processor.rb +54 -0
- data/lib/relaton/oiml/relation.rb +9 -0
- data/lib/relaton/oiml/util.rb +8 -0
- data/lib/relaton/oiml.rb +24 -0
- data/lib/relaton/omg/bibdata.rb +8 -0
- data/lib/relaton/omg/bibitem.rb +8 -0
- data/lib/relaton/omg/bibliography.rb +31 -0
- data/lib/relaton/omg/docidentifier.rb +67 -0
- data/lib/relaton/omg/ext.rb +7 -0
- data/lib/relaton/omg/item.rb +9 -0
- data/lib/relaton/omg/item_data.rb +6 -0
- data/lib/relaton/omg/processor.rb +35 -0
- data/lib/relaton/omg/scraper.rb +186 -0
- data/lib/relaton/omg/util.rb +8 -0
- data/lib/relaton/omg.rb +25 -0
- data/lib/relaton/plateau/bibdata.rb +8 -0
- data/lib/relaton/plateau/bibitem.rb +8 -0
- data/lib/relaton/plateau/bibliography.rb +31 -0
- data/lib/relaton/plateau/data_fetcher.rb +176 -0
- data/lib/relaton/plateau/doctype.rb +7 -0
- data/lib/relaton/plateau/ext.rb +23 -0
- data/lib/relaton/plateau/handbook_parser.rb +102 -0
- data/lib/relaton/plateau/hit.rb +21 -0
- data/lib/relaton/plateau/hit_collection.rb +79 -0
- data/lib/relaton/plateau/item.rb +12 -0
- data/lib/relaton/plateau/item_data.rb +6 -0
- data/lib/relaton/plateau/parser.rb +101 -0
- data/lib/relaton/plateau/processor.rb +51 -0
- data/lib/relaton/plateau/technical_report_parser.rb +98 -0
- data/lib/relaton/plateau/util.rb +8 -0
- data/lib/relaton/plateau.rb +29 -0
- data/lib/relaton/sdo/config.rb +34 -0
- data/lib/relaton/sdo/fetcher.rb +52 -0
- data/lib/relaton/sdo/logo.rb +95 -0
- data/lib/relaton/sdo/name.rb +26 -0
- data/lib/relaton/sdo/organization.rb +71 -0
- data/lib/relaton/sdo/store.rb +49 -0
- data/lib/relaton/sdo.rb +29 -0
- data/lib/relaton/un/bibdata.rb +8 -0
- data/lib/relaton/un/bibitem.rb +8 -0
- data/lib/relaton/un/bibliography.rb +48 -0
- data/lib/relaton/un/doctype.rb +10 -0
- data/lib/relaton/un/ext.rb +30 -0
- data/lib/relaton/un/hit.rb +56 -0
- data/lib/relaton/un/hit_collection.rb +61 -0
- data/lib/relaton/un/item.rb +11 -0
- data/lib/relaton/un/item_data.rb +6 -0
- data/lib/relaton/un/parser.rb +108 -0
- data/lib/relaton/un/processor.rb +38 -0
- data/lib/relaton/un/session.rb +25 -0
- data/lib/relaton/un/token_generator.rb +105 -0
- data/lib/relaton/un/util.rb +8 -0
- data/lib/relaton/un/wasm/decoder.rb +434 -0
- data/lib/relaton/un/wasm/instance.rb +101 -0
- data/lib/relaton/un/wasm/interpreter.rb +613 -0
- data/lib/relaton/un/wasm/memory.rb +112 -0
- data/lib/relaton/un/wasm/module.rb +47 -0
- data/lib/relaton/un/wasm.rb +17 -0
- data/lib/relaton/un/wasm_v_bg.wasm +0 -0
- data/lib/relaton/un.rb +28 -0
- data/lib/relaton/version.rb +1 -1
- data/lib/relaton/w3c/bibdata.rb +8 -0
- data/lib/relaton/w3c/bibitem.rb +8 -0
- data/lib/relaton/w3c/bibliography.rb +174 -0
- data/lib/relaton/w3c/data_fetcher.rb +487 -0
- data/lib/relaton/w3c/data_parser.rb +379 -0
- data/lib/relaton/w3c/docidentifier.rb +48 -0
- data/lib/relaton/w3c/doctype.rb +7 -0
- data/lib/relaton/w3c/ext.rb +11 -0
- data/lib/relaton/w3c/governor.rb +32 -0
- data/lib/relaton/w3c/item.rb +15 -0
- data/lib/relaton/w3c/item_data.rb +6 -0
- data/lib/relaton/w3c/processor.rb +49 -0
- data/lib/relaton/w3c/pubid.rb +85 -0
- data/lib/relaton/w3c/safe_realize.rb +148 -0
- data/lib/relaton/w3c/util.rb +8 -0
- data/lib/relaton/w3c.rb +36 -0
- data/lib/relaton/xsf/bibdata.rb +8 -0
- data/lib/relaton/xsf/bibitem.rb +8 -0
- data/lib/relaton/xsf/bibliography.rb +84 -0
- data/lib/relaton/xsf/data_fetcher.rb +106 -0
- data/lib/relaton/xsf/docidentifier.rb +46 -0
- data/lib/relaton/xsf/hit.rb +17 -0
- data/lib/relaton/xsf/hit_collection.rb +52 -0
- data/lib/relaton/xsf/item.rb +13 -0
- data/lib/relaton/xsf/item_data.rb +6 -0
- data/lib/relaton/xsf/processor.rb +51 -0
- data/lib/relaton/xsf/util.rb +9 -0
- data/lib/relaton/xsf.rb +34 -0
- data/lib/relaton-core.rb +1 -0
- data/lib/relaton.rb +85 -0
- metadata +775 -161
- data/.github/workflows/rake.yml +0 -14
- data/.github/workflows/release.yml +0 -24
- data/.github/workflows/rubocop.yml +0 -48
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/CLAUDE.md +0 -78
- data/Gemfile +0 -29
- data/Rakefile +0 -6
- data/docs/CHANGELOG.adoc +0 -16
- data/docs/VERSIONING_POLICY.adoc +0 -38
- data/docs/navigation.adoc +0 -6
- data/lib/relaton/db/version.rb +0 -5
- data/relaton.gemspec +0 -72
- data/spec/relaton/config_spec.rb +0 -10
- data/spec/relaton/db_cache_spec.rb +0 -51
- data/spec/relaton/db_spec.rb +0 -567
- data/spec/relaton/registry_spec.rb +0 -178
- data/spec/relaton/util_spec.rb +0 -3
- data/spec/relaton_meta_spec.rb +0 -25
- data/spec/relaton_spec.rb +0 -800
- data/spec/spec_helper.rb +0 -45
- data/spec/support/gb_t_20223_2006.xml +0 -33
- data/spec/support/iso_111111119115_1.xml +0 -0
- data/spec/support/iso_19115_1.xml +0 -115
- data/spec/support/iso_19115_2.xml +0 -95
- data/spec/support/rfc_8341.xml +0 -46
- data/spec/vcr_cassetes/api_relaton_org.yml +0 -121
- data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +0 -140
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +0 -202
- data/spec/vcr_cassetes/cipm_meeting_43.yml +0 -1505
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +0 -729
- data/spec/vcr_cassetes/iso_111111119115_1.yml +0 -12951
- data/spec/vcr_cassetes/iso_19115_1.yml +0 -17334
- data/spec/vcr_cassetes/iso_19115_1_2.yml +0 -322
- data/spec/vcr_cassetes/iso_19115_1_std.yml +0 -17334
- data/spec/vcr_cassetes/iso_19115_all_parts.yml +0 -185
- data/spec/vcr_cassetes/iso_19133_2005.yml +0 -144
- data/spec/vcr_cassetes/iso_combined_applied.yml +0 -318
- data/spec/vcr_cassetes/iso_combined_included.yml +0 -318
- data/spec/vcr_cassetes/ogc_19_025r1.yml +0 -374
- data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +0 -317
- data/spec/vcr_cassetes/rfc_8341.yml +0 -1278
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Cen
|
|
5
|
+
# Class methods for search Cenelec standards.
|
|
6
|
+
class Bibliography
|
|
7
|
+
class << self
|
|
8
|
+
# @param text [String]
|
|
9
|
+
# @return [Relaton::Cen::HitCollection]
|
|
10
|
+
def search(text, year = nil)
|
|
11
|
+
HitCollection.new(text, year).search
|
|
12
|
+
rescue Mechanize::ResponseCodeError, Net::ReadTimeout => e
|
|
13
|
+
raise Relaton::RequestError, e.message
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Parses a printed CEN/CENELEC reference.
|
|
18
|
+
#
|
|
19
|
+
# Deliberately does NOT rescue. An unrecognized query reference must
|
|
20
|
+
# raise, so that relaton-cli can print `"…" is not a recognized
|
|
21
|
+
# standards identifier`; returning nil would make "malformed" look like
|
|
22
|
+
# "not found". Only the DATA side rescues — see `Hit#pubid`, which
|
|
23
|
+
# drops a catalogue code the grammar cannot read (`prEN 13306 rev`).
|
|
24
|
+
#
|
|
25
|
+
# @param ref [String] a printed reference, e.g. "EN 285:2015+A1"
|
|
26
|
+
#
|
|
27
|
+
# @return [Pubid::CenCenelec::Identifier]
|
|
28
|
+
# @raise [Pubid::Errors::ParseError]
|
|
29
|
+
#
|
|
30
|
+
def parse(ref)
|
|
31
|
+
::Pubid::CenCenelec::Identifier.parse ref
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
#
|
|
35
|
+
# @param code [String] the CEN standard Code to look up
|
|
36
|
+
# @param year [String] the year the standard was published (optional)
|
|
37
|
+
# @param opts [Hash] options
|
|
38
|
+
# @option opts [Boolean] :keep_year don't upate reference
|
|
39
|
+
#
|
|
40
|
+
# @return [Relaton::Cen::ItemData, nil]
|
|
41
|
+
#
|
|
42
|
+
def get(code, year = nil, opts = {})
|
|
43
|
+
# An empty string is no reference, not a malformed one, so it stays a
|
|
44
|
+
# plain nil rather than a parse failure. Mirrors the guard
|
|
45
|
+
# HitCollection#search already carries.
|
|
46
|
+
return if code.nil? || code.strip.empty?
|
|
47
|
+
|
|
48
|
+
query = parse code
|
|
49
|
+
year ||= publication_year query
|
|
50
|
+
|
|
51
|
+
bib_get code, year, opts, query
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
#
|
|
57
|
+
# The year of the document the reference names: the base document's
|
|
58
|
+
# year for a supplement, and the adopted document's year for an adopted
|
|
59
|
+
# norm (an `AdoptedEuropeanNorm` carries no year of its own, so `#root`
|
|
60
|
+
# is the accessor that answers for every form).
|
|
61
|
+
#
|
|
62
|
+
# @param id [Pubid::CenCenelec::Identifier]
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
#
|
|
66
|
+
def publication_year(id)
|
|
67
|
+
id.root.year&.to_s
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# A component is absent from a reference when excluding it changes
|
|
71
|
+
# nothing. This replaces the old capture-group tests, and works for the
|
|
72
|
+
# forms that hold the component on a nested identifier (an adopted norm
|
|
73
|
+
# keeps its part on the adopted ISO document).
|
|
74
|
+
#
|
|
75
|
+
# @return [Boolean]
|
|
76
|
+
def absent?(id, *keys)
|
|
77
|
+
id.exclude(*keys) == id
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def fetch_ref_err(_code, year, missed_years)
|
|
81
|
+
unless missed_years.empty?
|
|
82
|
+
Util.info "There was no match for `#{year}`, though there " \
|
|
83
|
+
"were matches found for `#{missed_years.join('`, `')}`."
|
|
84
|
+
end
|
|
85
|
+
nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
#
|
|
89
|
+
# Selects the portal hits that denote the same document as the query.
|
|
90
|
+
#
|
|
91
|
+
# The search text stays the caller's raw reference — that is
|
|
92
|
+
# search-engine input, not identifier parsing — while the SELECTION is
|
|
93
|
+
# pubid's. A hit whose code the grammar cannot read is dropped rather
|
|
94
|
+
# than aborting the search.
|
|
95
|
+
#
|
|
96
|
+
# The selection is pubid's subset match `query === hit.pubid`. A part,
|
|
97
|
+
# a year or a supplement year that the query omits matches any value.
|
|
98
|
+
# pubid declares the CEN `type`, `stage` and `typed_stage` strict, so
|
|
99
|
+
# `EN 1325` matches neither `prEN 1325` nor `CEN/TS 1325`. The class
|
|
100
|
+
# must be identical, so a base reference never answers with its own
|
|
101
|
+
# amendment's record, and a supplement reference never answers with
|
|
102
|
+
# its base document.
|
|
103
|
+
#
|
|
104
|
+
# @param code [String] the raw reference, as the portal form wants it
|
|
105
|
+
# @param query [Pubid::CenCenelec::Identifier]
|
|
106
|
+
#
|
|
107
|
+
# @return [Relaton::Cen::HitCollection]
|
|
108
|
+
#
|
|
109
|
+
def search_filter(code, query)
|
|
110
|
+
search(code).select! { |hit| hit.pubid && query === hit.pubid }
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Sort through the results from Isobib, fetching them three at a time,
|
|
114
|
+
# and return the first result that matches the code,
|
|
115
|
+
# matches the year (if provided), and which # has a title (amendments do not).
|
|
116
|
+
# Only expects the first page of results to be populated.
|
|
117
|
+
# If no match, returns any years which caused mismatch, for error reporting
|
|
118
|
+
def isobib_results_filter(result, year)
|
|
119
|
+
missed_years = []
|
|
120
|
+
result.each do |r|
|
|
121
|
+
pyear = r.pubid && publication_year(r.pubid)
|
|
122
|
+
if !year || year == pyear
|
|
123
|
+
ret = r.item
|
|
124
|
+
return { ret: ret } if ret
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
missed_years << pyear
|
|
128
|
+
end
|
|
129
|
+
{ years: missed_years }
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def bib_get(code, year, opts, query) # rubocop:disable Metrics/MethodLength
|
|
133
|
+
ref = year && absent?(query, :year) ? "#{code}:#{year}" : code
|
|
134
|
+
Util.info "Fetching from standards.cencenelec.eu ...", key: ref
|
|
135
|
+
result = search_filter(code, query)
|
|
136
|
+
ret = isobib_results_filter(result, year)
|
|
137
|
+
if ret[:ret]
|
|
138
|
+
bib = year || opts[:keep_year] ? ret[:ret] : ret[:ret].to_most_recent_reference
|
|
139
|
+
Util.info "Found: `#{bib.docidentifier.first&.content}`", key: ref
|
|
140
|
+
bib
|
|
141
|
+
else
|
|
142
|
+
Util.info "Not found.", key: ref
|
|
143
|
+
fetch_ref_err(code, year, ret[:years])
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
ASD-STAN: Aerospace
|
|
2
|
+
CEN/CLC/ETSI/SMCG: CEN-CENELEC-ETSI Coordination Group on Smart Meters
|
|
3
|
+
CEN/CLC/ETSI/JWG eAcc: eAccessibility
|
|
4
|
+
CEN/CLC/ETSI/SEG-CG: CEN-CENELEC-ETSI Coordination Group on Smart Grids
|
|
5
|
+
CEN/CLC/ETSI/SF-SSCC: CEN-CENELEC-ETSI Sector Forum on Smart and Sustainable Cities and Communities
|
|
6
|
+
CEN/CLC/Guides: Group for CEN-CENELEC Guides
|
|
7
|
+
CEN/CLC/JTC 1: Criteria for conformity assessment bodies
|
|
8
|
+
CEN/CLC/JTC 2: Power Engineering
|
|
9
|
+
CEN/CLC/JTC 3: Quality management and corresponding general aspects for medical devices
|
|
10
|
+
CEN/CLC/JTC 4: Services for fire safety and security systems
|
|
11
|
+
CEN/CLC/JTC 5: Space
|
|
12
|
+
CEN/CLC/JTC 6: Hydrogen in energy systems
|
|
13
|
+
CEN/CLC/JTC 10: Energy-related products - Material Efficiency Aspects for Ecodesign
|
|
14
|
+
CEN/CLC/JTC 11: Accessibility in the built environment
|
|
15
|
+
CEN/CLC/JTC 12: Design for All
|
|
16
|
+
CEN/CLC/JTC 13: Cybersecurity and Data Protection
|
|
17
|
+
CEN/CLC/JTC 14: Energy management and energy efficiency in the framework of energy transition
|
|
18
|
+
CEN/CLC/JTC 15: Energy measurement plan for organizations
|
|
19
|
+
CEN/CLC/JTC 16: CEN/CENELEC Joint Technical Committee on Active Implantable Medical Devices
|
|
20
|
+
CEN/CLC/JTC 17: Gas Appliances with Combined Heat and Power
|
|
21
|
+
CEN/CLC/JTC 18: Non automatic weighing instruments (NAWI)
|
|
22
|
+
CEN/CLC/JTC 19: Blockchain and Distributed Ledger Technologies
|
|
23
|
+
CEN/CLC/JTC 20: Hyperloop systems
|
|
24
|
+
CEN/CLC/JTC 21: Artificial Intelligence
|
|
25
|
+
CEN/CLC/WS 017: Development of a GALILEO enabled label
|
|
26
|
+
CEN/CLC/WS 018: Assessment of the resilience of transport infrastructure to potentially disruptive events
|
|
27
|
+
CEN/CLC/WS SEA-TITAN: Modular and cross-cutting Power Take-Off units for wave energy converters. Recommendations and laboratory testing
|
|
28
|
+
CEN/CLC/WS SEP2: Industry Best Practices and an Industry Code of Conduct for Licensing of Standard Essential Patents in the field of 5G and Internet of Things
|
|
29
|
+
CEN/CLC/WS HECTOS: CEN-CENELEC Workshop on Guidelines on evaluation systems and schemes for physical security products
|
|
30
|
+
CEN/CLC/WS INACHUS: Urban search and rescue (USaR) robotic platform technical and procedural interoperability
|
|
31
|
+
CEN/CLC/WS Monsoon: Predictive management of data intensive industrial processes
|
|
32
|
+
CEN/CLC/WS REEMAIN: CEN/CENELEC Workshop on REEMAIN Methodology for Resource and Energy Efficiency Manufacturing
|
|
33
|
+
CEN/CLC/WS SEP-IoT: Workshop on Best Practices and a Code of Conduct for Licensing Industry Standard Essential Patents in 5G and the Internet of Things (IoT), including the Industrial Internet
|
|
34
|
+
CEN/CLC/WS ZONeSEC: Interoperability of security systems for the surveillance of widezones
|
|
35
|
+
CEN/CLC/WS EINSTEIN: Good Practice Thermal Energy Audits (GPTEA)
|
|
36
|
+
CEN/CLC/WS WiseGRID: Reference model for distribution application for microgrids
|
|
37
|
+
CEN/CLC/WS EFPFInterOp: European Connected Factory Platform for Agile Manufacturing Interoperability
|
|
38
|
+
CEN/CLC/WS ZDMterm: Zero Defects in Digital Manufacturing Terminology
|
|
39
|
+
CEN/SS C20: Explosives and firework
|
|
40
|
+
CEN/SS S08: Air quality
|
|
41
|
+
CEN/SS S12: Gas analysis
|
|
42
|
+
CEN/Guides: Group for CEN Guides
|
|
43
|
+
CEN/SS A03: Postal services
|
|
44
|
+
CEN/SS A07: Translation and Interpretation services
|
|
45
|
+
CEN/SS A08: Funeral services
|
|
46
|
+
CEN/SS A10: Services of Real Estate Agents
|
|
47
|
+
CEN/SS A11: Security services
|
|
48
|
+
CEN/SS A99: Services - Undetermined
|
|
49
|
+
CEN/SS B02: Structures
|
|
50
|
+
CEN/SS B09: Energy Performance of Buildings Directive (EPBD)
|
|
51
|
+
CEN/SS B99: Building and construction - Undetermined
|
|
52
|
+
CEN/SS C01: Food Products
|
|
53
|
+
CEN/SS C10: Starch
|
|
54
|
+
CEN/SS F01: Technical drawings
|
|
55
|
+
CEN/SS F02: Units and symbols
|
|
56
|
+
CEN/SS F05: Measuring Instruments
|
|
57
|
+
CEN/SS F12: Information Processing Systems
|
|
58
|
+
CEN/SS F16: Graphical symbols
|
|
59
|
+
CEN/SS F17: Administrative documents
|
|
60
|
+
CEN/SS F20: Quality assurance
|
|
61
|
+
CEN/SS F23: Energy
|
|
62
|
+
CEN/SS H10: Sewing machines
|
|
63
|
+
CEN/SS H22: Smokers' lighters
|
|
64
|
+
CEN/SS H99: Products for household and leisure use - Undetermined
|
|
65
|
+
|
|
66
|
+
TC 459: ECISS - European Committee for Iron and Steel Standardization
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Cen
|
|
5
|
+
# Hit.
|
|
6
|
+
class Hit < Relaton::Core::Hit
|
|
7
|
+
attr_writer :item
|
|
8
|
+
|
|
9
|
+
# Parse page.
|
|
10
|
+
# @return [Relaton::Cen::ItemData]
|
|
11
|
+
def item
|
|
12
|
+
@fetch ||= Scraper.parse_page self
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The hit's code parsed with pubid, memoized because the filter, the sort
|
|
16
|
+
# and the scraper all read it. `nil` when pubid cannot parse the code: the
|
|
17
|
+
# portal lists draft revisions such as `prEN 13306 rev`, and one such row
|
|
18
|
+
# must not abort the search. (A malformed *query* raises; see
|
|
19
|
+
# `Bibliography.parse`.)
|
|
20
|
+
#
|
|
21
|
+
# @return [Pubid::CenCenelec::Identifier, nil]
|
|
22
|
+
def pubid
|
|
23
|
+
return @pubid if defined?(@pubid)
|
|
24
|
+
|
|
25
|
+
@pubid = Bibliography.parse hit[:code]
|
|
26
|
+
rescue StandardError
|
|
27
|
+
@pubid = nil
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Cen
|
|
5
|
+
# Page of hit collection.
|
|
6
|
+
class HitCollection < Relaton::Core::HitCollection
|
|
7
|
+
DOMAIN = "https://standards.cencenelec.eu"
|
|
8
|
+
|
|
9
|
+
# @param ref [String]
|
|
10
|
+
# @param year [String]
|
|
11
|
+
# def initialize(ref, year = nil) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
|
12
|
+
# super ref, year
|
|
13
|
+
def search
|
|
14
|
+
if !ref || ref.empty?
|
|
15
|
+
@array = []
|
|
16
|
+
return self
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
redirect_page = agent.get DOMAIN
|
|
20
|
+
redirect_url = redirect_page.body.slice(/(?<=follow the <a href=')#{DOMAIN}[^']+/)
|
|
21
|
+
search_page = agent.get redirect_url
|
|
22
|
+
form = search_page.form_with(id: "wwvFlowForm")
|
|
23
|
+
ref_field = form.field_with(id: "STAND_REF")
|
|
24
|
+
ref_field.value = ref
|
|
25
|
+
resp = agent.submit form
|
|
26
|
+
@array = hits resp
|
|
27
|
+
sort
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def agent
|
|
31
|
+
@agent ||= Mechanize.new.tap { |a| a.user_agent_alias = "Mac Safari" }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def select!(&block)
|
|
35
|
+
@array.select!(&block)
|
|
36
|
+
self
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def sort
|
|
42
|
+
@array.sort_by! { |hit| sort_key hit }
|
|
43
|
+
self
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
#
|
|
47
|
+
# The order the `code_to_parts` comparison gave, read from pubid instead:
|
|
48
|
+
# the document family ascending, then the part ascending with a part-less
|
|
49
|
+
# hit first, then the year DESCENDING with a year-less hit last, then the
|
|
50
|
+
# supplement, so a base document precedes its own amendments and
|
|
51
|
+
# corrigenda. A hit pubid cannot parse sorts last.
|
|
52
|
+
#
|
|
53
|
+
# `#root` is the accessor that answers for every form: an adopted norm
|
|
54
|
+
# keeps its number, part and year on the adopted ISO document.
|
|
55
|
+
#
|
|
56
|
+
# @param hit [Relaton::Cen::Hit]
|
|
57
|
+
#
|
|
58
|
+
# @return [Array]
|
|
59
|
+
#
|
|
60
|
+
def sort_key(hit)
|
|
61
|
+
id = hit.pubid
|
|
62
|
+
return [1, "", [], 0, ["", "", ""]] unless id
|
|
63
|
+
|
|
64
|
+
root = id.root
|
|
65
|
+
[0, family(id), part_segments(root), -root.year.to_s.to_i,
|
|
66
|
+
supplement_key(id)]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# The document family: the base document with its part and year dropped,
|
|
70
|
+
# e.g. `EN 13250:2000/A1:2005` -> `EN 13250`. Read from the base document
|
|
71
|
+
# rather than from `#root`, so that `EN ISO 1234` and `CEN ISO/TS 1234`
|
|
72
|
+
# stay apart.
|
|
73
|
+
def family(id)
|
|
74
|
+
id.base_document.exclude(:year, :part, :subpart).to_s
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Part segments as integers, so `-10` sorts after `-2`. pubid holds a
|
|
78
|
+
# sub-part inside `part` (`61375-2-3` gives `"2-3"`).
|
|
79
|
+
def part_segments(root)
|
|
80
|
+
root.part.to_s.split("-").map(&:to_i)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def supplement_key(id)
|
|
84
|
+
sup = supplements(id).first
|
|
85
|
+
return ["", "", ""] unless sup
|
|
86
|
+
|
|
87
|
+
[sup.supplement_type.to_s, sup.number.to_s, sup.year.to_s]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# A consolidated identifier (`EN 285:2015+A1:2021`) holds its base
|
|
91
|
+
# document and its supplements in `#identifiers`, and answers none of the
|
|
92
|
+
# supplement accessors itself; an amendment or corrigendum IS the
|
|
93
|
+
# supplement.
|
|
94
|
+
def supplements(id)
|
|
95
|
+
if id.respond_to? :identifiers
|
|
96
|
+
id.identifiers.drop(1)
|
|
97
|
+
elsif id.respond_to? :supplement_type
|
|
98
|
+
[id]
|
|
99
|
+
else
|
|
100
|
+
[]
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @param resp [Mechanize::Page]
|
|
105
|
+
# @return [Array<RelatonCen::Hit>]
|
|
106
|
+
def hits(resp)
|
|
107
|
+
resp.xpath("//table[@class='dashlist']/tbody/tr/td[2]").map do |h|
|
|
108
|
+
ref = h.at("strong/a")
|
|
109
|
+
code = ref.text.strip
|
|
110
|
+
url = ref[:href]
|
|
111
|
+
Hit.new({ code: code, url: url }, self)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module Cen
|
|
3
|
+
# A CEN/CENELEC document identifier backed by `Pubid::CenCenelec`.
|
|
4
|
+
#
|
|
5
|
+
# `content` stays a plain string, so serialization is unchanged; the parsed
|
|
6
|
+
# identifier lives beside it in `@pubid` and drives the three mutators.
|
|
7
|
+
# Follows the IALA shape (`lib/relaton/iala/docidentifier.rb`), which
|
|
8
|
+
# `lib/relaton/bib/model/docidentifier.rb` names as the reference. CEN has
|
|
9
|
+
# no relaton-iso dependency, so BSI's `Iso::Type::Pubid` lutaml type does
|
|
10
|
+
# not fit here.
|
|
11
|
+
class Docidentifier < Bib::Docidentifier
|
|
12
|
+
# @return [Pubid::CenCenelec::Identifier, nil] nil when the content is
|
|
13
|
+
# not a CEN identifier, or the grammar cannot read it
|
|
14
|
+
attr_reader :pubid
|
|
15
|
+
|
|
16
|
+
# Capture the inherited (LocalizedMarkedUpString) content setter before
|
|
17
|
+
# overriding #content=, so #refresh_content! writes the re-rendered string
|
|
18
|
+
# back WITHOUT re-parsing it and discarding the mutation.
|
|
19
|
+
alias_method :store_content, :content=
|
|
20
|
+
|
|
21
|
+
def content=(value)
|
|
22
|
+
super
|
|
23
|
+
return unless value
|
|
24
|
+
|
|
25
|
+
@pubid = begin
|
|
26
|
+
# `pubid` is required lazily because deserialization reaches this
|
|
27
|
+
# class without the flavor entry file having been loaded. LoadError
|
|
28
|
+
# degrades to a plain string; StandardError covers a non-CEN value
|
|
29
|
+
# (an ISBN) and a code the grammar rejects (`prEN 13306 rev`), both
|
|
30
|
+
# of which are DATA and must not raise. A malformed *query* raises —
|
|
31
|
+
# see Bibliography.parse.
|
|
32
|
+
require "pubid"
|
|
33
|
+
::Pubid::CenCenelec::Identifier.parse(value)
|
|
34
|
+
rescue LoadError, StandardError
|
|
35
|
+
nil
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Drops the LAST year, and only that one.
|
|
40
|
+
#
|
|
41
|
+
# On a supplement the identifier names the supplement, so its own year is
|
|
42
|
+
# the last one: `EN 13250:2000/A1:2005` is amendment A1 of 2005, and the
|
|
43
|
+
# `2000` belongs to the base document it amends. Excluding that base year
|
|
44
|
+
# would strip the base document's identity rather than a date. Where there
|
|
45
|
+
# is no supplement year the document's own year is the base year.
|
|
46
|
+
#
|
|
47
|
+
# This also closes a case the old `/:\d{4}$/` regex missed:
|
|
48
|
+
# `EN 61375-2-3:2015/AC:2016-11` does not end in a bare year, so the regex
|
|
49
|
+
# stripped nothing, while `exclude(:supplement_year)` resets the
|
|
50
|
+
# supplement's year and month together.
|
|
51
|
+
def remove_date!
|
|
52
|
+
return unless @pubid
|
|
53
|
+
|
|
54
|
+
stripped = @pubid.exclude(:supplement_year)
|
|
55
|
+
stripped = @pubid.exclude(:year) if stripped == @pubid
|
|
56
|
+
replace_pubid stripped
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def remove_part!
|
|
60
|
+
return unless @pubid
|
|
61
|
+
|
|
62
|
+
replace_pubid @pubid.exclude(:part, :subpart)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Strips the part and the date, then wraps `@pubid` in pubid's `AllParts`.
|
|
66
|
+
#
|
|
67
|
+
# `content` stays the plain part-and-date-stripped string —
|
|
68
|
+
# `Pubid::CenCenelec::Renderer` has no "(all parts)" marker of its own,
|
|
69
|
+
# and `content` is cached from the pre-wrap pubid on purpose (see
|
|
70
|
+
# below). `#pubid` itself, read directly, now answers
|
|
71
|
+
# `all_parts? == true` and renders WITH pubid's own generic marker
|
|
72
|
+
# (`#to_s`), since it's the wrapper. Same trade-off as
|
|
73
|
+
# `Relaton::Bsi::Docidentifier` and `Relaton::Iala::Docidentifier`.
|
|
74
|
+
def to_all_parts!
|
|
75
|
+
return if !@pubid || @pubid.all_parts?
|
|
76
|
+
|
|
77
|
+
# `#exclude` (no args) rebuilds a full independent copy. `remove_part!`
|
|
78
|
+
# / `remove_date!` happen to replace `@pubid` rather than mutate it in
|
|
79
|
+
# place here, but this stays correct even if that changes.
|
|
80
|
+
original = @pubid.exclude
|
|
81
|
+
remove_part!
|
|
82
|
+
remove_date!
|
|
83
|
+
@pubid = original.to_all_parts
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
private
|
|
87
|
+
|
|
88
|
+
# `Pubid#exclude` returns a COPY (the BSI shape), so the new identifier
|
|
89
|
+
# replaces the old one; it does not mutate in place as IALA's setters do.
|
|
90
|
+
def replace_pubid(new_pubid)
|
|
91
|
+
@pubid = new_pubid
|
|
92
|
+
refresh_content!
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def refresh_content!
|
|
96
|
+
store_content(@pubid.to_s) if @pubid
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require_relative "structured_identifier"
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Cen
|
|
5
|
+
class Ext < Bib::Ext
|
|
6
|
+
attribute :structuredidentifier, StructuredIdentifier, collection: true, initialize_empty: true
|
|
7
|
+
|
|
8
|
+
def get_schema_version = Relaton.schema_versions["relaton-model-cen"]
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require_relative "../item_data"
|
|
2
|
+
require_relative "docidentifier"
|
|
3
|
+
require_relative "ext"
|
|
4
|
+
|
|
5
|
+
module Relaton
|
|
6
|
+
module Cen
|
|
7
|
+
class Item < Bib::Item
|
|
8
|
+
model ItemData
|
|
9
|
+
|
|
10
|
+
attribute :docidentifier, Docidentifier, collection: true, initialize_empty: true
|
|
11
|
+
attribute :ext, Ext
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
require "relaton/core/processor"
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Cen
|
|
5
|
+
class Processor < Relaton::Core::Processor
|
|
6
|
+
def initialize # rubocop:disable Lint/MissingSuper
|
|
7
|
+
@short = :relaton_cen
|
|
8
|
+
@prefix = "CEN"
|
|
9
|
+
@pubid_flavor = :CenCenelec # global prefixes from Pubid::CenCenelec.prefixes
|
|
10
|
+
@defaultprefix = %r{^(C?EN|ENV|CWA|HD|CR)[\s/]}
|
|
11
|
+
@idtype = "CEN"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# @param code [String]
|
|
15
|
+
# @param date [String, NilClass] year
|
|
16
|
+
# @param opts [Hash]
|
|
17
|
+
# @return [Relaton::Cen::ItemData]
|
|
18
|
+
def get(code, date, opts)
|
|
19
|
+
require_relative "../cen"
|
|
20
|
+
::Relaton::Cen::Bibliography.get(code, date, opts)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @param xml [String]
|
|
24
|
+
# @return [Relaton::Cen::ItemData]
|
|
25
|
+
def from_xml(xml)
|
|
26
|
+
require_relative "../cen"
|
|
27
|
+
::Relaton::Cen::Item.from_xml xml
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @param yaml [String]
|
|
31
|
+
# @return [Relaton::Cen::ItemData]
|
|
32
|
+
def from_yaml(yaml)
|
|
33
|
+
require_relative "../cen"
|
|
34
|
+
::Relaton::Cen::Item.from_yaml yaml
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns hash of XML grammar
|
|
38
|
+
# @return [String]
|
|
39
|
+
def grammar_hash
|
|
40
|
+
require_relative "../cen"
|
|
41
|
+
@grammar_hash ||= ::Relaton::Cen.grammar_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|