= Relaton3gpp
Relaton3gpp 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:
And then execute:
$ bundle install
Or install it yourself as:
$ gem install relaton-3gpp
== Usage
=== Search for a standard using keywords
require "relaton_3gpp" => true
3GPP TR 00.01U:UMTS/3.0.0
=> #<Relaton3gpp::BibliographicItem:0x00007f92d94264e0
...=== XML serialization
item.to_xml
=> "
<title type="main" format="text/plain">Work programme for the standardization of Universal Mobile Telecommunications System (UMTS)</title>
<uri type="src">http://www.3gpp.org/ftp/Specs/archive/00_series/00.01U/0001U-300.zip</uri>
<docidentifier type="3GPP" primary="true">3GPP TR 00.01U:UMTS/3.0.0</docidentifier>
<docnumber>TR 00.01U:UMTS/3.0.0</docnumber>
...
</bibitem>"
With argument bibdata: true
it outputs XML wrapped by bibdata
element and adds flavor ext
element.
item.to_xml bibdata: true
=> "
<title type="main" format="text/plain">Work programme for the standardization of Universal Mobile Telecommunications System (UMTS)</title>
<uri type="src">http://www.3gpp.org/ftp/Specs/archive/00_series/00.01U/0001U-300.zip</uri>
<docidentifier type="3GPP" primary="true">3GPP TR 00.01U:UMTS/3.0.0</docidentifier>
<docnumber>TR 00.01U:UMTS/3.0.0</docnumber>
...
<ext schema-version="v1.0.1">
<doctype>TR</doctype>
<editorialgroup>
<technical-committee type="prime">SMG5</technical-committee>
</editorialgroup>
<radiotechnology>3G</radiotechnology>
<release>
<version2G>3</version2G>
<version3G>3</version3G>
<defunct>true</defunct>
<freeze-meeting>SMG-28</freeze-meeting>
<freeze-stage1-meeting>SMG-28</freeze-stage1-meeting>
<freeze-stage2-meeting>SMG-28</freeze-stage2-meeting>
<freeze-stage3-meeting>SMG-28</freeze-stage3-meeting>
<close-meeting>SP-28</close-meeting>
<project-end>1999-02-12</project-end>
</release>
</ext>
</ext>
</bibdata>"
=== Typed links
Some 3GPP documents have src
type link.
item.link.first.type => "src"
hash = YAML.load_file 'spec/fixtures/bib.yaml' => {"schema-version"=>"v1.2.1", "id"=>"3GPPTR00.01U-UMTS/3.0.0", ...
bib_hash = Relaton3gpp::HashConverter.hash_to_bib hash => {:"schema-version"=>"v1.2.1", :id=>"3GPPTR00.01U-UMTS/3.0.0", ...
=== Fetch data
There is a 3GPP dataset ftp://www.3gpp.org/Information/Databases/[latest *.csv] which can be converted into RelatonXML/BibXML/BibYAML formats.
The method Relaton3GPP::DataFetcher.fetch(output: "data", format: "yaml")
converts all the documents from the dataset and save them to the ./data
folder in YAML format.
Arguments:
source
- a data source name. Possible values are: status-smg-3GPP
and status-smg-3GPP-force
. The first one only downloads a dataset if it's updated. The second one forces this gem to download the latest dataset.output
- folder to save documents (default './data').format
- a format in which the documents are saved. Possible formats are: yaml
, xml
, bibxml
(default yaml
).=== Logging
Relaton3gpp 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 the created tag, and push the .gem
file to rubygems.org.
== Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/relaton/relaton_3gpp.
== License
The gem is available as open source under the terms of the MIT License.