= RelatonIso: retrieve ISO Standards for bibliographic use using the BibliographicItem model image:https://img.shields.io/gem/v/relaton-iso.svg["Gem Version", link="https://rubygems.org/gems/relaton-iso"] image:https://github.com/relaton/relaton-iso/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iso/actions?workflow=macos"] image:https://github.com/relaton/relaton-iso/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-iso/actions?workflow=windows"] image:https://github.com/relaton/relaton-iso/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-iso/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-iso/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-iso"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iso.svg["Pull Requests", link="https://github.com/relaton/relaton-iso/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton/releases"] RelatonIso is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]. You can use it to retrieve metadata of ISO Standards from https://www.iso.org, and access such metadata through the `IsoBibliographicItem` object. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-iso' ---- And then execute: $ bundle Or install it yourself as: $ gem install relaton-iso == Usage === Search for standards using keywords [source,ruby] ---- require 'relaton_iso' => true hit_collection = RelatonIso::IsoBibliography.search("ISO 19115") => hit_collection.first => item = hit_collection[2].fetch => # [#, #] item.docidentifier.detect { |di| di.type == "URN" }.id => "urn:iso:std:iso-ts:ts:19115:-3:stage-90.92:ed-1:en,fr" ---- === Fetch document by reference and year [source,ruby] ---- item = RelatonIso::IsoBibliography.get "ISO 19115:2003" [relaton-iso] ("ISO 19115:2003") fetching... [relaton-iso] ("ISO 19115:2003") found ISO 19115:2003 => # # "ISO 19115:2003" ---- === Fetch non-part document [source,ruby] ---- item = RelatonIso::IsoBibliography.get "ISO 19115" [relaton-iso] ("ISO 19115") fetching... [relaton-iso] ("ISO 19115") found ISO 19115:2003 => # "ISO 19115:2003" ---- === Fetch part document [source,ruby] ---- item = RelatonIso::IsoBibliography.get "ISO 19115-1" [relaton-iso] ("ISO 19115-1") fetching... [relaton-iso] ("ISO 19115-1") found ISO 19115-1:2014 => # "ISO 19115-1:2014" ---- === Fetch all-parts document [source,ruby] ---- item = RelatonIso::IsoBibliography.get "ISO 19115 (all parts)" [relaton-iso] ("ISO 19115") fetching... [relaton-iso] ("ISO 19115") found ISO 19115 (all parts) => # # "ISO 19115 (all parts)" item = RelatonIso::IsoBibliography.get "ISO 19115-1 (all parts)" [relaton-iso] ("ISO 19115-1") fetching... [relaton-iso] ("ISO 19115-1") found ISO 19115 (all parts) => # # "ISO 19115 (all parts)" ---- === Search for ISO/IEC Directives The ISO/IEC Derectives are stored in a static cache in a relaton gem. It needs to use the relaton gem to fetch the ISO/IEC Directives. Folloving reaferences are allowed to fetch: - ISO/IEC DIR 1 - Procedures for the technical work - ISO/IEC DIR 1 IEC SUP - Procedures for the technical work – Procedures specific to IEC - ISO/IEC DIR 1 ISO SUP - Consolidated ISO Supplement -- Procedures specific to ISO - ISO/IEC DIR 2 IEC - Principles and rules for the structure and drafting of ISO and IEC documents - ISO/IEC DIR 2 ISO - Principles and rules for the structure and drafting of ISO and IEC documents - ISO/IEC DIR IEC SUP - Procedures specific to IEC - ISO/IEC DIR JTC 1 SUP - Procedures specific to JTC 1 === XML serialization Possible options: - *bibdata* - If true then wrapp item with _bibdata_ element and add _ext_ element. - *note* - Array of hashes `{ text: "Note", type: "note" }`. These notes will be added to XML. [source,ruby] ---- item.to_xml " 2020-09-11 Geographic information Metadata Part 3: XML schema implementation for fundamental concepts Geographic information - Metadata - Part 3: XML schema implementation for fundamental concepts Information géographique Métadonnées Partie 3: Mise en oeuvre par des schémas XML Information géographique - Métadonnées - Partie 3: Mise en oeuvre par des schémas XML https://www.iso.org/standard/32579.html https://www.iso.org/obp/ui/#!iso:std:32579:en https://www.iso.org/contents/data/standard/03/25/32579.detail.rss ISO/TS 19115-3:2016 urn:iso:std:iso-ts:ts:19115:-3:stage-90.92:ed-1:en,fr ... " item.to_xml bibdata: true =>" ... technical-specification ISO/TC 211Geographic information/Geomatics 35.240.70 IT applications in science ISO/TS 19115 " item.to_xml note: [{ text: "Note", type: "note" }] =>" ... Note ... " ---- === Get specific language [source,ruby] ---- item.title lang: 'en' => [#, @type="title-intro">, #, @type="title-main">, #, @type="title-part">, #, @type="main">] item.title lang: 'fr' => [#, @type="title-intro">, #, @type="title-main">, #, @type="title-part">, #, @type="main">] item.abstract lang: 'en' => # ---- === Typed links Each ISO document has `src` type link and optional `obp`, `rss`, and `pub` link types. [source,ruby] ---- item.link => [#, @type="src">, #, @type="obp">, #, @type="rss">] ---- == Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). == Exceptional Citations This gem retrieves bibliographic descriptions of ISO documents by doing searches on the ISO website, http://www.iso.org, and screenscraping the document that matches the queried document identifier. The following documents are not returned as search results from the ISO website, and the gem returns manually generated references to them. * `IEV`: used in the metanorma-iso gem to reference Electropedia entries generically. Is resolved to an "all parts" reference to IEC 60050, which in turn is resolved into the specific documents cited by their top-level clause. == Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-iso == License The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT license].