relaton / relaton-plateau

Relaton for Project PLATEAU by MLIT
0 stars 1 forks source link

= RelatonPlateau: retrieve Project PLATEAU Standards for bibliographic use using the BibliographicItem model

image:https://img.shields.io/gem/v/relaton-plateau.svg["Gem Version", link="https://rubygems.org/gems/relaton-plateau"] image:https://github.com/relaton/relaton-plateau/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-plateau/actions?workflow=macos"] image:https://github.com/relaton/relaton-plateau/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-plateau/actions?workflow=windows"] image:https://github.com/relaton/relaton-plateau/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-plateau/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-plateau/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-plateau"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-plateau.svg["Pull Requests", link="https://github.com/relaton/relaton-plateau/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-plateau/releases"]

RelatonPlateau is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-plateau#iso-bibliographic-item[BibliographicItem model].

You can use it to retrieve metadata of Plateau Standards from GitHub repositori, and access such metadata through the BibliographicItem object.

== Installation

Add this line to your application's Gemfile:

[source,ruby]

gem 'relaton-plateau'

And then execute:

$ bundle

Or install it yourself as:

$ gem install relaton-plateau

== Usage

=== Fetching

==== Fetching Technical Reports

[source,ruby]

require "relaton/plateau" Relaton::Plateau::Bibliography.get("PLATEAU Technical Report #00") [relaton-plateau] INFO: (PLATEAU Technical Report #00) Fetching ... [relaton-plateau] INFO: (PLATEAU Technical Report #00) Found PLATEAU Technical Report #00 1.0 => #<Relaton::Plateau::BibItem:0x00000001238cfc98 ...

==== Fetching Handbooks unversioned

[source,ruby]

Relaton::Plateau::Bibliography.get("PLATEAU Handbook #00") [relaton-plateau] INFO: (PLATEAU Handbook #00) Fetching ... [relaton-plateau] INFO: (PLATEAU Handbook #00) Found PLATEAU Handbook #00 => #<Relaton::Plateau::BibItem:0x00000001238c7598 ...

==== Fetching Handbooks versioned

[source,ruby]

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

[source,ruby]

Render bibitem

puts bib.to_xml

2024-08-25 3D都市モデルの導入ガイダンス Guidance on the Installation for 3D City Model https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf PLATEAU Handbook #00 1.0 Handbook #00 1.0 2021-03-26 国土交通省 Japanese Ministry of Land, Infrastructure, Transport and Tourism MLIT 1.0 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス

Render bibdata

puts bib.to_xml(bibdata: true)

2024-08-25 3D都市モデルの導入ガイダンス Guidance on the Installation for 3D City Model https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf PLATEAU Handbook #00 1. Handbook #00 1.0 2021-03-26 国土交通省 Japanese Ministry of Land, Infrastructure, Transport and Tourism MLIT 1.0 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス handbook PLATEAU 00 1.0 18381880

==== YAML [source,ruby]

puts bib.to_hash.to_yaml

schema-version: v1.2.9 id: PLATEAUHandbook#001.0 title:

==== BibXML

[source,ruby]

puts bib.to_bibxml

3D都市モデルの導入ガイダンス 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス

==== AsciiBib

[source,ruby]

puts bib.to_asciibib [%bibitem] == {blank} id:: PLATEAUHandbook#001.0 title:: title.type:: main title.content:: 3D都市モデルの導入ガイダンス title.language:: ja title.script:: Jpan title.format:: text/plain title:: title.type:: main title.content:: Guidance on the Installation for 3D City Model title.language:: en title.script:: Latn title.format:: text/plain type:: standard docid.type:: PLATEAU docid.primary:: true docid.id:: PLATEAU Handbook #00 1.0 edition.content:: 1.0 edition.number:: 1.0 date.type:: published date.on:: 2021-03-26 abstract.content:: 地方自治体担当者や民間事業者等に向けた 3D都市モデル導入のためのガイダンス abstract.language:: ja abstract.script:: Jpan abstract.format:: text/plain link.type:: pdf link.content:: https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_doc_0000_ver01.pdf doctype.type:: handbook structured_identifier.docnumber:: 00 structured_identifier.agency:: PLATEAU structured_identifier.type:: Handbook structured_identifier.edition:: 1.0 cover.image.src:: https://www.mlit.go.jp//plateau/uploads/2022/06/1@2x.jpg cover.image.mimetype:: image/jpeg filesize:: 18381880

=== 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.

[source,ruby]

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 https://opensource.org/licenses/MIT[MIT license].