relaton-etsi 1.20.2 → 2.0.0.pre.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CLAUDE.md +37 -35
- data/README.adoc +35 -47
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1000 -375
- data/grammars/relaton-etsi.rng +0 -1
- data/lib/relaton/etsi/bibdata.rb +9 -0
- data/lib/relaton/etsi/bibitem.rb +9 -0
- data/lib/relaton/etsi/bibliography.rb +46 -0
- data/lib/relaton/etsi/data_fetcher.rb +84 -0
- data/lib/relaton/etsi/data_parser.rb +153 -0
- data/lib/relaton/etsi/doctype.rb +30 -0
- data/lib/relaton/etsi/ext.rb +27 -0
- data/lib/relaton/etsi/item.rb +15 -0
- data/lib/relaton/etsi/item_data.rb +6 -0
- data/lib/relaton/etsi/processor.rb +69 -0
- data/lib/relaton/etsi/pubid.rb +37 -0
- data/lib/relaton/etsi/status.rb +13 -0
- data/lib/relaton/etsi/util.rb +8 -0
- data/lib/relaton/etsi/version.rb +7 -0
- data/lib/relaton/etsi.rb +25 -0
- metadata +37 -23
- data/lib/relaton_etsi/bibliographic_item.rb +0 -79
- data/lib/relaton_etsi/bibliography.rb +0 -48
- data/lib/relaton_etsi/data_fetcher.rb +0 -59
- data/lib/relaton_etsi/data_parser.rb +0 -97
- data/lib/relaton_etsi/document_type.rb +0 -46
- data/lib/relaton_etsi/hash_converter.rb +0 -27
- data/lib/relaton_etsi/processor.rb +0 -61
- data/lib/relaton_etsi/pubid.rb +0 -35
- data/lib/relaton_etsi/util.rb +0 -6
- data/lib/relaton_etsi/version.rb +0 -5
- data/lib/relaton_etsi/xml_parser.rb +0 -48
- data/lib/relaton_etsi.rb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af47d7cc7e2e22171fad2500c4b5018c06afa0efe05a3a613980a9d7eee72257
|
|
4
|
+
data.tar.gz: e48dc2964425154e9bedff060231c66d490435a450b1ddc1216fe2d1ec7db893
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 125bdcdc240940e0717bb633c200af84b978c6d700e887505fd7a285ec917a18793ac0506de389ccda329f685e9d2871431ccf1cc2ed8c77ddfa0c1e7b952d57
|
|
7
|
+
data.tar.gz: 901a093a9f9e7b443fb3e6270c6f1eb4fa8bcea76a4e7deea14889c4d013b94e08f16c6789a68bae32960e8be7cab3fe8885c8474528c02b78772a32d508b729
|
data/.rubocop.yml
CHANGED
data/CLAUDE.md
CHANGED
|
@@ -2,66 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
relaton-etsi is a Ruby gem that retrieves ETSI (European Telecommunications Standards Institute) standards metadata using the Relaton bibliographic item model. It fetches data from the ETSI website and the relaton-data-etsi GitHub repository.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
12
|
# Install dependencies
|
|
9
13
|
bin/setup
|
|
10
14
|
|
|
11
15
|
# Run all tests
|
|
12
|
-
|
|
16
|
+
rake spec
|
|
13
17
|
|
|
14
|
-
# Run a
|
|
15
|
-
|
|
18
|
+
# Run a specific test file
|
|
19
|
+
rspec spec/relaton/etsi/bibliography_spec.rb
|
|
16
20
|
|
|
17
|
-
# Run a
|
|
18
|
-
|
|
21
|
+
# Run a specific test by line number
|
|
22
|
+
rspec spec/relaton/etsi/bibliography_spec.rb:15
|
|
19
23
|
|
|
20
24
|
# Run linter
|
|
21
|
-
|
|
25
|
+
rake rubocop
|
|
22
26
|
|
|
23
|
-
#
|
|
24
|
-
bundle exec rubocop -a
|
|
25
|
-
|
|
26
|
-
# Interactive console for experimentation
|
|
27
|
+
# Interactive console
|
|
27
28
|
bin/console
|
|
29
|
+
|
|
30
|
+
# Install gem locally
|
|
31
|
+
bundle exec rake install
|
|
28
32
|
```
|
|
29
33
|
|
|
30
34
|
## Architecture
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
The codebase is transitioning from `RelatonEtsi` namespace to `Relaton::Etsi` namespace.
|
|
33
37
|
|
|
34
|
-
###
|
|
35
|
-
- `relaton-bib` - Base bibliographic classes that this gem extends
|
|
36
|
-
- `relaton-index` - Document indexing for search functionality
|
|
38
|
+
### New Architecture (lib/relaton/etsi/)
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
Uses Lutaml for serialization:
|
|
41
|
+
- `Item` - base bibliographic item inheriting from `Bib::Item`
|
|
42
|
+
- `Bibitem` - for `<bibitem>` XML output (includes `Bib::BibitemShared`)
|
|
43
|
+
- `Bibdata` - for `<bibdata>` XML output (includes `Bib::BibdataShared`)
|
|
44
|
+
- `Ext` - ETSI-specific extension data (marker, frequency, mandate, custom_collection)
|
|
45
|
+
- `Doctype` - ETSI document type with abbreviations (EN, ES, GS, TS, TR, etc.)
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
- `Bibliography` - Main API: `RelatonEtsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")` searches the Relaton index and returns a `BibliographicItem`
|
|
42
|
-
- `Processor` - Relaton integration point, registered with the main relaton gem
|
|
47
|
+
### Legacy Architecture (lib/relaton_etsi/)
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
- `
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
49
|
+
- `BibliographicItem` - extends `RelatonBib::BibliographicItem`
|
|
50
|
+
- `XMLParser` - parses XML into bibliographic items
|
|
51
|
+
- `HashConverter` - converts hashes to bibliographic items
|
|
52
|
+
- `DocumentType` - document type with type/abbreviation mapping
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
- `DataFetcher` - Bulk fetches all documents from www.etsi.org CSV export
|
|
51
|
-
- `DataParser` - Transforms CSV rows into `BibliographicItem` objects
|
|
54
|
+
### Core Components
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
- `
|
|
55
|
-
- `
|
|
56
|
+
- `Bibliography` - searches and retrieves standards from relaton-data-etsi index
|
|
57
|
+
- `DataFetcher` - fetches all documents from ETSI website CSV export
|
|
58
|
+
- `DataParser` - parses CSV rows into bibliographic items
|
|
59
|
+
- `Processor` - Relaton processor for integration with the relaton ecosystem
|
|
56
60
|
|
|
57
61
|
### Data Flow
|
|
58
|
-
1. `Bibliography.search` queries the GitHub-hosted index (`relaton-data-etsi`)
|
|
59
|
-
2. Matching documents are fetched as YAML from the data repository
|
|
60
|
-
3. `HashConverter` transforms YAML to constructor arguments
|
|
61
|
-
4. `BibliographicItem` is instantiated and returned
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
1. `Bibliography.get(ref)` searches the relaton-data-etsi index
|
|
64
|
+
2. Fetches YAML from GitHub, converts to `Item` using `from_yaml`
|
|
65
|
+
3. `DataFetcher.fetch` pulls CSV from etsi.org, parses with `DataParser`, saves to output folder
|
|
64
66
|
|
|
65
67
|
## Testing
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
Uses RSpec with VCR for HTTP interaction recording. VCR cassettes are in `spec/vcr_cassettes/`. When tests make new HTTP requests, VCR will record them.
|
data/README.adoc
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Etsi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Relaton::Etsi is a Ruby gem that implements the https://github.com/relaton/relaton-models#bibliographic-item[BibliographicItem model].
|
|
4
4
|
|
|
5
|
-
You can use it to retrieve metadata of ETSI Standards and access such metadata through the `
|
|
5
|
+
You can use it to retrieve metadata of ETSI Standards and access such metadata through the `Relaton::Etsi::Item` object.
|
|
6
6
|
|
|
7
7
|
== Installation
|
|
8
8
|
|
|
@@ -27,13 +27,13 @@ Or install it yourself as:
|
|
|
27
27
|
|
|
28
28
|
[source,ruby]
|
|
29
29
|
----
|
|
30
|
-
require
|
|
30
|
+
require "relaton/etsi"
|
|
31
31
|
=> true
|
|
32
32
|
|
|
33
|
-
item =
|
|
34
|
-
[relaton-etsi] (ETSI GS ZSM 012 V1.1.1) Fetching from Relaton repository ...
|
|
35
|
-
[relaton-etsi] (ETSI GS ZSM 012 V1.1.1) Found: `ETSI GS ZSM 012 V1.1.1 (2022-12)`
|
|
36
|
-
=> #<
|
|
33
|
+
item = Relaton::Etsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")
|
|
34
|
+
[relaton-etsi] INFO: (ETSI GS ZSM 012 V1.1.1) Fetching from Relaton repository ...
|
|
35
|
+
[relaton-etsi] INFO: (ETSI GS ZSM 012 V1.1.1) Found: `ETSI GS ZSM 012 V1.1.1 (2022-12)`
|
|
36
|
+
=> #<Relaton::Etsi::ItemData:0x0000000125869dd8
|
|
37
37
|
...
|
|
38
38
|
----
|
|
39
39
|
|
|
@@ -42,9 +42,9 @@ item = RelatonEtsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")
|
|
|
42
42
|
[source,ruby]
|
|
43
43
|
----
|
|
44
44
|
item.to_xml
|
|
45
|
-
=> "<bibitem id="
|
|
46
|
-
<fetched>
|
|
47
|
-
<title
|
|
45
|
+
=> "<bibitem id="ETSIGSZSM012V111202212" schema-version="v1.4.1">
|
|
46
|
+
<fetched>2026-01-24</fetched>
|
|
47
|
+
<title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
|
|
48
48
|
<uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
|
|
49
49
|
<uri type="pdf">http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf</uri>
|
|
50
50
|
<docidentifier type="ETSI" primary="true">ETSI GS ZSM 012 V1.1.1 (2022-12)</docidentifier>
|
|
@@ -55,74 +55,59 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
|
55
55
|
[source,ruby]
|
|
56
56
|
----
|
|
57
57
|
item.to_xml bibdata: true
|
|
58
|
-
=> "<bibdata schema-version="v1.
|
|
59
|
-
<fetched>
|
|
60
|
-
<title
|
|
58
|
+
=> "<bibdata schema-version="v1.4.1">
|
|
59
|
+
<fetched>2026-01-24</fetched>
|
|
60
|
+
<title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
|
|
61
61
|
<uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
|
|
62
62
|
<uri type="pdf">http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf</uri>
|
|
63
63
|
<docidentifier type="ETSI" primary="true">ETSI GS ZSM 012 V1.1.1 (2022-12)</docidentifier>
|
|
64
64
|
...
|
|
65
65
|
<ext schema-version="v0.0.3">
|
|
66
66
|
<doctype abbreviation="GS">Group Specification</doctype>
|
|
67
|
-
<editorialgroup>
|
|
68
|
-
<technical-committee>Zero-touch network and Service Management</technical-committee>
|
|
69
|
-
</editorialgroup>
|
|
70
67
|
</ext>
|
|
71
68
|
</bibdata>"
|
|
72
69
|
----
|
|
73
70
|
|
|
74
|
-
=== Typed links
|
|
71
|
+
=== Typed source links
|
|
75
72
|
|
|
76
73
|
All the ETSI documents have SRC and PDF links. The gem provides a way to access these links through the `RelatonBib::TypedUri` object.
|
|
77
74
|
|
|
78
75
|
[source,ruby]
|
|
79
76
|
----
|
|
80
|
-
item.
|
|
81
|
-
=>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
#<RelatonBib::TypedUri:0x00000001083da690
|
|
87
|
-
@content=#<Addressable::URI:0xb54 URI:http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf>,
|
|
88
|
-
@language=nil,
|
|
89
|
-
@script=nil,
|
|
90
|
-
@type="pdf">]
|
|
91
|
-
|
|
92
|
-
item.link.size
|
|
77
|
+
item.source
|
|
78
|
+
=>
|
|
79
|
+
[#<Relaton::Bib::Uri:0x0000000129ea7b38 @content="http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010", @language=nil, @locale=nil, @script=nil, @type="src">,
|
|
80
|
+
#<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">]
|
|
81
|
+
|
|
82
|
+
item.source.size
|
|
93
83
|
=> 2
|
|
94
84
|
|
|
95
|
-
item.
|
|
85
|
+
item.source[0].type
|
|
96
86
|
=> "src"
|
|
97
87
|
|
|
98
|
-
item.
|
|
88
|
+
item.source[0].content
|
|
99
89
|
=> "http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010"
|
|
100
90
|
|
|
101
|
-
item.
|
|
91
|
+
item.source[1].type
|
|
102
92
|
=> "pdf"
|
|
103
93
|
|
|
104
|
-
item.
|
|
94
|
+
item.source[1].content
|
|
105
95
|
=> "http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf"
|
|
106
96
|
----
|
|
107
97
|
|
|
108
98
|
=== Create bibliographic item from XML
|
|
109
99
|
[source,ruby]
|
|
110
100
|
----
|
|
111
|
-
|
|
112
|
-
=> #<
|
|
101
|
+
Relaton::Etsi::Item.from_xml File.read('spec/fixtures/bibdata.xml')
|
|
102
|
+
=> #<Relaton::Etsi::ItemData:0x000000012b68f660
|
|
113
103
|
...
|
|
114
104
|
----
|
|
115
105
|
|
|
116
106
|
=== Create bibliographic item from YAML
|
|
117
107
|
[source,ruby]
|
|
118
108
|
----
|
|
119
|
-
|
|
120
|
-
=>
|
|
121
|
-
"id"=>"ETSIEN319532-4V1.3.02023-10",
|
|
122
|
-
...
|
|
123
|
-
|
|
124
|
-
RelatonEtsi::BibliographicItem.from_hash hash
|
|
125
|
-
=> #<RelatonEtsi::BibliographicItem:0x000000010a76cf90
|
|
109
|
+
Relaton::Etsi::Item.from_yaml File.read('spec/fixtures/item.yaml')
|
|
110
|
+
=> #<Relaton::Etsi::ItemData:0x0000000126e34c58
|
|
126
111
|
...
|
|
127
112
|
----
|
|
128
113
|
|
|
@@ -130,7 +115,7 @@ RelatonEtsi::BibliographicItem.from_hash hash
|
|
|
130
115
|
|
|
131
116
|
This gem uses the https://www.etsi.org as a data source.
|
|
132
117
|
|
|
133
|
-
The method `
|
|
118
|
+
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.
|
|
134
119
|
Arguments:
|
|
135
120
|
|
|
136
121
|
- `output` - folder to save documents (default './data').
|
|
@@ -138,7 +123,10 @@ Arguments:
|
|
|
138
123
|
|
|
139
124
|
[source,ruby]
|
|
140
125
|
----
|
|
141
|
-
|
|
126
|
+
require 'relaton/etsi/data_fetcher'
|
|
127
|
+
=> true
|
|
128
|
+
|
|
129
|
+
Relaton::Etsi::DataFetcher.fetch
|
|
142
130
|
Started at: 2023-12-05 22:44:32 -0500
|
|
143
131
|
Stopped at: 2023-12-05 22:47:55 -0500
|
|
144
132
|
Done in: 204 sec.
|
|
@@ -147,7 +135,7 @@ Done in: 204 sec.
|
|
|
147
135
|
|
|
148
136
|
=== Logging
|
|
149
137
|
|
|
150
|
-
|
|
138
|
+
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 https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
|
151
139
|
|
|
152
140
|
== Development
|
|
153
141
|
|