= Relaton for UN documents
RelatonCalconnect 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 Calconnect Standards from https://standards.calconnect.org, and access such metadata through the CcBibliographicItem
object.
== Installation
Add this line to your application's Gemfile:
And then execute:
$ bundle
Or install it yourself as:
$ gem install relaton-un
== Usage
=== Search for a standard using keywords
require 'relaton_un' => true
hits = RelatonUn::UnBibliography.search("TRADE/CEFACT/2004/32") => <RelatonUn::HitCollection:0x007fc4e6ec2018 @ref=TRADE/CEFACT/2004/32 @fetched=false>
=== XML serialization
item.to_xml
=> "
...
</bibitem>"
bibdata: true
it outputs XML wrapped by bibdata
element and adds flavor ext
element.
[source,ruby]item.to_xml bibdata: true
=> "
...
<ext schema-version="v1.0.0">
<editorialgroup>
<committee>Committee on Trade</committee>
<committee>Centre for Trade Facilitation and Electronic Business</committee>
</editorialgroup>
...
</ext>
</bibdata>"
TRADE/CEFACT/2004/32
=> #<RelatonUn::UnBibliographicItem:0x007fdc5f1c3a20
...=== Typed links
UN documens may have pdf
and word
link types.
item.link => [#<RelatonBib::TypedUri:0x00007f81af368250 @content=#<Addressable::URI:0x9ec URI:https://documents-dds-ny.un.org/doc/UNDOC/GEN/G04/306/83/pdf/G0430683.pdf?OpenElement>, @type="pdf">,
hash = YAML.load_file 'spec/fixtures/un_bib.yaml' => {"id"=>"TRADE/CEFACT/2004/32", ...
bib_hash = RelatonUn::HashConverter.hash_to_bib hash => {:id=>"TRADE/CEFACT/2004/32", ...
=== Logging
RelatonUn uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
== 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.
== Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/calconnect/relaton_un.
== License
The gem is available as open source under the terms of the MIT License.