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,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "rfc_index_namespace"
|
|
4
|
+
require_relative "entry"
|
|
5
|
+
|
|
6
|
+
module Relaton
|
|
7
|
+
module Ietf
|
|
8
|
+
module Rfc
|
|
9
|
+
# Model for the root <rfc-index> element
|
|
10
|
+
class Index < Lutaml::Model::Serializable
|
|
11
|
+
attribute :bcp_entries, Entry, collection: true
|
|
12
|
+
attribute :fyi_entries, Entry, collection: true
|
|
13
|
+
attribute :std_entries, Entry, collection: true
|
|
14
|
+
attribute :rfc_entries, Entry, collection: true
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
root "rfc-index"
|
|
18
|
+
namespace RfcIndexNamespace
|
|
19
|
+
|
|
20
|
+
map_element "bcp-entry", to: :bcp_entries
|
|
21
|
+
map_element "fyi-entry", to: :fyi_entries
|
|
22
|
+
map_element "std-entry", to: :std_entries
|
|
23
|
+
map_element "rfc-entry", to: :rfc_entries
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
#
|
|
27
|
+
# Get all subseries entries
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Entry>]
|
|
30
|
+
#
|
|
31
|
+
def subseries_entries
|
|
32
|
+
(bcp_entries || []) + (fyi_entries || []) + (std_entries || [])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
#
|
|
36
|
+
# Get entries that have is-also references (can be converted to items)
|
|
37
|
+
#
|
|
38
|
+
# @return [Array<Entry>]
|
|
39
|
+
#
|
|
40
|
+
def parseable_entries
|
|
41
|
+
subseries_entries.select(&:has_is_also?)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "rfc_index_namespace"
|
|
4
|
+
|
|
5
|
+
module Relaton
|
|
6
|
+
module Ietf
|
|
7
|
+
module Rfc
|
|
8
|
+
# Model for <is-also> element containing doc-id references
|
|
9
|
+
class IsAlso < Lutaml::Model::Serializable
|
|
10
|
+
attribute :doc_id, :string, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
root "is-also"
|
|
14
|
+
namespace RfcIndexNamespace
|
|
15
|
+
|
|
16
|
+
map_element "doc-id", to: :doc_id
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "rfc_index_namespace"
|
|
4
|
+
|
|
5
|
+
module Relaton
|
|
6
|
+
module Ietf
|
|
7
|
+
module Rfc
|
|
8
|
+
class Keywords < Lutaml::Model::Serializable
|
|
9
|
+
attribute :kw, :string, collection: true
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
root "keywords"
|
|
13
|
+
namespace RfcIndexNamespace
|
|
14
|
+
map_element "kw", to: :kw
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "pubid"
|
|
4
|
+
require "pubid/ietf"
|
|
5
|
+
|
|
6
|
+
module Relaton
|
|
7
|
+
module Ietf
|
|
8
|
+
# Scraper module
|
|
9
|
+
module Scraper
|
|
10
|
+
extend Scraper
|
|
11
|
+
|
|
12
|
+
# The combined corpus — RFCs, the RFC sub-series and Internet-Drafts in one
|
|
13
|
+
# repo, with one pubid `index-v2` covering all ~177k records (relaton#109).
|
|
14
|
+
# It replaces the three per-type repos this flavor used to read; those keep
|
|
15
|
+
# publishing their `index-v1` for released relatons, untouched.
|
|
16
|
+
IETF = "https://raw.githubusercontent.com/relaton/relaton-data-ietf/main/"
|
|
17
|
+
|
|
18
|
+
# @param text [String]
|
|
19
|
+
# @return [Relaton::Ietf::ItemData, nil]
|
|
20
|
+
def scrape_page(text)
|
|
21
|
+
id = parse_id text.sub(/\AIETF\s+/, "")
|
|
22
|
+
return unless id
|
|
23
|
+
|
|
24
|
+
fetch_doc id
|
|
25
|
+
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
|
26
|
+
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
|
27
|
+
Net::ProtocolError, SocketError
|
|
28
|
+
raise Relaton::RequestError, "No document found for #{text} reference"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
# The index stores parsed pubids, so the query has to be one too.
|
|
34
|
+
# `Type#search_candidates` narrows only when the query is not a String
|
|
35
|
+
# (`@file_io.sorted && id && !id.is_a?(String)`); a String falls through to
|
|
36
|
+
# `match_item`'s `item[:id].to_s.include?(id)`, which renders every pubid in
|
|
37
|
+
# the index on every lookup — measured at ~40 s per reference against the
|
|
38
|
+
# 177k-row index, versus sub-millisecond for a parsed one.
|
|
39
|
+
# `exact:` keeps the match exact. `Type#search` without it takes
|
|
40
|
+
# pubid's subset match, where a component the query omits is a wildcard —
|
|
41
|
+
# and an Internet-Draft slug omits the version, so `draft-foo` would match
|
|
42
|
+
# every `draft-foo-NN` and `.first` would return an arbitrary one (20,513
|
|
43
|
+
# such pairs in the first 40k rows of the index fixture).
|
|
44
|
+
def fetch_doc(id)
|
|
45
|
+
row = index.search(id, exact: true).first
|
|
46
|
+
get_page "#{IETF}#{row[:file]}" if row
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def index
|
|
50
|
+
Relaton::Index.find_or_create(
|
|
51
|
+
:IETF, url: "#{IETF}#{INDEXFILE}.zip", file: "#{INDEXFILE}.yaml",
|
|
52
|
+
pubid_class: ::Pubid::Ietf::Identifier
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
#
|
|
57
|
+
# Parse a reference into the identifier the index is keyed by.
|
|
58
|
+
#
|
|
59
|
+
# Normalises the two Internet-Draft spellings callers use — `I-D.<slug>`
|
|
60
|
+
# and `I-D <slug>` — onto the `draft-…` form pubid parses and the index
|
|
61
|
+
# stores. The bare `I-D.ietf-quic-transport` spelling (the bibxml anchor,
|
|
62
|
+
# and the `docnumber` IETF records carry) gains the `draft-` stem: the old
|
|
63
|
+
# plain-string index matched it by substring, and matching is exact now.
|
|
64
|
+
#
|
|
65
|
+
# The capture is `(\S.*)`, not `(.+)`: it must start non-space so it cannot
|
|
66
|
+
# overlap the preceding `\s*`. Behaviour is unchanged on every real
|
|
67
|
+
# reference — with `(.+)` the greedy `\s*` only ever yields ground on an
|
|
68
|
+
# all-whitespace remainder, which pubid rejects anyway — but the
|
|
69
|
+
# unambiguous form is about twice as fast on a pathological input and is
|
|
70
|
+
# what CodeQL's rb/polynomial-redos models. Measured before changing it:
|
|
71
|
+
# the old form was already linear (0.66 ms at 80k chars), so this is
|
|
72
|
+
# clarity, not a ReDoS fix.
|
|
73
|
+
#
|
|
74
|
+
# @param ref [String]
|
|
75
|
+
# @return [Pubid::Ietf::Identifier, nil] nil when pubid has no grammar for
|
|
76
|
+
# it, so an out-of-flavor reference logs "Not found." instead of raising
|
|
77
|
+
#
|
|
78
|
+
def parse_id(ref)
|
|
79
|
+
if (draft = ref[/\AI-D[.\s]\s*(\S.*)\z/m, 1])
|
|
80
|
+
ref = draft.start_with?("draft-") ? draft : "draft-#{draft}"
|
|
81
|
+
end
|
|
82
|
+
::Pubid::Ietf::Identifier.parse ref
|
|
83
|
+
rescue StandardError => e
|
|
84
|
+
# Logged, not swallowed: this repo git-pins pubid to a moving `main`,
|
|
85
|
+
# so a grammar regression would otherwise present as every IETF
|
|
86
|
+
# reference quietly reporting "Not found."
|
|
87
|
+
Util.debug "`#{ref}` is not an IETF identifier: #{e.message}"
|
|
88
|
+
nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# @param uri [String]
|
|
92
|
+
# @return [Relaton::Ietf::ItemData, nil] HTTP response body
|
|
93
|
+
def get_page(uri)
|
|
94
|
+
res = Net::HTTP.get_response(URI(uri))
|
|
95
|
+
return unless res.code == "200"
|
|
96
|
+
|
|
97
|
+
Item.from_yaml(res.body).tap { |item| item.fetched = Date.today.to_s }
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
require "net/http"
|
|
5
|
+
|
|
6
|
+
module Relaton
|
|
7
|
+
module Ietf
|
|
8
|
+
# Fetches working group and research group names from the IETF Datatracker API.
|
|
9
|
+
# Returns a Hash mapping acronym (lowercase) to full group name.
|
|
10
|
+
module WgNameResolver
|
|
11
|
+
API_URL = "https://datatracker.ietf.org/api/v1/group/group/"
|
|
12
|
+
|
|
13
|
+
# @return [Hash{String => String}] acronym => full name
|
|
14
|
+
def self.fetch
|
|
15
|
+
result = {}
|
|
16
|
+
offset = 0
|
|
17
|
+
limit = 1000
|
|
18
|
+
loop do
|
|
19
|
+
uri = URI("#{API_URL}?type__in=wg,rg&limit=#{limit}&offset=#{offset}&format=json")
|
|
20
|
+
response = Net::HTTP.get_response(uri)
|
|
21
|
+
break unless response.is_a?(Net::HTTPSuccess)
|
|
22
|
+
|
|
23
|
+
data = JSON.parse(response.body)
|
|
24
|
+
objects = data["objects"] || []
|
|
25
|
+
break if objects.empty?
|
|
26
|
+
|
|
27
|
+
objects.each do |group|
|
|
28
|
+
acronym = group["acronym"]
|
|
29
|
+
name = group["name"]
|
|
30
|
+
result[acronym] = name if acronym && name
|
|
31
|
+
end
|
|
32
|
+
offset += limit
|
|
33
|
+
break unless data.dig("meta", "next")
|
|
34
|
+
end
|
|
35
|
+
result
|
|
36
|
+
rescue StandardError => e
|
|
37
|
+
Util.warn "Failed to fetch WG names from Datatracker: #{e.message}"
|
|
38
|
+
{}
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/relaton/ietf.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "relaton/index"
|
|
5
|
+
require "relaton/bib"
|
|
6
|
+
require_relative "version"
|
|
7
|
+
require_relative "ietf/util"
|
|
8
|
+
require_relative "ietf/item_data"
|
|
9
|
+
require_relative "ietf/item"
|
|
10
|
+
require_relative "ietf/bibitem"
|
|
11
|
+
require_relative "ietf/bibdata"
|
|
12
|
+
require_relative "ietf/rfc/index"
|
|
13
|
+
require_relative "ietf/bibliography"
|
|
14
|
+
|
|
15
|
+
module Relaton
|
|
16
|
+
module Ietf
|
|
17
|
+
# The pubid-structured index, written by DataFetcher and read by Scraper
|
|
18
|
+
# (relaton#109). One constant again now that both sides are on it — the
|
|
19
|
+
# second one existed only while producer and consumer were split.
|
|
20
|
+
INDEXFILE = "index-v2".freeze
|
|
21
|
+
# Returns hash of XML reammar
|
|
22
|
+
# @return [String]
|
|
23
|
+
def self.grammar_hash
|
|
24
|
+
# gem_path = File.expand_path "..", __dir__
|
|
25
|
+
# grammars_path = File.join gem_path, "grammars", "*"
|
|
26
|
+
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
|
|
27
|
+
Digest::MD5.hexdigest Relaton::VERSION # grammars
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
require "net/http"
|
|
2
|
+
|
|
3
|
+
module Relaton
|
|
4
|
+
module Iho
|
|
5
|
+
module Bibliography
|
|
6
|
+
ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-iho/refs/heads/v2/".freeze
|
|
7
|
+
|
|
8
|
+
class << self
|
|
9
|
+
#
|
|
10
|
+
# Search for IHO standard by IHO standard Code
|
|
11
|
+
#
|
|
12
|
+
# @param text [String] the IHO standard Code to look up (e..g "IHO B-11")
|
|
13
|
+
#
|
|
14
|
+
# @return [RelatonIho::IhoBibliographicItem, nil] the IHO standard or nil if not found
|
|
15
|
+
#
|
|
16
|
+
def search(text, _year = nil, _opts = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
17
|
+
pubid = text.is_a?(String) ? ::Pubid::Iho::Identifier.parse(text) : text
|
|
18
|
+
Util.info "Fetching from Relaton repository ...", key: pubid.to_s
|
|
19
|
+
# Pass the pubid so Relaton::Index narrows candidates by number via
|
|
20
|
+
# binary search before applying the block. Every row's `:id` is a
|
|
21
|
+
# Pubid::Iho::Identifiers::* (Relaton::Index deserialized it via the
|
|
22
|
+
# `pubid_class` passed in `#index`), so `pubid_match?` compares pubids.
|
|
23
|
+
row = index.search(pubid) { |r| pubid_match?(r[:id], pubid) }
|
|
24
|
+
.min_by { |r| r[:id].version.to_s }
|
|
25
|
+
unless row
|
|
26
|
+
Util.info "Not found.", key: pubid.to_s
|
|
27
|
+
return
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
uri = URI("#{ENDPOINT}#{row[:file]}")
|
|
31
|
+
resp = Net::HTTP.get_response uri
|
|
32
|
+
unless resp.code == "200"
|
|
33
|
+
raise Relaton::RequestError, "Could not access #{uri}: HTTP #{resp.code}"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
item = Relaton::Iho::Item.from_yaml resp.body
|
|
37
|
+
enrich_with_pubid(item, pubid)
|
|
38
|
+
Util.info "Found: `#{item.docidentifier.first.content}`", key: pubid.to_s
|
|
39
|
+
item.tap { |i| i.fetched = Date.today.to_s }
|
|
40
|
+
rescue SocketError, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
|
41
|
+
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
|
42
|
+
Net::ProtocolError, Net::ReadTimeout, OpenSSL::SSL::SSLError,
|
|
43
|
+
Errno::ETIMEDOUT => e
|
|
44
|
+
raise Relaton::RequestError, "Could not access #{uri}: #{e.message}"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Populate ext.structuredidentifier from the parsed Pubid when the
|
|
48
|
+
# fetched record doesn't already provide one. Maps `pubid.number`
|
|
49
|
+
# (with type prefix, e.g. `S-100`) -> docnumber, `pubid.part` -> part,
|
|
50
|
+
# `pubid.appendix` -> appendixid, `pubid.annex` -> annexid,
|
|
51
|
+
# `pubid.supplement` -> supplementid.
|
|
52
|
+
def enrich_with_pubid(item, pubid)
|
|
53
|
+
return if item.ext&.structuredidentifier&.any?
|
|
54
|
+
|
|
55
|
+
sid = StructuredIdentifier.new(
|
|
56
|
+
docnumber: pubid_docnumber(pubid),
|
|
57
|
+
part: pubid.part,
|
|
58
|
+
appendixid: (pubid.appendix if pubid.respond_to?(:appendix)),
|
|
59
|
+
annexid: (pubid.annex if pubid.respond_to?(:annex)),
|
|
60
|
+
supplementid: (pubid.supplement if pubid.respond_to?(:supplement)),
|
|
61
|
+
)
|
|
62
|
+
item.ext ||= Ext.new
|
|
63
|
+
item.ext.structuredidentifier = [sid]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# "S-100" rather than "100" — keeps the type prefix that distinguishes
|
|
67
|
+
# the IHO series (S/P/M/B/C). Matches spec/fixtures/iho_part.xml.
|
|
68
|
+
def pubid_docnumber(pubid)
|
|
69
|
+
pubid.to_s.sub(/^IHO\s/, "").split(/\s+/, 2).first
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# @param ref [String] the IHO standard Code to look up (e..g "IHO B-11")
|
|
73
|
+
# @param year [String] the year the standard was published (optional)
|
|
74
|
+
#
|
|
75
|
+
# @param opts [Hash] options
|
|
76
|
+
# @option opts [TrueClass, FalseClass] :all_parts restricted to all parts
|
|
77
|
+
# if all-parts reference is required
|
|
78
|
+
# @option opts [TrueClass, FalseClass] :bibdata
|
|
79
|
+
#
|
|
80
|
+
# @return [RelatonIho::IhoBibliographicItem]
|
|
81
|
+
def get(ref, year = nil, opts = {})
|
|
82
|
+
search(ref, year, opts)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
private
|
|
86
|
+
|
|
87
|
+
def index
|
|
88
|
+
Relaton::Index.find_or_create(
|
|
89
|
+
:iho,
|
|
90
|
+
url: "#{ENDPOINT}#{INDEXFILE}.zip",
|
|
91
|
+
file: "#{INDEXFILE}.yaml",
|
|
92
|
+
pubid_class: ::Pubid::Iho::Identifier,
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Both `row_id` and `query` are Pubid::Iho::Identifiers::* instances.
|
|
97
|
+
# Class identity pins the series (S/P/M/B/C). Subdivision keys
|
|
98
|
+
# (part/appendix/annex/supplement) use strict equality — a nil query
|
|
99
|
+
# must match a nil row (the umbrella), not an arbitrary subdivision
|
|
100
|
+
# under the same (number, version). Only :version stays nil-tolerant: an
|
|
101
|
+
# unqualified `IHO B-11` query is expected to find the latest edition.
|
|
102
|
+
def pubid_match?(row_id, query)
|
|
103
|
+
row_id.class == query.class &&
|
|
104
|
+
row_id.number == query.number &&
|
|
105
|
+
row_id.part.to_s == query.part.to_s &&
|
|
106
|
+
row_id.appendix.to_s == query.appendix.to_s &&
|
|
107
|
+
row_id.annex.to_s == query.annex.to_s &&
|
|
108
|
+
row_id.supplement.to_s == query.supplement.to_s &&
|
|
109
|
+
(query.version.nil? || row_id.version.to_s == query.version.to_s)
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module Iho
|
|
3
|
+
class Docidentifier < Bib::Docidentifier
|
|
4
|
+
attr_reader :pubid
|
|
5
|
+
|
|
6
|
+
def initialize(attrs = {}, options = {})
|
|
7
|
+
pubid = attrs.is_a?(Hash) ? attrs.delete(:pubid) : nil
|
|
8
|
+
attrs[:content] ||= pubid.to_s if pubid
|
|
9
|
+
super
|
|
10
|
+
@pubid = pubid if pubid
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def content=(value)
|
|
14
|
+
super
|
|
15
|
+
@pubid = ::Pubid::Iho::Identifier.parse(value) if value
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def remove_part!
|
|
19
|
+
@pubid&.part = nil
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def remove_date!
|
|
23
|
+
@pubid&.date = nil
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def to_all_parts!
|
|
27
|
+
@pubid &&= @pubid.to_all_parts
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require_relative "doctype"
|
|
2
|
+
require_relative "comment_period"
|
|
3
|
+
require_relative "structured_identifier"
|
|
4
|
+
|
|
5
|
+
module Relaton
|
|
6
|
+
module Iho
|
|
7
|
+
class Ext < Bib::Ext
|
|
8
|
+
attribute :doctype, Doctype, default: -> { Doctype.new(content: "standard") }
|
|
9
|
+
attribute :commentperiod, CommentPeriod
|
|
10
|
+
attribute :structuredidentifier, StructuredIdentifier,
|
|
11
|
+
collection: true, initialize_empty: true
|
|
12
|
+
|
|
13
|
+
xml { map_element "commentperiod", to: :commentperiod }
|
|
14
|
+
|
|
15
|
+
key_value { map_element "commentperiod", to: :commentperiod }
|
|
16
|
+
|
|
17
|
+
def schema_version = Relaton.schema_versions["relaton-model-iho"]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
require "relaton/bib/hash_parser_v1"
|
|
2
|
+
require_relative "../iho"
|
|
3
|
+
|
|
4
|
+
module Relaton
|
|
5
|
+
module Iho
|
|
6
|
+
module HashParserV1
|
|
7
|
+
include Core::ArrayWrapper
|
|
8
|
+
include Core::DateParser
|
|
9
|
+
include Bib::HashParserV1
|
|
10
|
+
extend self
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def ext_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
|
|
15
|
+
ret[:ext] ||= {}
|
|
16
|
+
doctype_hash_to_bib ret
|
|
17
|
+
ret[:ext][:doctype] ||= Doctype.new(content: "standard")
|
|
18
|
+
ret[:ext][:subdoctype] = ret.delete(:subdoctype) if ret[:subdoctype]
|
|
19
|
+
ret[:ext][:flavor] ||= flavor(ret)
|
|
20
|
+
ics_hash_to_bib ret
|
|
21
|
+
commentperiod_hash_to_bib ret
|
|
22
|
+
structuredidentifier_hash_to_bib ret
|
|
23
|
+
ret[:ext] = Ext.new(**ret[:ext])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def structuredidentifier_hash_to_bib(ret)
|
|
27
|
+
sid = ret.dig(:ext, :structuredidentifier) || ret[:structuredidentifier]
|
|
28
|
+
return unless sid
|
|
29
|
+
|
|
30
|
+
ret[:ext]&.delete(:structuredidentifier)
|
|
31
|
+
ret.delete(:structuredidentifier)
|
|
32
|
+
ret[:ext][:structuredidentifier] =
|
|
33
|
+
array(sid).map { |s| StructuredIdentifier.new(**s) }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def commentperiod_hash_to_bib(ret)
|
|
37
|
+
cp = ret.dig(:ext, :commentperiod) || ret[:commentperiod]
|
|
38
|
+
return unless cp
|
|
39
|
+
|
|
40
|
+
ret[:ext]&.delete(:commentperiod)
|
|
41
|
+
ret.delete(:commentperiod)
|
|
42
|
+
cp[:from] = ::Date.parse(cp[:from]) if cp[:from]
|
|
43
|
+
cp[:to] = ::Date.parse(cp[:to]) if cp[:to]
|
|
44
|
+
ret[:ext][:commentperiod] = CommentPeriod.new(**cp)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# IHO editorialgroup is an array of arrays of committee entries:
|
|
48
|
+
# editorialgroup:
|
|
49
|
+
# - - committee:
|
|
50
|
+
# abbreviation: HSSC
|
|
51
|
+
# name: Hydrographic Services and Standards Committee
|
|
52
|
+
# - committee:
|
|
53
|
+
# abbreviation: IRCC
|
|
54
|
+
# name: Inter-Regional Coordination Committee
|
|
55
|
+
# committee:
|
|
56
|
+
# abbreviation: GEBCO
|
|
57
|
+
# name: JOINT IHO-IOC GUIDING COMMITTEE FOR THE GENERAL BATHYMETRIC CHART OF THE OCEANS
|
|
58
|
+
def editorialgroup_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
59
|
+
eg = ret.dig(:ext, :editorialgroup) || ret[:editorialgroup]
|
|
60
|
+
return unless eg
|
|
61
|
+
|
|
62
|
+
ret[:ext]&.delete(:editorialgroup)
|
|
63
|
+
ret.delete(:editorialgroup)
|
|
64
|
+
ret[:contributor] ||= []
|
|
65
|
+
|
|
66
|
+
array(eg).flatten.each do |entry|
|
|
67
|
+
committee = entry[:committee]
|
|
68
|
+
next unless committee
|
|
69
|
+
|
|
70
|
+
subdivision = build_subdivision(committee)
|
|
71
|
+
ret[:contributor] << Bib::Contributor.new(
|
|
72
|
+
role: [Bib::Contributor::Role.new(
|
|
73
|
+
type: "author",
|
|
74
|
+
description: [Bib::LocalizedMarkedUpString.new(content: "committee")],
|
|
75
|
+
)],
|
|
76
|
+
organization: Bib::Organization.new(
|
|
77
|
+
name: [Bib::TypedLocalizedString.new(content: "International Hydrographic Organization")],
|
|
78
|
+
abbreviation: Bib::LocalizedString.new(content: "IHO"),
|
|
79
|
+
subdivision: [subdivision],
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def build_subdivision(committee)
|
|
86
|
+
sub_divisions = []
|
|
87
|
+
if committee[:committee]
|
|
88
|
+
sub_divisions << build_subdivision(committee[:committee])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
identifiers = []
|
|
92
|
+
if committee[:abbreviation]
|
|
93
|
+
identifiers << Bib::OrganizationType::Identifier.new(
|
|
94
|
+
content: committee[:abbreviation],
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
Bib::Subdivision.new(
|
|
99
|
+
type: "technical-committee",
|
|
100
|
+
name: [Bib::TypedLocalizedString.new(content: committee[:name])],
|
|
101
|
+
identifier: identifiers,
|
|
102
|
+
subdivision: sub_divisions,
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def series_hash_to_bib(ret)
|
|
107
|
+
ret[:series] &&= array(ret[:series]).map do |s|
|
|
108
|
+
if s[:title].is_a?(Hash) && s[:title][:content].is_a?(Array)
|
|
109
|
+
s[:title] = s[:title][:content].map do |c|
|
|
110
|
+
{ type: s[:title][:type], content: c[:content], language: c[:language], script: c[:script] }.compact
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
super_series(s)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def super_series(s)
|
|
118
|
+
s[:formattedref] && s[:formattedref] = formattedref(s[:formattedref])
|
|
119
|
+
s[:title] &&= title_collection(s[:title])
|
|
120
|
+
s[:place] &&= create_place(s[:place])
|
|
121
|
+
s[:abbreviation] &&= localizedstring(s[:abbreviation])
|
|
122
|
+
s[:from] &&= ::Date.parse(s[:from])
|
|
123
|
+
s[:to] &&= ::Date.parse(s[:to])
|
|
124
|
+
Bib::Series.new(**s)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def bib_item(item)
|
|
128
|
+
ItemData.new(**item)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def create_doctype(args)
|
|
132
|
+
Doctype.new(**args)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def create_relation(rel)
|
|
136
|
+
Relation.new(**rel)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def create_docid(**args)
|
|
140
|
+
Docidentifier.new(**args)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require_relative "item_data"
|
|
2
|
+
require_relative "ext"
|
|
3
|
+
require_relative "docidentifier"
|
|
4
|
+
|
|
5
|
+
module Relaton
|
|
6
|
+
module Iho
|
|
7
|
+
class Item < Bib::Item
|
|
8
|
+
model ItemData
|
|
9
|
+
|
|
10
|
+
attribute :ext, Ext
|
|
11
|
+
attribute :docidentifier, Docidentifier, collection: true,
|
|
12
|
+
initialize_empty: true
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
require_relative "relation"
|
|
18
|
+
|
|
19
|
+
Relaton::Iho::Item.attribute :relation, Relaton::Iho::Relation,
|
|
20
|
+
collection: true, initialize_empty: true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module Iho
|
|
3
|
+
class ItemBase < Lutaml::Model::Serializable
|
|
4
|
+
include Bib::NamespaceHelper
|
|
5
|
+
|
|
6
|
+
attr_accessor :type
|
|
7
|
+
|
|
8
|
+
model ItemData
|
|
9
|
+
|
|
10
|
+
instance_exec(&Bib::ItemShared::ATTRIBUTES)
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
map_attribute "type", to: :type
|
|
14
|
+
instance_exec(&Bib::ItemShared::XML_BODY)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|