Module: RelatonOgc::Scrapper
- Defined in:
- lib/relaton_ogc/scrapper.rb
Constant Summary collapse
- TYPES =
{ "AS" => { type: "abstract-specification-topic" }, "BP" => { type: "best-practice", subtype: "general" }, "CAN" => { type: "standard", subtype: "general", stage: "draft" }, # "CC" => "conformance-class", "CR" => { type: "change-request-supporting-document" }, "CP" => { type: "community-practice" }, "CS" => { type: "community-standard" }, "DP" => { type: "discussion-paper" }, "DP-Draft" => { type: "discussion-paper", stage: "draft" }, "IPR" => { type: "engineering-report" }, "IS" => { type: "standard", subtype: "implementation" }, "ISC" => { type: "standard", subtype: "implementation" }, "ISx" => { type: "standard", subtype: "extension" }, "Notes" => { type: "other" }, "ORM" => { type: "reference-model" }, "PC" => { type: "standard", subtype: "profile" }, "PER" => { type: "engineering-report" }, "POL" => { type: "standard" }, # "POLNTS" => "policy-name-type-specification", "Primer" => { type: "other" }, "Profile" => { type: "standard", subtype: "profile" }, "RFC" => { type: "standard", stage: "draft" }, # "Retired" => "retired", "SAP" => { type: "standard", subtype: "profile" }, # "TS" => "test-suite", # @PENDING "WhitePaper" => { type: "white-paper" }, "ATB" => { type: "other" }, "RP" => { type: "discussion-paper" }, }.freeze
Class Method Summary collapse
-
.parse_page(hit) ⇒ RelatonOgc::OrcBibliographicItem
papam hit [Hash].
Class Method Details
.parse_page(hit) ⇒ RelatonOgc::OrcBibliographicItem
papam hit [Hash]
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/relaton_ogc/scrapper.rb', line 37 def parse_page(hit) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength type = fetch_type(hit["type"]) OgcBibliographicItem.new( type: "standard", title: fetch_title(hit["title"]), docid: fetch_docid(hit["identifier"]), link: fetch_link(hit), doctype: fetch_doctype(type[:type]), subdoctype: type[:subtype], docstatus: fetch_status(type[:stage]), edition: fetch_edition(hit["identifier"]), abstract: fetch_abstract(hit["description"]), contributor: fetch_contributor(hit), language: ["en"], script: ["Latn"], date: fetch_date(hit["date"]), editorialgroup: fetch_editorialgroup, ) end |