RelatonPlateau is a Ruby gem that implements the 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:
gem 'relaton-plateau'
And then execute:
$ bundle
Or install it yourself as:
$ gem install relaton-plateau
Usage
Fetching
require "relaton/plateau"
bib = Relaton::Plateau::Bibliography.get("PLATEAU Handbook #00 第1.0版")
[relaton-plateau] INFO: (PLATEAU Handbook #00 第1.0版) Fetching ...
[relaton-plateau] INFO: (PLATEAU Handbook #00 第1.0版) Found `PLATEAU Handbook #00 第1.0版`
=> #<Relaton::Plateau::BibItem:0x0000000104afbcc0
...
Serializing
XML
# Render bibitem
puts bib.to_xml
<bibitem id="PLATEAUHandbook#00第1.0版" type="standard" schema-version="v1.2.9">
<title type="main" format="text/plain" language="ja" script="Jpan">3D
YAML
puts bib.to_hash.to_yaml
---
schema-version: v1.2.9
id: PLATEAUHandbook#00第1.0版
title:
- content: 3D
BibXML
puts bib.to_bibxml
<reference anchor="PLATEAU.Handbook.#00.第1.0版">
<front>
<title>3D
AsciiBib
puts bib.to_asciibib
[bibitem]
== {blank}
id:: PLATEAUHandbook#00第1.0版
title::
title.type:: main
title.content:: 3D
Fetching data
Two datasets are available for fetching: platau-handbooks and plateau-technical-reports. The data is stored in the data directory. The format can be xml, 'yaml', or bibxml.
Relaton::Plateau::Fetcher.fetch("plateau-handbooks", output: "dir", format: "xml")
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-plateau
License
The gem is available as open source under the terms of the MIT license.