= RelatonW3c RelatonW3c 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 W3C Standards from https://w3.org, and access such metadata through the `W3cBibliographicItem` object. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-w3c' ---- And then execute: $ bundle install Or install it yourself as: $ gem install relaton-w3c == Usage === Search for a standard using keywords [source,ruby] ---- require 'relaton_w3c' => true hits = RelatonW3c::W3cBibliography.search("W3C JSON-LD 1.1") => item = hits[0].fetch => # " 2020-04-07 JSON-LD 1.1 A JSON-based Serialization for Linked Data https://www.w3.org/TR/2020/CR-json-ld11-20200316/ 2020 ... " ---- With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and adds flavour `ext` element. [source,ruby] ---- item.to_xml bibdata: true => " 2020-04-07 JSON-LD 1.1 A JSON-based Serialization for Linked Data https://www.w3.org/TR/2020/CR-json-ld11-20200316/ 2020 ... candidateRecommendation " ---- === Get document by title [source,ruby] ---- RelatonW3c::W3cBibliography.get "W3C JSON-LD 1.1" [relaton-w3c] ("W3C JSON-LD 1.1") fetching... [relaton-w3c] ("W3C JSON-LD 1.1") found JSON-LD 1.1 => # # # # # {"title"=> [{"type"=>"main", "content"=>"JSON-LD 1.1", "language"=>"en", "script"=>"Latn", "format"=>"text/plain"}, ... bib_hash = RelatonW3c::HashConverter.hash_to_bib hash => {:title=> [{:type=>"main", :content=>"JSON-LD 1.1", :language=>"en", :script=>"Latn", :format=>"text/plain"}, ... RelatonW3c::W3cBibliographicItem.new bib_hash => #