= RelatonOgc image:https://img.shields.io/gem/v/relaton-ogc.svg["Gem Version", link="https://rubygems.org/gems/relaton-ogc"] image:https://github.com/relaton/relaton-ogc/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-ogc/actions?workflow=macos"] image:https://github.com/relaton/relaton-ogc/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-ogc/actions?workflow=windows"] image:https://github.com/relaton/relaton-ogc/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-ogc/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-ogc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-ogc"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-ogc.svg["Pull Requests", link="https://github.com/relaton/relaton-ogc/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton-ogc/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-ogc/releases"] RelatonOgc 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 OGC Standards from https://raw.githubusercontent.com/opengeospatial/NamingAuthority/master/incubation/bibliography/bibliography.json, and access such metadata through the `OgcBibliographicItem` object. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-ogc' ---- And then execute: $ bundle Or install it yourself as: $ gem install relaton-ogc == Usage === Search for a standard using keywords [source,ruby] ---- require 'relaton_ogc' => true hits = RelatonOgc::OgcBibliography.search("OGC 19-025r1") => item = hits[0].fetch => # " 2022-12-04 Development of Spatial Data Infrastructures for Marine Data Management Development of Spatial Data Infrastructures for Marine Data Management https://portal.ogc.org/files/?artifact_id=88037 19-025r1 ... " ---- With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and adds flavor `ext` element. [source,ruby] ---- item.to_xml bibdata: true => " 2022-12-04 Development of Spatial Data Infrastructures for Marine Data Management Development of Spatial Data Infrastructures for Marine Data Management https://portal.ogc.org/files/?artifact_id=88037 19-025r1 ... engineering-report technical " ---- === Get code, and year [source,ruby] ---- RelatonOgc::OgcBibliography.get "OGC 19-025r1", "2019", {} [relaton-ogc] ("OGC 19-025r1") fetching... [relaton-ogc] ("OGC 19-025r1") found 19-025r1 => # # [#, @type="obp">] ---- === Create bibliographic item from YAML [source,ruby] ---- hash = YAML.load_file 'spec/fixtures/ogc_bib_item.yml' => {"id"=>"19-025r1", ... RelatonOgc::OgcBibliographicItem.from_hash hash => # nil ---- == 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). == Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/calconnenct/relaton_ogc. == License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).