= RelatonIeee
RelatonIeee is a Ruby gem that implements the https://github.com/relaton/relaton-model-ieee#ieee-bibliographic-item-model[IeeeBibliographicItem model].
You can use it to retrieve metadata of IEEE Standards from standards.ieee.org, and access such metadata through the IeeeBibliographicItem
object.
== Installation
Add this line to your application's Gemfile:
And then execute:
$ bundle install
Or install it yourself as:
$ gem install relaton-ieee
== Usage
=== Search for a standard using keywords
require 'relaton_ieee' => true
=== XML serialization
item.to_xml
=> "
<title type="main" format="text/plain">IEEE Standard for Inertial Sensor Terminology</title>
<uri type="src">https://ieeexplore.ieee.org/document/8863799</uri>
<docidentifier type="IEEE" primary="true">IEEE 528-2019</docidentifier>
...
</bibitem>"
With argument bibdata: true
it ouputs XML wrapped by bibdata
element and adds flavor ext
element.
item.to_xml bibdata: true
=> "
<title type="main" format="text/plain">IEEE Standard for Inertial Sensor Terminology</title>
<uri type="src">https://ieeexplore.ieee.org/document/8863799</uri>
<docidentifier type="IEEE" primary="true">IEEE 528-2019</docidentifier>
...
<ext schema-version="v1.0.1">
<editorialgroup>
<committee>Gyro Accelerometer Panel of the IEEE Aerospace and Electronic Systems Society</committee>
</editorialgroup>
...
</ext>
</bibdata>"
IEEE 528-2019
=> #<RelatonIeee::IeeeBibliographicItem:0x007fceb52a6e40
...=== Typed links
Each IEEE document has src
type link.
hash = YAML.load_file 'spec/fixtures/ieee_528_2019.yaml' => {"id"=>"IEEE528-2019", ...
=== Fetch data
There is an IEEE dataset https://github.com/relaton/ieee-rawbib which can be converted into BibXML/BibYAML formats. The dataset needs to be placed into the local directory.
The method RelatonIeee::DataFetcher.fetch(output: "data", format: "yaml")
converts all the documents from the local ieee-rawbib
directory and saves them to the ./data
folder in YAML format.
Arguments:
output
- folder to save documents (default './data').format
- the format in which the documents are saved. Possible formats are: yaml
, xml
(default yaml
).=== Logging
RelatonIeee 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/relaton/relaton_ieee.
== License
The gem is available as open source under the terms of the MIT License.