Relaton::Etsi is a Ruby gem that implements the BibliographicItem model.

You can use it to retrieve metadata of ETSI Standards and access such metadata through the Relaton::Etsi::Item object.

Installation

Add this line to your application’s Gemfile:

gem 'relaton-etsi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install relaton-etsi

Usage

Search for a standard using keywords

require "relaton/etsi"
=> true

item = Relaton::Etsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")
[relaton-etsi] INFO: (ETSI GS ZSM 012 V1.1.1) Fetching from Relaton repository ...
[relaton-etsi] INFO: (ETSI GS ZSM 012 V1.1.1) Found: `ETSI GS ZSM 012 V1.1.1 (2022-12)`
=> #<Relaton::Etsi::ItemData:0x0000000125869dd8
...

XML serialization

item.to_xml
=> "<bibitem id="ETSIGSZSM012V111202212" schema-version="v1.5.6">
      <fetched>2026-01-24</fetched>
      <title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
      <uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
      <uri type="pdf">http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf</uri>
      <docidentifier type="ETSI" primary="true">ETSI GS ZSM 012 V1.1.1 (2022-12)</docidentifier>
      ...
    </bibitem>"

With argument bibdata: true it outputs XML wrapped by bibdata element and adds flavour ext element.

item.to_xml bibdata: true
=> "<bibdata schema-version="v1.5.6">
      <fetched>2026-01-24</fetched>
      <title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
      <uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
      <uri type="pdf">http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf</uri>
      <docidentifier type="ETSI" primary="true">ETSI GS ZSM 012 V1.1.1 (2022-12)</docidentifier>
      ...
      <ext schema-version="v0.1.2">
        <doctype abbreviation="GS">Group Specification</doctype>
      </ext>
    </bibdata>"

All the ETSI documents have SRC and PDF links. The gem provides a way to access these links through the RelatonBib::TypedUri object.

item.source
=>
[#<Relaton::Bib::Uri:0x0000000129ea7b38 @content="http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010", @language=nil, @locale=nil, @script=nil, @type="src">,
 #<Relaton::Bib::Uri:0x0000000129ea76d8 @content="http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf", @language=nil, @locale=nil, @script=nil, @type="pdf">]

item.source.size
=> 2

item.source[0].type
=> "src"

item.source[0].content
=> "http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010"

item.source[1].type
=> "pdf"

item.source[1].content
=> "http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf"

Create bibliographic item from XML

Relaton::Etsi::Item.from_xml File.read('spec/fixtures/bibdata.xml')
=> #<Relaton::Etsi::ItemData:0x000000012b68f660
...

Create bibliographic item from YAML

Relaton::Etsi::Item.from_yaml File.read('spec/fixtures/item.yaml')
=> #<Relaton::Etsi::ItemData:0x0000000126e34c58
...

Fetch data

This gem uses the https://www.etsi.org as a data source.

The method Relaton::Etsi::DataFetcher.fetch(output: "data", format: "yaml") fetches all the documents from the data source 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, bibxml (default yaml).

require 'relaton/etsi/data_fetcher'
=> true

Relaton::Etsi::DataFetcher.fetch
Started at: 2023-12-05 22:44:32 -0500
Stopped at: 2023-12-05 22:47:55 -0500
Done in: 204 sec.
=> nil

Logging

Relaton::Etsi uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the 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 update the index test fixture (used by tests), run rake spec:update_index. This downloads the latest index-v1.zip from the relaton-data-etsi repository.

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/relaton/relaton-etsi.

License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).