relaton 2.2.0.pre.alpha.1 → 3.0.0.pre.alpha.1
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} +109 -38
- data/lib/relaton/3gpp/bibdata.rb +9 -0
- data/lib/relaton/3gpp/bibitem.rb +9 -0
- data/lib/relaton/3gpp/bibliography.rb +48 -0
- data/lib/relaton/3gpp/data_fetcher.rb +255 -0
- data/lib/relaton/3gpp/doctype.rb +9 -0
- data/lib/relaton/3gpp/ext.rb +31 -0
- data/lib/relaton/3gpp/item.rb +12 -0
- data/lib/relaton/3gpp/item_data.rb +15 -0
- data/lib/relaton/3gpp/parser.rb +400 -0
- data/lib/relaton/3gpp/processor.rb +68 -0
- data/lib/relaton/3gpp/release.rb +34 -0
- data/lib/relaton/3gpp/util.rb +8 -0
- data/lib/relaton/3gpp.rb +25 -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 +34 -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 +48 -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 +68 -0
- data/lib/relaton/bib/util.rb +18 -0
- data/lib/relaton/bib/versions.json +35 -0
- data/lib/relaton/bib.rb +48 -0
- data/lib/relaton/bipm/bibliography.rb +82 -0
- data/lib/relaton/bipm/converter/asciibib.rb +64 -0
- data/lib/relaton/bipm/data_fetcher.rb +57 -0
- data/lib/relaton/bipm/data_outcomes_parser.rb +657 -0
- data/lib/relaton/bipm/id_parser.rb +277 -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 +15 -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 +174 -0
- data/lib/relaton/bipm/rawdata_bipm_metrologia/niso_jats_parser.rb +353 -0
- data/lib/relaton/bipm/si_brochure_parser.rb +186 -0
- data/lib/relaton/bipm/util.rb +8 -0
- data/lib/relaton/bipm.rb +32 -0
- data/lib/relaton/bsi/bibliography.rb +124 -0
- data/lib/relaton/bsi/hit.rb +14 -0
- data/lib/relaton/bsi/hit_collection.rb +114 -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 +9 -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 +42 -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 +95 -0
- data/lib/relaton/calconnect/data_fetcher.rb +106 -0
- data/lib/relaton/calconnect/hit.rb +14 -0
- data/lib/relaton/calconnect/hit_collection.rb +84 -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 +13 -0
- data/lib/relaton/calconnect/processor.rb +66 -0
- data/lib/relaton/calconnect/scraper.rb +87 -0
- data/lib/relaton/calconnect/util.rb +8 -0
- data/lib/relaton/calconnect.rb +26 -0
- data/lib/relaton/ccsds/bibliography.rb +63 -0
- data/lib/relaton/ccsds/data/fetcher.rb +247 -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 +42 -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/doctype.rb +9 -0
- data/lib/relaton/ccsds/model/ext.rb +19 -0
- data/lib/relaton/ccsds/model/item.rb +13 -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 +121 -0
- data/lib/relaton/cen/committees.yaml +66 -0
- data/lib/relaton/cen/hit.rb +16 -0
- data/lib/relaton/cen/hit_collection.rb +68 -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 +9 -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 +40 -0
- data/lib/relaton/cen/scraper.rb +210 -0
- data/lib/relaton/cen/util.rb +8 -0
- data/lib/relaton/cen.rb +29 -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 +355 -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 +66 -0
- data/lib/relaton/cie/scrapper.rb +39 -0
- data/lib/relaton/cie/util.rb +8 -0
- data/lib/relaton/cie.rb +28 -0
- data/lib/relaton/core/array_wrapper.rb +20 -0
- data/lib/relaton/core/data_fetcher.rb +97 -0
- data/lib/relaton/core/date_parser.rb +42 -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/processor.rb +48 -0
- data/lib/relaton/core/workers_pool.rb +45 -0
- data/lib/relaton/core.rb +9 -0
- data/lib/relaton/db/registry.rb +4 -4
- data/lib/relaton/db.rb +0 -1
- data/lib/relaton/doi/crossref.rb +72 -0
- data/lib/relaton/doi/parser.rb +827 -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/ecma/bibdata.rb +8 -0
- data/lib/relaton/ecma/bibitem.rb +8 -0
- data/lib/relaton/ecma/bibliography.rb +81 -0
- data/lib/relaton/ecma/data_fetcher.rb +103 -0
- data/lib/relaton/ecma/data_parser.rb +49 -0
- data/lib/relaton/ecma/edition_parser.rb +80 -0
- data/lib/relaton/ecma/ext.rb +7 -0
- data/lib/relaton/ecma/item.rb +11 -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 +27 -0
- data/lib/relaton/ecma/parser_common.rb +33 -0
- data/lib/relaton/ecma/processor.rb +66 -0
- data/lib/relaton/ecma/standard_parser.rb +134 -0
- data/lib/relaton/ecma/util.rb +8 -0
- data/lib/relaton/ecma.rb +24 -0
- data/lib/relaton/etsi/bibdata.rb +10 -0
- data/lib/relaton/etsi/bibitem.rb +10 -0
- data/lib/relaton/etsi/bibliography.rb +46 -0
- data/lib/relaton/etsi/data_fetcher.rb +128 -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 +69 -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 +25 -0
- data/lib/relaton/gb/bibdata.rb +8 -0
- data/lib/relaton/gb/bibitem.rb +8 -0
- data/lib/relaton/gb/bibliography.rb +145 -0
- data/lib/relaton/gb/ccs.rb +14 -0
- data/lib/relaton/gb/committee.rb +13 -0
- data/lib/relaton/gb/docidentifier.rb +23 -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 +46 -0
- data/lib/relaton/gb/project_number.rb +38 -0
- data/lib/relaton/gb/scraper.rb +204 -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/iana/bibdata.rb +8 -0
- data/lib/relaton/iana/bibitem.rb +8 -0
- data/lib/relaton/iana/bibliography.rb +47 -0
- data/lib/relaton/iana/data_fetcher.rb +71 -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 +68 -0
- data/lib/relaton/iana/util.rb +8 -0
- data/lib/relaton/iana.rb +29 -0
- data/lib/relaton/iec/bibliography.rb +283 -0
- data/lib/relaton/iec/data_fetcher.rb +216 -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 +131 -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 +73 -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 +51 -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 +630 -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 +323 -0
- data/lib/relaton/ieee/item.rb +11 -0
- data/lib/relaton/ieee/item_data.rb +7 -0
- data/lib/relaton/ieee/processor.rb +68 -0
- data/lib/relaton/ieee/pub_id.rb +161 -0
- data/lib/relaton/ieee/rawbib_id_parser.rb +548 -0
- data/lib/relaton/ieee/util.rb +8 -0
- data/lib/relaton/ieee.rb +29 -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 +278 -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 +68 -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 +410 -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 +68 -0
- data/lib/relaton/ietf/util.rb +8 -0
- data/lib/relaton/ietf/wg_name_resolver.rb +42 -0
- data/lib/relaton/ietf.rb +27 -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 +61 -0
- data/lib/relaton/index/id_number.rb +30 -0
- data/lib/relaton/index/pool.rb +41 -0
- data/lib/relaton/index/type.rb +159 -0
- data/lib/relaton/index/util.rb +18 -0
- data/lib/relaton/index.rb +60 -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 +407 -0
- data/lib/relaton/iso/data_fetcher.rb +338 -0
- data/lib/relaton/iso/data_parser.rb +444 -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 +184 -0
- data/lib/relaton/iso/item_data.rb +28 -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 +134 -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 +84 -0
- data/lib/relaton/iso/scraper.rb +619 -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 +90 -0
- data/lib/relaton/itu/data_fetcher.rb +104 -0
- data/lib/relaton/itu/data_parser_r.rb +140 -0
- data/lib/relaton/itu/hit.rb +22 -0
- data/lib/relaton/itu/hit_collection.rb +127 -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 +9 -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 +19 -0
- data/lib/relaton/itu/processor.rb +66 -0
- data/lib/relaton/itu/pubid.rb +177 -0
- data/lib/relaton/itu/radio_regulations_parser.rb +70 -0
- data/lib/relaton/itu/recommendation_parser.rb +161 -0
- data/lib/relaton/itu/scraper.rb +193 -0
- data/lib/relaton/itu/util.rb +8 -0
- data/lib/relaton/itu.rb +33 -0
- data/lib/relaton/jis/bibdata.rb +8 -0
- data/lib/relaton/jis/bibitem.rb +8 -0
- data/lib/relaton/jis/bibliography.rb +75 -0
- data/lib/relaton/jis/data_fetcher.rb +181 -0
- data/lib/relaton/jis/docidentifier.rb +21 -0
- data/lib/relaton/jis/doctype.rb +9 -0
- data/lib/relaton/jis/ext.rb +13 -0
- data/lib/relaton/jis/hit.rb +93 -0
- data/lib/relaton/jis/hit_collection.rb +127 -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 +33 -0
- data/lib/relaton/logger/channels/gh_issue.rb +78 -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 +84 -0
- data/lib/relaton/nist/date.rb +7 -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 +17 -0
- data/lib/relaton/nist/item_data.rb +6 -0
- data/lib/relaton/nist/mods_parser.rb +276 -0
- data/lib/relaton/nist/processor.rb +68 -0
- data/lib/relaton/nist/pubs_export.rb +69 -0
- data/lib/relaton/nist/relation.rb +7 -0
- data/lib/relaton/nist/scraper.rb +290 -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 +60 -0
- data/lib/relaton/oasis/browser_agent.rb +71 -0
- data/lib/relaton/oasis/data_fetcher.rb +94 -0
- data/lib/relaton/oasis/data_parser.rb +305 -0
- data/lib/relaton/oasis/data_parser_utils.rb +296 -0
- data/lib/relaton/oasis/data_part_parser.rb +239 -0
- data/lib/relaton/oasis/doctype.rb +7 -0
- data/lib/relaton/oasis/ext.rb +19 -0
- data/lib/relaton/oasis/item.rb +11 -0
- data/lib/relaton/oasis/item_data.rb +6 -0
- data/lib/relaton/oasis/processor.rb +68 -0
- data/lib/relaton/oasis/util.rb +8 -0
- data/lib/relaton/oasis.rb +28 -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 +110 -0
- data/lib/relaton/ogc/docidentifier.rb +6 -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 +36 -0
- data/lib/relaton/ogc/item.rb +13 -0
- data/lib/relaton/ogc/item_data.rb +6 -0
- data/lib/relaton/ogc/processor.rb +58 -0
- data/lib/relaton/ogc/scraper.rb +225 -0
- data/lib/relaton/ogc/util.rb +8 -0
- data/lib/relaton/ogc.rb +26 -0
- data/lib/relaton/oiml/bibdata.rb +8 -0
- data/lib/relaton/oiml/bibitem.rb +8 -0
- data/lib/relaton/oiml/bibliography.rb +94 -0
- data/lib/relaton/oiml/docidentifier.rb +33 -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/ext.rb +7 -0
- data/lib/relaton/omg/item.rb +8 -0
- data/lib/relaton/omg/item_data.rb +6 -0
- data/lib/relaton/omg/processor.rb +34 -0
- data/lib/relaton/omg/scraper.rb +141 -0
- data/lib/relaton/omg/util.rb +8 -0
- data/lib/relaton/omg.rb +24 -0
- data/lib/relaton/plateau/bibdata.rb +8 -0
- data/lib/relaton/plateau/bibitem.rb +8 -0
- data/lib/relaton/plateau/bibliography.rb +24 -0
- data/lib/relaton/plateau/data_fetcher.rb +153 -0
- data/lib/relaton/plateau/doctype.rb +7 -0
- data/lib/relaton/plateau/ext.rb +23 -0
- data/lib/relaton/plateau/handbook_parser.rb +95 -0
- data/lib/relaton/plateau/hit.rb +13 -0
- data/lib/relaton/plateau/hit_collection.rb +59 -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 +49 -0
- data/lib/relaton/plateau/technical_report_parser.rb +91 -0
- data/lib/relaton/plateau/util.rb +8 -0
- data/lib/relaton/plateau.rb +28 -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 +54 -0
- data/lib/relaton/w3c/data_fetcher.rb +309 -0
- data/lib/relaton/w3c/data_parser.rb +379 -0
- data/lib/relaton/w3c/doctype.rb +7 -0
- data/lib/relaton/w3c/ext.rb +11 -0
- data/lib/relaton/w3c/item.rb +12 -0
- data/lib/relaton/w3c/item_data.rb +6 -0
- data/lib/relaton/w3c/processor.rb +49 -0
- data/lib/relaton/w3c/pubid.rb +73 -0
- data/lib/relaton/w3c/safe_realize.rb +59 -0
- data/lib/relaton/w3c/util.rb +8 -0
- data/lib/relaton/w3c.rb +25 -0
- data/lib/relaton/xsf/bibdata.rb +8 -0
- data/lib/relaton/xsf/bibitem.rb +8 -0
- data/lib/relaton/xsf/bibliography.rb +24 -0
- data/lib/relaton/xsf/data_fetcher.rb +56 -0
- data/lib/relaton/xsf/hit.rb +17 -0
- data/lib/relaton/xsf/hit_collection.rb +24 -0
- data/lib/relaton/xsf/item.rb +7 -0
- data/lib/relaton/xsf/item_data.rb +6 -0
- data/lib/relaton/xsf/processor.rb +50 -0
- data/lib/relaton/xsf/util.rb +9 -0
- data/lib/relaton/xsf.rb +30 -0
- data/lib/relaton-core.rb +1 -0
- data/lib/relaton.rb +43 -0
- metadata +673 -170
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc5caa9d5213f1beb15ba9b972f40a3b6acbf7440d58ca1a958d6c5537f172a2
|
|
4
|
+
data.tar.gz: d3091a1f1228ffa5fd3113c41fc0781c4150a3705586fb070acfdb24057bd9f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6274eda8271b12eb7fc122d6125cd9c70c42351b00298b28777731f1b8fbb7d6fad98b837f5b7f686dede0b6aab5c2da36166fb44c83d25dceb394aa5314a1f5
|
|
7
|
+
data.tar.gz: 3fc1db36905ae3ae93b8de640370b428688d804c8a86c5f5e4510e292fe6cf30ae69a74caf2125a636d9ae7f67dc27859aa79975b647bb911b1373789aa62f36
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
= Relaton
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton.svg["Gem Version", link="https://rubygems.org/gems/relaton"]
|
|
4
|
-
image:https://github.com/relaton/relaton/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton/actions
|
|
5
|
-
image:https://codeclimate.com/github/relaton/relaton/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton"]
|
|
6
|
-
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton.svg["Pull Requests", link="https://github.com/relaton/relaton/pulls"]
|
|
7
|
-
image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton/releases"]
|
|
4
|
+
image:https://github.com/relaton/relaton/actions/workflows/rake.yml/badge.svg["Build Status", link="https://github.com/relaton/relaton/actions/workflows/rake.yml"]
|
|
8
5
|
|
|
9
6
|
Gem for importing and caching bibliographic references to technical standards.
|
|
7
|
+
Every standards-body flavor ships inside this single gem; flavor code loads on
|
|
8
|
+
demand via `autoload`, and the `Relaton::Db` API routes a reference to the right
|
|
9
|
+
flavor by its prefix. The command-line interface, `relaton-cli`, is a separate gem.
|
|
10
|
+
|
|
11
|
+
== Installation
|
|
12
|
+
|
|
13
|
+
[source,ruby]
|
|
14
|
+
----
|
|
15
|
+
gem "relaton"
|
|
16
|
+
----
|
|
10
17
|
|
|
11
18
|
== Scope
|
|
12
19
|
|
|
@@ -14,40 +21,13 @@ The Relaton gem obtains authoritative bibliographic entries for technical standa
|
|
|
14
21
|
|
|
15
22
|
The gem also caches entries it has retrieved so that subsequent iterations do not need to go back online to retrieve the same entries. The gem uses two caches: a global cache (for all bibliographic entries retrieved by the user), and a local cache (intended to store references specific to the current document being processed.)
|
|
16
23
|
|
|
17
|
-
Entries are retrieved and stored in https://github.com/relaton/relaton-models[Relaton bibliographic model], which is an expression of ISO 690. The subset of the model used and serialized for Relaton is defined
|
|
24
|
+
Entries are retrieved and stored in https://github.com/relaton/relaton-models[Relaton bibliographic model], which is an expression of ISO 690. The subset of the model used and serialized for Relaton is defined by the bundled `Relaton::Bib` model.
|
|
18
25
|
|
|
19
26
|
Entries are serialized to and from an internal data model, and multiple formats are intended to be supported. Currently, only https://github.com/relaton/relaton-models/blob/master/grammars/biblio.rnc[Relaton XML] is supported.
|
|
20
27
|
|
|
21
|
-
Relaton
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* BIPM through the https://github.com/metanorma/bipm-data-outcomes[bipm-data-outcomes], https://github.com/metanorma/bipm-si-brochure[bipm-si-brochure], https://github.com/relaton/rawdata-bipm-metrologia[rawdata-bipm-metrologia] datasets, via the the https://github.com/relaton/relaton-bipm[relaton-bipm] gem
|
|
25
|
-
* BSI through the knowledge.bsigroup.com/search website, via the https://github.com/relaton/relaton-bsi[relaton-bsi] gem
|
|
26
|
-
* CalConnect through the standards.calconnect.org website, via the https://github.com/relaton/relaton-calconnect[relaton-calconnect] gem
|
|
27
|
-
* CCSDS through the public.ccsds.org/Publications/AllPubs.aspx website, via the https://github.com/relaton/relaton-ccsds[relaton-ccsds] gem
|
|
28
|
-
* CEN through the standards.cencenelec.eu website, via the https://github.com/relaton/relaton-cen[relaton-cen] gem
|
|
29
|
-
* CIE through the techstreet.com website, via the https://github.com/relaton/relaton-cie[relaton-cie] gem
|
|
30
|
-
* DOI through the api.crossref.org website, via the https://github.com/relaton/relaton-doi[relaton-doi] gem
|
|
31
|
-
* ECMA through the ecma-international.org website, via the https://github.com/relaton/relaton-ecma[relaton-ecma] gem
|
|
32
|
-
* ETSI through the etsi.org website, via the https://github.com/relaton/relaton-etsi[relaton-etsi] gem
|
|
33
|
-
* GB (Chinese national standards) through the GB websites, via the https://github.com/relaton/relaton-gb[relaton-gb] gem
|
|
34
|
-
* IANA through the https://github.com/ietf-tools/iana-registries[iana-registries] dataset, via the https://github.com/relaton/relaton-iana[relaton-iana] gem
|
|
35
|
-
* IEC through the iec.ch website, via the https://github.com/relaton/relaton-iec[relaton-iec] gem
|
|
36
|
-
* IEEE through the standards.ieee.org website, via the https://github.com/relaton/relaton-ieee[relaton-ieee] gem
|
|
37
|
-
* IETF standards (Internet Drafts, RFC) through the http://xml2rfc.tools.ietf.org website, via the https://github.com/relaton/relaton-ietf[relaton-ietf] gem
|
|
38
|
-
* IHO through the iho.int website, via the https://github.com/relaton/relaton-iho[relaton-iho] gem
|
|
39
|
-
* ISO through the iso.org website, via the https://github.com/relaton/relaton-iso[relaton-iso] gem
|
|
40
|
-
* ITU through the itu.int website, via the https://github.com/relaton/relaton-itu[relaton-itu] gem
|
|
41
|
-
* ISBN through the openlibrary.org website, via the https://github.com/relaton/relaton-isbn[relaton-isbn] gem
|
|
42
|
-
* JIS through the webdesk.jsa.or.jp website, via the https://github.com/relaton/relaton-jis[relaton-jis] gem
|
|
43
|
-
* NIST standards through the nist.gov website, via the https://github.com/relaton/relaton-nist[relaton-nist] gem
|
|
44
|
-
* OASIS through the www.oasis-open.org/standards website, via the https://github.com/relaton/relaton-oasis[relaton-oasis] gem
|
|
45
|
-
* OGC through the https://github.com/opengeospatial/NamingAuthority[dataset], via the https://github.com/relaton/relaton-ogc[relaton-ogc] gem
|
|
46
|
-
* OMG through the omg.org/spec website, via the https://github.com/relaton/relaton-omg[relaton-omg] gem
|
|
47
|
-
* Plateau through the www.mlit.go.jp website, via the https://github.com/relaton/relaton-plateau[relaton-plateau] gem
|
|
48
|
-
* UN through the documents.un.org website, via the https://github.com/relaton/relaton-un[relaton-un] gem
|
|
49
|
-
* W3C through the w3c.org website, via the https://github.com/relaton/relaton-w3c[relaton-w3c] gem
|
|
50
|
-
* XSF through the xmpp.org website, via the https://github.com/relaton/relaton-xsf[relaton-xsf] gem
|
|
28
|
+
Relaton fetches bibliographic entries from ~29 standards bodies. Each is a
|
|
29
|
+
flavor bundled in this gem (ISO, IEC, IETF, NIST, IEEE, GB, W3C, ...) -- see
|
|
30
|
+
<<Flavors>> for the full list and per-flavor notes.
|
|
51
31
|
|
|
52
32
|
The identifiers for which bibliographic entries are to be retrieved need to indicate which standards body they belong to. To do so, this gem adopts the convention of bracketing identifiers, and preceding them with a code that indicates the standards body:
|
|
53
33
|
|
|
@@ -55,9 +35,9 @@ The identifiers for which bibliographic entries are to be retrieved need to indi
|
|
|
55
35
|
* Otherwise, the wrappers use the agreed abbreviation of the standards body. So `IETF(I-D.ribose-asciirfc-08)` identifies `I-D.ribose-asciirfc` as an Internet Engineering Task Force identifier.
|
|
56
36
|
* Some prefixes to identifiers indicate the standards body they belong to unambiguously; e.g. `ISO` followed by a slash or space. The scope wrapper is not required for those prefixes: `ISO(ISO 639-1)` can be recognized as just `ISO 639-1`.
|
|
57
37
|
|
|
58
|
-
|
|
38
|
+
Each flavor registers a `Relaton::<Flavor>::Processor` (a subclass of `Relaton::Core::Processor`) with the registry. A processor defines:
|
|
59
39
|
|
|
60
|
-
* `@short`, the name
|
|
40
|
+
* `@short`, the flavor name
|
|
61
41
|
* `@prefix`, the regex which scopes the identifier, and constrains it to belong to a particular standards class.
|
|
62
42
|
* `@defaultprefix`, the identifier prefixes which can be recognized without a scope wrapper.
|
|
63
43
|
* `@idtype`, the type assigned to document identifiers for the standard class.
|
|
@@ -99,7 +79,7 @@ Relaton.configure do |conf|
|
|
|
99
79
|
end
|
|
100
80
|
----
|
|
101
81
|
|
|
102
|
-
Logger configuration is managed
|
|
82
|
+
Logger configuration is managed via `Relaton.logger_pool`:
|
|
103
83
|
|
|
104
84
|
[source,ruby]
|
|
105
85
|
----
|
|
@@ -439,3 +419,94 @@ db.save_entry("ISO(ISO 19011)", nil)
|
|
|
439
419
|
db.load_entry("ISO(ISO 19011)")
|
|
440
420
|
=> nil
|
|
441
421
|
----
|
|
422
|
+
|
|
423
|
+
== Layout
|
|
424
|
+
|
|
425
|
+
----
|
|
426
|
+
relaton.gemspec # the one gemspec (union of every flavor's external deps)
|
|
427
|
+
lib/
|
|
428
|
+
├── relaton.rb # entry point: autoload per flavor, then require relaton/db
|
|
429
|
+
└── relaton/
|
|
430
|
+
├── version.rb # Relaton::VERSION — the single source of truth
|
|
431
|
+
├── db.rb, db/ # Relaton::Db: registry, cache, workers pool
|
|
432
|
+
├── core/ bib/ index/ logger/ # shared infrastructure
|
|
433
|
+
└── iso/ iec/ ietf/ … 3gpp/ # ~29 flavor plugins
|
|
434
|
+
spec/<flavor>/ # each flavor's spec suite
|
|
435
|
+
grammar/ # shared RelaxNG test schemas (test-only, not shipped)
|
|
436
|
+
gems/relaton-cli/ # the separate relaton-cli gem
|
|
437
|
+
----
|
|
438
|
+
|
|
439
|
+
== Flavors
|
|
440
|
+
|
|
441
|
+
Every flavor lives under `lib/relaton/<flavor>/` and keeps its own README with
|
|
442
|
+
usage and architecture notes.
|
|
443
|
+
|
|
444
|
+
Standards bodies:
|
|
445
|
+
|
|
446
|
+
link:lib/relaton/3gpp/README.adoc[3gpp],
|
|
447
|
+
link:lib/relaton/bipm/README.adoc[bipm],
|
|
448
|
+
link:lib/relaton/bsi/README.adoc[bsi],
|
|
449
|
+
link:lib/relaton/calconnect/README.adoc[calconnect],
|
|
450
|
+
link:lib/relaton/ccsds/README.adoc[ccsds],
|
|
451
|
+
link:lib/relaton/cen/README.adoc[cen],
|
|
452
|
+
link:lib/relaton/cie/README.adoc[cie],
|
|
453
|
+
link:lib/relaton/doi/README.adoc[doi],
|
|
454
|
+
link:lib/relaton/ecma/README.adoc[ecma],
|
|
455
|
+
link:lib/relaton/etsi/README.adoc[etsi],
|
|
456
|
+
link:lib/relaton/gb/README.adoc[gb],
|
|
457
|
+
link:lib/relaton/iana/README.adoc[iana],
|
|
458
|
+
link:lib/relaton/iec/README.adoc[iec],
|
|
459
|
+
link:lib/relaton/ieee/README.adoc[ieee],
|
|
460
|
+
link:lib/relaton/ietf/README.adoc[ietf],
|
|
461
|
+
link:lib/relaton/iho/README.adoc[iho],
|
|
462
|
+
link:lib/relaton/isbn/README.adoc[isbn],
|
|
463
|
+
link:lib/relaton/iso/README.adoc[iso],
|
|
464
|
+
link:lib/relaton/itu/README.adoc[itu],
|
|
465
|
+
link:lib/relaton/jis/README.adoc[jis],
|
|
466
|
+
link:lib/relaton/nist/README.adoc[nist],
|
|
467
|
+
link:lib/relaton/oasis/README.adoc[oasis],
|
|
468
|
+
link:lib/relaton/ogc/README.adoc[ogc],
|
|
469
|
+
link:lib/relaton/oiml/README.adoc[oiml],
|
|
470
|
+
link:lib/relaton/omg/README.adoc[omg],
|
|
471
|
+
link:lib/relaton/plateau/README.adoc[plateau],
|
|
472
|
+
link:lib/relaton/un/README.adoc[un],
|
|
473
|
+
link:lib/relaton/w3c/README.adoc[w3c],
|
|
474
|
+
link:lib/relaton/xsf/README.adoc[xsf].
|
|
475
|
+
|
|
476
|
+
Foundational libraries:
|
|
477
|
+
|
|
478
|
+
link:lib/relaton/bib/README.adoc[bib],
|
|
479
|
+
link:lib/relaton/core/README.adoc[core],
|
|
480
|
+
link:lib/relaton/index/README.adoc[index],
|
|
481
|
+
link:lib/relaton/logger/README.adoc[logger].
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
== Development
|
|
485
|
+
|
|
486
|
+
[source,shell]
|
|
487
|
+
----
|
|
488
|
+
bundle install
|
|
489
|
+
bundle exec rake spec # run every flavor's spec suite
|
|
490
|
+
bundle exec rake spec:iso # run one flavor's suite
|
|
491
|
+
bundle exec rake build # build the relaton gem into pkg/
|
|
492
|
+
bundle exec rake build_all # build relaton + relaton-cli
|
|
493
|
+
----
|
|
494
|
+
|
|
495
|
+
Each flavor's specs live in `spec/<flavor>/` and run self-contained against the
|
|
496
|
+
single gem (each in its own directory, so relative fixture/cassette/grammar
|
|
497
|
+
paths resolve). See `CLAUDE.md` for the architecture notes (lazy registry,
|
|
498
|
+
autoload, single version, grammar schemas).
|
|
499
|
+
|
|
500
|
+
== Versioning
|
|
501
|
+
|
|
502
|
+
One version, `Relaton::VERSION` in `lib/relaton/version.rb`; every flavor derives
|
|
503
|
+
from it. Bump that file (and `relaton-cli`'s own version) to cut a release.
|
|
504
|
+
|
|
505
|
+
== Release
|
|
506
|
+
|
|
507
|
+
The `release` GitHub Actions workflow builds and pushes two gems: `relaton` and
|
|
508
|
+
`relaton-cli`. Requires the `RELATON_CI_RUBYGEMS_API_KEY` secret.
|
|
509
|
+
|
|
510
|
+
== License
|
|
511
|
+
|
|
512
|
+
BSD-2-Clause.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module ThreeGpp
|
|
5
|
+
# Methods for search IANA standards.
|
|
6
|
+
module Bibliography
|
|
7
|
+
SOURCE = "https://raw.githubusercontent.com/relaton/relaton-data-3gpp/v2/"
|
|
8
|
+
|
|
9
|
+
# @param text [String]
|
|
10
|
+
# @return [RelatonBib::BibliographicItem]
|
|
11
|
+
def search(text) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
12
|
+
index = Relaton::Index.find_or_create "3GPP", url: "#{SOURCE}#{INDEXFILE}.zip", file: "#{INDEXFILE}.yaml"
|
|
13
|
+
row = index.search(text.sub(/^3GPP\s/, "")).min_by { |r| r[:id] }
|
|
14
|
+
return unless row
|
|
15
|
+
|
|
16
|
+
url = "#{SOURCE}#{row[:file]}"
|
|
17
|
+
resp = Net::HTTP.get_response URI(url)
|
|
18
|
+
return unless resp.code == "200"
|
|
19
|
+
|
|
20
|
+
item = Item.from_yaml(resp.body)
|
|
21
|
+
item.fetched = Date.today.to_s
|
|
22
|
+
item
|
|
23
|
+
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
|
|
24
|
+
EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
|
25
|
+
Net::ProtocolError, Errno::ETIMEDOUT => e
|
|
26
|
+
raise Relaton::RequestError, e.message
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @param ref [String] the W3C standard Code to look up
|
|
30
|
+
# @param year [String, NilClass] not used
|
|
31
|
+
# @param opts [Hash] options
|
|
32
|
+
# @return [RelatonBib::BibliographicItem]
|
|
33
|
+
def get(ref, _year = nil, _opts = {})
|
|
34
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
|
35
|
+
result = search(ref)
|
|
36
|
+
unless result
|
|
37
|
+
Util.info "Not found.", key: ref
|
|
38
|
+
return
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
Util.info "Found: `#{result.docidentifier[0].content}`", key: ref
|
|
42
|
+
result
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
extend Bibliography
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
require "fileutils"
|
|
2
|
+
require "net/http"
|
|
3
|
+
require "uri"
|
|
4
|
+
require_relative "../3gpp"
|
|
5
|
+
require_relative "parser"
|
|
6
|
+
|
|
7
|
+
module Relaton
|
|
8
|
+
module ThreeGpp
|
|
9
|
+
class DataFetcher < Core::DataFetcher
|
|
10
|
+
CURRENT = "current.yaml".freeze
|
|
11
|
+
CSV_URL = "https://www.3gpp.org/ftp/Information/Databases/3GPPBibliography.csv".freeze
|
|
12
|
+
|
|
13
|
+
def log_error(msg)
|
|
14
|
+
Util.error msg
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def index
|
|
18
|
+
@index ||= Relaton::Index.find_or_create "3gpp", file: "#{INDEXFILE}.yaml"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Parse documents
|
|
23
|
+
#
|
|
24
|
+
# @param [String] source source of documents, status-smg-3gpp for updare
|
|
25
|
+
# or status-smg-3gpp-force for renewal
|
|
26
|
+
#
|
|
27
|
+
def fetch(source) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
28
|
+
renewal = source == "status-smg-3GPP-force"
|
|
29
|
+
file = get_file renewal
|
|
30
|
+
return unless file && File.exist?(file) && File.size(file) > 20_000_000
|
|
31
|
+
|
|
32
|
+
if renewal
|
|
33
|
+
FileUtils.rm_f Dir.glob(File.join(@output, "/*"))
|
|
34
|
+
index.remove_all # if renewal
|
|
35
|
+
end
|
|
36
|
+
CSV.open(file, "r:bom|utf-8", headers: true, col_sep: ";").each do |row|
|
|
37
|
+
save_doc Parser.parse(row, @errors)
|
|
38
|
+
end
|
|
39
|
+
File.write CURRENT, @current.to_yaml, encoding: "UTF-8"
|
|
40
|
+
index.save
|
|
41
|
+
report_errors
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# Get file via HTTPS. If file has not changed, return nil
|
|
46
|
+
#
|
|
47
|
+
# @param [Boolean] renewal force to update all documents
|
|
48
|
+
#
|
|
49
|
+
# @return [String, nil] file name
|
|
50
|
+
#
|
|
51
|
+
def get_file(renewal) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
52
|
+
@current = YAML.load_file CURRENT if File.exist? CURRENT
|
|
53
|
+
@current ||= {}
|
|
54
|
+
uri = URI(CSV_URL)
|
|
55
|
+
n = 0
|
|
56
|
+
begin
|
|
57
|
+
last_modified = head_last_modified(uri)
|
|
58
|
+
return unless last_modified
|
|
59
|
+
|
|
60
|
+
dt = DateTime.parse(last_modified)
|
|
61
|
+
if !renewal && !@current["date"].to_s.empty? &&
|
|
62
|
+
dt == DateTime.parse(@current["date"])
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
tmp_file = File.join Dir.tmpdir, "3gpp.csv"
|
|
67
|
+
download(uri, tmp_file)
|
|
68
|
+
rescue Net::OpenTimeout, Net::ReadTimeout, SocketError => e
|
|
69
|
+
n += 1
|
|
70
|
+
retry if n < 5
|
|
71
|
+
raise e
|
|
72
|
+
end
|
|
73
|
+
@current["date"] = dt.to_s
|
|
74
|
+
tmp_file
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def head_last_modified(uri)
|
|
78
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https",
|
|
79
|
+
open_timeout: 30, read_timeout: 30) do |http|
|
|
80
|
+
resp = http.request(Net::HTTP::Head.new(uri.request_uri))
|
|
81
|
+
raise "HTTP #{resp.code} from #{uri}" unless resp.is_a?(Net::HTTPSuccess)
|
|
82
|
+
|
|
83
|
+
resp["last-modified"]
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def download(uri, tmp_file)
|
|
88
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https",
|
|
89
|
+
open_timeout: 30, read_timeout: 120) do |http|
|
|
90
|
+
http.request(Net::HTTP::Get.new(uri.request_uri)) do |resp|
|
|
91
|
+
raise "HTTP #{resp.code} from #{uri}" unless resp.is_a?(Net::HTTPSuccess)
|
|
92
|
+
|
|
93
|
+
File.open(tmp_file, "wb") { |f| resp.read_body { |chunk| f.write(chunk) } }
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
#
|
|
99
|
+
# Save document to file
|
|
100
|
+
#
|
|
101
|
+
# @param [RelatonW3c::W3cBibliographicItem, nil] bib bibliographic item
|
|
102
|
+
#
|
|
103
|
+
def save_doc(bib) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
|
104
|
+
return unless bib
|
|
105
|
+
|
|
106
|
+
bib1 = bib
|
|
107
|
+
file = output_file(bib1.docnumber)
|
|
108
|
+
if @files.include? file
|
|
109
|
+
bib1 = merge_duplication bib1, file
|
|
110
|
+
Util.warn "File #{file} already exists. Document: #{bib.docnumber}" if bib1.nil?
|
|
111
|
+
else
|
|
112
|
+
@files << file
|
|
113
|
+
index.add_or_update bib1.docnumber, file
|
|
114
|
+
end
|
|
115
|
+
File.write file, serialize(bib1), encoding: "UTF-8" unless bib1.nil?
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
#
|
|
119
|
+
# Merge duplication
|
|
120
|
+
#
|
|
121
|
+
# @param [Relaton3gpp::BibliographicItem] bib new bibliographic item
|
|
122
|
+
# @param [String] file file name of existing bibliographic item
|
|
123
|
+
#
|
|
124
|
+
# @return [Relaton3gpp::BibliographicItem, nil] merged bibliographic item or nil if no merge has been done
|
|
125
|
+
#
|
|
126
|
+
def merge_duplication(bib, file)
|
|
127
|
+
hash = YAML.load_file file
|
|
128
|
+
existed = Item.from_hash hash
|
|
129
|
+
changed = update_source? bib, existed
|
|
130
|
+
bib1, bib2, chng = transposed_relation bib, existed
|
|
131
|
+
changed ||= chng
|
|
132
|
+
chng = add_contributor(bib1, bib2)
|
|
133
|
+
changed ||= chng
|
|
134
|
+
bib1 if changed
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
#
|
|
138
|
+
# Update link in case one of bibliographic items has no link
|
|
139
|
+
#
|
|
140
|
+
# @param [Relaton3gpp::BibliographicItem] bib1
|
|
141
|
+
# @param [Relaton3gpp::BibliographicItem] bib2
|
|
142
|
+
#
|
|
143
|
+
# @return [Boolean] true if link has been updated
|
|
144
|
+
#
|
|
145
|
+
def update_source?(bib1, bib2)
|
|
146
|
+
if bib1.source.any? && bib2.source.empty?
|
|
147
|
+
bib2.source = bib1.source
|
|
148
|
+
true
|
|
149
|
+
elsif bib1.source.empty? && bib2.source.any?
|
|
150
|
+
bib1.source = bib2.source
|
|
151
|
+
true
|
|
152
|
+
else false
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
#
|
|
157
|
+
# If one of bibliographic items has date gereater than anotherm=, make it relation
|
|
158
|
+
#
|
|
159
|
+
# @param [Relaton3gpp::BibliographicItem] bib new bibliographic item
|
|
160
|
+
# @param [Relaton3gpp::BibliographicItem] existed existing bibliographic item
|
|
161
|
+
#
|
|
162
|
+
# @return [Array<Relaton3gpp::BibliographicItem, Boolean>] main bibliographic item,
|
|
163
|
+
# related bibliographic item, true if relation has been added
|
|
164
|
+
#
|
|
165
|
+
def transposed_relation(bib, existed) # rubocop:disable Metrics/CyclomaticComplexity
|
|
166
|
+
if (bib.date.none? && existed.date.none?) || (bib.date.any? && existed.date.none?)
|
|
167
|
+
return [bib, existed, false]
|
|
168
|
+
end
|
|
169
|
+
return [existed, bib, true] if bib.date.none? && existed.date.any?
|
|
170
|
+
|
|
171
|
+
check_transposed_date bib, existed
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
# Check if date of one bibliographic item is transposed to another
|
|
176
|
+
#
|
|
177
|
+
# @param [Relaton3gpp::BibliographicItem] bib new bibliographic item
|
|
178
|
+
# @param [Relaton3gpp::BibliographicItem] existed existing bibliographic item
|
|
179
|
+
#
|
|
180
|
+
# @return [Array<Relaton3gpp::BibliographicItem, Boolean>] main bibliographic item,
|
|
181
|
+
# related bibliographic item, true if relation has been added
|
|
182
|
+
#
|
|
183
|
+
def check_transposed_date(bib, existed)
|
|
184
|
+
if bib.date[0].at < existed.date[0].at
|
|
185
|
+
add_transposed_relation bib, existed
|
|
186
|
+
[bib, existed, true]
|
|
187
|
+
elsif bib.date[0].at > existed.date[0].at
|
|
188
|
+
add_transposed_relation existed, bib
|
|
189
|
+
[existed, bib, true]
|
|
190
|
+
else [bib, existed, false]
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
#
|
|
195
|
+
# Add transposed relation
|
|
196
|
+
#
|
|
197
|
+
# @param [Relaton3gpp::BibliographicItem] bib1 the main bibliographic item
|
|
198
|
+
# @param [Relaton3gpp::BibliographicItem] bib2 the transposed bibliographic item
|
|
199
|
+
#
|
|
200
|
+
# @return [Relaton3gpp::BibliographicItem]
|
|
201
|
+
#
|
|
202
|
+
def add_transposed_relation(bib1, bib2)
|
|
203
|
+
bib2.relation.each { |r| bib1.relation << r }
|
|
204
|
+
bib2.relation.clear
|
|
205
|
+
desc = Bib::LocalizedMarkedUpString.new content: "equivalent"
|
|
206
|
+
rel = Bib::Relation.new(type: "adoptedAs", bibitem: bib2, description: desc)
|
|
207
|
+
bib1.relation << rel
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def add_contributor(bib1, bib2) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
211
|
+
changed = false
|
|
212
|
+
|
|
213
|
+
bib2.contributor.each do |bc|
|
|
214
|
+
next unless bc.person
|
|
215
|
+
|
|
216
|
+
existed = bib1.contributor.find { |ic| ic.person&.name == bc.person.name }
|
|
217
|
+
if existed
|
|
218
|
+
chng = add_affiliation existed, bc.person.affiliation
|
|
219
|
+
changed ||= chng
|
|
220
|
+
else
|
|
221
|
+
bib1.contributor << bc
|
|
222
|
+
changed = true
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
changed
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def add_affiliation(contrib, affiliation)
|
|
230
|
+
changed = false
|
|
231
|
+
|
|
232
|
+
affiliation.each do |a|
|
|
233
|
+
unless contrib.person.affiliation.include? a
|
|
234
|
+
contrib.person.affiliation << a
|
|
235
|
+
changed = true
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
changed
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def to_xml(bib)
|
|
243
|
+
bib.to_xml(bibdata: true)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def to_yaml(bib)
|
|
247
|
+
bib.to_yaml
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def to_bibxml(bib)
|
|
251
|
+
bib.to_rfcxml
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require_relative "doctype"
|
|
2
|
+
require_relative "release"
|
|
3
|
+
|
|
4
|
+
module Relaton
|
|
5
|
+
module ThreeGpp
|
|
6
|
+
class Ext < Bib::Ext
|
|
7
|
+
attribute :doctype, Doctype
|
|
8
|
+
attribute :release, Release
|
|
9
|
+
attribute :subdoctype, :string, values: %w[spec release]
|
|
10
|
+
attribute :radiotechnology, :string, values: %w[2G 3G LTE 5G]
|
|
11
|
+
attribute :common_ims_spec, :boolean
|
|
12
|
+
attribute :internal, :boolean
|
|
13
|
+
|
|
14
|
+
def get_schema_version = Relaton.schema_versions["relaton-model-3gpp"]
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
map_element "radiotechnology", to: :radiotechnology
|
|
18
|
+
map_element "common-ims-spec", to: :common_ims_spec
|
|
19
|
+
map_element "internal", to: :internal
|
|
20
|
+
map_element "release", to: :release
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
key_value do
|
|
24
|
+
map_element "radiotechnology", to: :radiotechnology
|
|
25
|
+
map_element "common_ims_spec", to: :common_ims_spec
|
|
26
|
+
map_element "internal", to: :internal
|
|
27
|
+
map_element "release", to: :release
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module ThreeGpp
|
|
3
|
+
class ItemData < Bib::ItemData
|
|
4
|
+
def create_id(without_date: false)
|
|
5
|
+
return id if id && !id.empty?
|
|
6
|
+
|
|
7
|
+
docid = find_primary_docid
|
|
8
|
+
return unless docid
|
|
9
|
+
|
|
10
|
+
pubid = without_date ? docid.content.sub(/:\d{4}$/, "") : docid.content
|
|
11
|
+
self.id = pubid.to_s.sub(/\A3GPP\s+/, "").gsub(/\W+/, "")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|