relaton-iec 1.20.4 → 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/.github/workflows/release.yml +0 -3
- data/.rubocop.yml +1 -1
- data/README.adoc +98 -122
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1010 -375
- data/grammars/relaton-iec.rng +60 -121
- data/lib/relaton/iec/bibliography.rb +225 -0
- data/lib/relaton/iec/data_fetcher.rb +214 -0
- data/lib/relaton/iec/data_parser.rb +328 -0
- data/lib/relaton/iec/hit.rb +26 -0
- data/lib/relaton/iec/hit_collection.rb +96 -0
- data/lib/relaton/iec/item_data.rb +7 -0
- data/lib/relaton/iec/model/bibdata.rb +7 -0
- data/lib/relaton/iec/model/bibitem.rb +7 -0
- data/lib/relaton/iec/model/docidentifier.rb +40 -0
- data/lib/relaton/iec/model/doctype.rb +12 -0
- data/lib/relaton/iec/model/ext.rb +50 -0
- data/lib/relaton/iec/model/item.rb +24 -0
- data/lib/relaton/iec/model/item_base.rb +9 -0
- data/lib/relaton/iec/model/relation.rb +7 -0
- data/lib/relaton/iec/model/stage_name.rb +13 -0
- data/lib/relaton/iec/processor.rb +72 -0
- data/lib/relaton/iec/util.rb +8 -0
- data/lib/relaton/iec/version.rb +5 -0
- data/lib/relaton/iec.rb +98 -0
- data/relaton_iec.gemspec +9 -9
- metadata +38 -56
- data/CLAUDE.md +0 -88
- data/lib/relaton_iec/basic_block/alignment.rb +0 -29
- data/lib/relaton_iec/basic_block/basic_block.rb +0 -15
- data/lib/relaton_iec/basic_block/citation_type.rb +0 -32
- data/lib/relaton_iec/basic_block/dl.rb +0 -60
- data/lib/relaton_iec/basic_block/eref.rb +0 -10
- data/lib/relaton_iec/basic_block/eref_type.rb +0 -39
- data/lib/relaton_iec/basic_block/formula.rb +0 -34
- data/lib/relaton_iec/basic_block/image.rb +0 -40
- data/lib/relaton_iec/basic_block/index.rb +0 -27
- data/lib/relaton_iec/basic_block/index_xref.rb +0 -31
- data/lib/relaton_iec/basic_block/note.rb +0 -21
- data/lib/relaton_iec/basic_block/paragraph.rb +0 -27
- data/lib/relaton_iec/basic_block/paragraph_with_footnote.rb +0 -29
- data/lib/relaton_iec/basic_block/reference_format.rb +0 -38
- data/lib/relaton_iec/basic_block/stem.rb +0 -29
- data/lib/relaton_iec/basic_block/table.rb +0 -115
- data/lib/relaton_iec/basic_block/text_element.rb +0 -26
- data/lib/relaton_iec/data_fetcher.rb +0 -211
- data/lib/relaton_iec/data_parser.rb +0 -294
- data/lib/relaton_iec/document_identifier.rb +0 -34
- data/lib/relaton_iec/document_type.rb +0 -20
- data/lib/relaton_iec/hash_converter.rb +0 -42
- data/lib/relaton_iec/hit.rb +0 -34
- data/lib/relaton_iec/hit_collection.rb +0 -81
- data/lib/relaton_iec/iec_bibliographic_item.rb +0 -125
- data/lib/relaton_iec/iec_bibliography.rb +0 -200
- data/lib/relaton_iec/index.rb +0 -135
- data/lib/relaton_iec/processor.rb +0 -64
- data/lib/relaton_iec/tc_sc_officers_note.rb +0 -24
- data/lib/relaton_iec/util.rb +0 -6
- data/lib/relaton_iec/version.rb +0 -3
- data/lib/relaton_iec/xml_parser.rb +0 -37
- data/lib/relaton_iec.rb +0 -98
- /data/lib/{relaton_iec → relaton/iec}/statuses.yml +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb18536c08a3cfa37917813b0505c3d35dd78195ff3c4179e459025cc3403551
|
|
4
|
+
data.tar.gz: 808fedfdaa1def6f060bd83353747d3e3f3d77246b7755ca3e55686f99b6f127
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c1d60f01ac5cb66618d17d472e80d2bc8845b62ff28a5fb8b9f872cbae548eed38ce1c9e6bd9bbdedb84a94184958a91e6efd29e6a8b17cac18c04002bd81a3
|
|
7
|
+
data.tar.gz: f5387a30e591ca09cb4a5ebe5d4a231024a55f9b53b620a303ab3f49341f0c727e57ea3d2046cf829195f94ea9b2d4061f81ba734e5e013ad9b97402124620b0
|
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Iec: retrieve IEC Standards for bibliographic use using the BibliographicItem model
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton-iec.svg["Gem Version", link="https://rubygems.org/gems/relaton-iec"]
|
|
4
4
|
image:https://github.com/relaton/relaton-iec/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iec/actions?workflow=macos"]
|
|
@@ -8,9 +8,9 @@ image:https://codeclimate.com/github/relaton/relaton-iec/badges/gpa.svg["Code Cl
|
|
|
8
8
|
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iec.svg["Pull Requests", link="https://github.com/relaton/relaton-iec/pulls"]
|
|
9
9
|
image:https://img.shields.io/github/commits-since/relaton/relaton-iec/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-iec/releases"]
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Relaton:Iec is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
|
|
12
12
|
|
|
13
|
-
You can use it to retrieve metadata of IEC Standards from https://www.iec.ch, and access such metadata through the `
|
|
13
|
+
You can use it to retrieve metadata of IEC Standards from https://www.iec.ch, and access such metadata through the `Relaton::Iec::ItemData` object.
|
|
14
14
|
|
|
15
15
|
== Installation
|
|
16
16
|
|
|
@@ -33,114 +33,74 @@ Or install it yourself as:
|
|
|
33
33
|
|
|
34
34
|
=== Search for a standard using keywords
|
|
35
35
|
|
|
36
|
-
`
|
|
36
|
+
`Relaton::Iec::Bibliography.search(ref, year)` method returns hits collection. Each hit can be used to fetch a document.
|
|
37
37
|
|
|
38
38
|
- `ref` - a reference to search document
|
|
39
39
|
- `year` - filter by year (optional)
|
|
40
40
|
|
|
41
41
|
[source,ruby]
|
|
42
42
|
----
|
|
43
|
-
require '
|
|
43
|
+
require 'relaton/iec'
|
|
44
44
|
=> true
|
|
45
45
|
|
|
46
|
-
hit_collection =
|
|
47
|
-
=> <
|
|
46
|
+
hit_collection = Relaton::Iec::Bibliography.search("IEC 60050")
|
|
47
|
+
=> <Relaton::Iec::HitCollection:0x00000000005650 @ref=IEC 60050 @fetched=false>
|
|
48
48
|
|
|
49
49
|
hit_collection.first
|
|
50
|
-
=> <
|
|
50
|
+
=> <Relaton::Iec::Hit:0x00000000006260 @reference="IEC 60050" @fetched="false" @docidentifier="IEC 60050-05:1935">
|
|
51
51
|
|
|
52
|
-
item = hit_collection[2].
|
|
53
|
-
=> #<
|
|
52
|
+
item = hit_collection[2].item
|
|
53
|
+
=> #<Relaton::Iec::ItemData:0x000000012cbc72a8
|
|
54
54
|
...
|
|
55
55
|
|
|
56
|
-
item.docidentifier
|
|
57
|
-
=>
|
|
58
|
-
#<RelatonBib::DocumentIdentifier:0x00007ff1b52a2a98
|
|
59
|
-
@id="urn:iec:std:iec:60050-07:1956-01:::",
|
|
60
|
-
@language=nil,
|
|
61
|
-
@primary=nil,
|
|
62
|
-
@scope=nil,
|
|
63
|
-
@script=nil,
|
|
64
|
-
@type="URN">]
|
|
65
|
-
|
|
66
|
-
item.docidentifier.detect { |di| di.type == "URN" }.id
|
|
67
|
-
=> "urn:iec:std:iec:60050-07:1956-01:::"
|
|
68
|
-
----
|
|
69
|
-
|
|
70
|
-
=== Fetch document by keywords
|
|
56
|
+
item.docidentifier[0].type
|
|
57
|
+
=> "IEC"
|
|
71
58
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- `ref` - a reference to search document
|
|
75
|
-
- `year` - filter by year (optional)
|
|
76
|
-
- `opts` - hash of options (optional). Supported options are `:all_parts` (boolean), `:keep_year` (boolean), `:publication_date_before` (string), `:publication_date_after` (string).
|
|
77
|
-
|
|
78
|
-
[source,ruby]
|
|
79
|
-
----
|
|
80
|
-
item = RelatonIec::IecBibliography.get("IEC 60050-112:2010")
|
|
81
|
-
[relaton-iec] (IEC 60050-112:2010) Fetching from Relaton repository ...
|
|
82
|
-
[relaton-iec] (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
|
|
83
|
-
=> #<RelatonIec::IecBibliographicItem:0x00007f876525e8d0
|
|
84
|
-
...
|
|
85
|
-
|
|
86
|
-
item = RelatonIec::IecBibliography.get("IEC 60050-112", "2010", all_parts: true)
|
|
87
|
-
[relaton-iec] (IEC 60050-112) Fetching from Relaton repository ...
|
|
88
|
-
[relaton-iec] (IEC 60050-112) Found: `IEC 60050 (all parts)`
|
|
89
|
-
=> #<RelatonIec::IecBibliographicItem:0x00007f87851888f0
|
|
90
|
-
...
|
|
59
|
+
item.docidentifier[0].primary
|
|
60
|
+
=> true
|
|
91
61
|
|
|
92
|
-
item.docidentifier.
|
|
93
|
-
=>
|
|
62
|
+
item.docidentifier[0].content
|
|
63
|
+
=> "IEC 60050-07:1956"
|
|
94
64
|
|
|
95
|
-
item
|
|
96
|
-
|
|
97
|
-
[relaton-iec] (IEC 60050-112) Found: `IEC 60050-112:2010`
|
|
98
|
-
=> #<RelatonIec::IecBibliographicItem:0x007fa69f296da8
|
|
65
|
+
item.docidentifier[1].type
|
|
66
|
+
=> "URN"
|
|
99
67
|
|
|
100
|
-
item.docidentifier.
|
|
101
|
-
=>
|
|
68
|
+
item.docidentifier[1].content
|
|
69
|
+
=> "urn:iec:std:iec:60050-07:1956-01:::"
|
|
102
70
|
----
|
|
103
71
|
|
|
104
|
-
===
|
|
105
|
-
|
|
106
|
-
The `get` method supports `:publication_date_before` and `:publication_date_after` options to select editions within a date range.
|
|
72
|
+
=== Fetch document by keywords
|
|
107
73
|
|
|
108
|
-
|
|
109
|
-
- `:publication_date_after` -- returns documents published *on or after* the given date (inclusive)
|
|
74
|
+
`Relaton::Iec::Bibliography.get(ref, year, opts)` method returns the document.
|
|
110
75
|
|
|
111
|
-
|
|
76
|
+
- `ref` - a reference to search document
|
|
77
|
+
- `year` - filter by year (optional)
|
|
78
|
+
- `opts` - hash of options (optional). Supported options are `:all_parts` (boolean), `:keep_year` (boolean).
|
|
112
79
|
|
|
113
80
|
[source,ruby]
|
|
114
81
|
----
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
[relaton-iec] INFO: (IEC
|
|
118
|
-
|
|
119
|
-
=> #<RelatonIec::IecBibliographicItem:0x0000000124cfcd10
|
|
82
|
+
item = Relaton::Iec::Bibliography.get("IEC 60050-112:2010")
|
|
83
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
|
|
84
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
|
|
85
|
+
=> #<Relaton::Iec::ItemData:0x000000012e5c6410
|
|
120
86
|
...
|
|
121
87
|
|
|
122
|
-
item
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
item = RelatonIec::IecBibliography.get("IEC 61332", nil, publication_date_after: "2010")
|
|
127
|
-
[relaton-iec] INFO: (IEC 61332) Fetching from Relaton repository ...
|
|
128
|
-
[relaton-iec] INFO: (IEC 61332) Found: `IEC 61332:2026`
|
|
129
|
-
=> #<RelatonIec::IecBibliographicItem:0x000000013285f790
|
|
88
|
+
item = Relaton::Iec::Bibliography.get("IEC 60050-112", "2010", all_parts: true)
|
|
89
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
|
|
90
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050 (all parts)`
|
|
91
|
+
=> #<Relaton::Iec::ItemData:0x000000012e1ebb88
|
|
130
92
|
...
|
|
131
93
|
|
|
132
|
-
item.
|
|
133
|
-
=> "
|
|
94
|
+
item.docidentifier.first.content
|
|
95
|
+
=> "IEC 60050 (all parts)"
|
|
134
96
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
[relaton-iec] INFO: (IEC
|
|
138
|
-
|
|
139
|
-
=> #<RelatonIec::IecBibliographicItem:0x000000013285f010
|
|
140
|
-
...
|
|
97
|
+
item = Relaton::Iec::Bibliography.get("IEC 60050-112", "2010")
|
|
98
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
|
|
99
|
+
[relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
|
|
100
|
+
=> #<Relaton::Iec::ItemData:0x000000012f0c6b80
|
|
141
101
|
|
|
142
|
-
item.
|
|
143
|
-
=> "
|
|
102
|
+
item.docidentifier.first.content
|
|
103
|
+
=> "IEC 60050-112:2010"
|
|
144
104
|
----
|
|
145
105
|
|
|
146
106
|
=== Search for ISO/IEC Directives
|
|
@@ -162,23 +122,40 @@ Possible options:
|
|
|
162
122
|
[source,ruby]
|
|
163
123
|
----
|
|
164
124
|
item.to_xml
|
|
165
|
-
=> "<bibitem id="
|
|
166
|
-
<fetched>
|
|
167
|
-
<title
|
|
168
|
-
<title
|
|
169
|
-
<title
|
|
125
|
+
=> "<bibitem id="IEC600501122010" type="standard" schema-version="v1.4.1">
|
|
126
|
+
<fetched>2026-02-02</fetched>
|
|
127
|
+
<title language="en" script="Latn" type="title-main">International Electrotechnical Vocabulary (IEV)</title>
|
|
128
|
+
<title language="en" script="Latn" type="title-part">Part 112: Quantities and units</title>
|
|
129
|
+
<title language="en" script="Latn" type="main">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
|
|
130
|
+
<title language="fr" script="Latn" type="title-main">Vocabulaire Electrotechnique International (IEV)</title>
|
|
131
|
+
<title language="fr" script="Latn" type="title-part">Partie 112: Grandeurs et unités</title>
|
|
132
|
+
<title language="fr" script="Latn" type="main">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
|
|
133
|
+
<title language="es" script="Latn" type="title-intro">Versión Oficial En español</title>
|
|
134
|
+
<title language="es" script="Latn" type="title-main">Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
|
|
135
|
+
<title language="es" script="Latn" type="main">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
|
|
170
136
|
<uri type="src">https://webstore.iec.ch/publication/162</uri>
|
|
137
|
+
<uri type="obp">https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf</uri>
|
|
138
|
+
<docidentifier type="IEC" primary="true">IEC 60050-112:2010</docidentifier>
|
|
139
|
+
<docidentifier type="URN">urn:iec:std:iec:60050-112:2010-01:::</docidentifier>
|
|
171
140
|
...
|
|
172
141
|
</bibitem>"
|
|
173
142
|
|
|
174
143
|
item.to_xml bibdata: true
|
|
175
|
-
=> "<bibdata type="standard" schema-version="v1.
|
|
176
|
-
<fetched>
|
|
177
|
-
<title
|
|
178
|
-
<title
|
|
179
|
-
<title
|
|
144
|
+
=> "<bibdata type="standard" schema-version="v1.4.1">
|
|
145
|
+
<fetched>2026-02-02</fetched>
|
|
146
|
+
<title language="en" script="Latn" type="title-main">International Electrotechnical Vocabulary (IEV)</title>
|
|
147
|
+
<title language="en" script="Latn" type="title-part">Part 112: Quantities and units</title>
|
|
148
|
+
<title language="en" script="Latn" type="main">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
|
|
149
|
+
<title language="fr" script="Latn" type="title-main">Vocabulaire Electrotechnique International (IEV)</title>
|
|
150
|
+
<title language="fr" script="Latn" type="title-part">Partie 112: Grandeurs et unités</title>
|
|
151
|
+
<title language="fr" script="Latn" type="main">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
|
|
152
|
+
<title language="es" script="Latn" type="title-intro">Versión Oficial En español</title>
|
|
153
|
+
<title language="es" script="Latn" type="title-main">Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
|
|
154
|
+
<title language="es" script="Latn" type="main">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
|
|
180
155
|
<uri type="src">https://webstore.iec.ch/publication/162</uri>
|
|
181
156
|
<uri type="obp">https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf</uri>
|
|
157
|
+
<docidentifier type="IEC" primary="true">IEC 60050-112:2010</docidentifier>
|
|
158
|
+
<docidentifier type="URN">urn:iec:std:iec:60050-112:2010-01:::</docidentifier>
|
|
182
159
|
...
|
|
183
160
|
<ext schema-version="v1.0.0">
|
|
184
161
|
<doctype>international-standard</doctype>
|
|
@@ -186,44 +163,43 @@ item.to_xml bibdata: true
|
|
|
186
163
|
</ext>
|
|
187
164
|
</bibdata>"
|
|
188
165
|
|
|
189
|
-
item.to_xml note: [{
|
|
190
|
-
=> "<bibitem id="
|
|
166
|
+
item.to_xml note: [{ content: "Note", type: "note" }]
|
|
167
|
+
=> "<bibitem id="IEC600501122010" type="standard" schema-version="v1.4.1">
|
|
191
168
|
...
|
|
192
|
-
<note
|
|
169
|
+
<note type="note">Note</note>
|
|
193
170
|
...
|
|
194
171
|
</bibitem>"
|
|
195
172
|
----
|
|
196
173
|
|
|
197
|
-
=== Typed links
|
|
174
|
+
=== Typed source links
|
|
198
175
|
|
|
199
|
-
Each IEC document has `src` type link and optional `obp` type link.
|
|
176
|
+
Each IEC document has `src` type link source and optional `obp` type link source.
|
|
200
177
|
|
|
201
178
|
[source,ruby]
|
|
202
179
|
----
|
|
203
|
-
item.
|
|
204
|
-
=>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
180
|
+
item.source[0].type
|
|
181
|
+
=> "src"
|
|
182
|
+
|
|
183
|
+
item.source[0].content
|
|
184
|
+
=> "https://webstore.iec.ch/publication/162"
|
|
185
|
+
|
|
186
|
+
item.source[1].type
|
|
187
|
+
=> "obp"
|
|
188
|
+
|
|
189
|
+
item.source[1].content
|
|
190
|
+
=> "https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf"
|
|
214
191
|
----
|
|
215
192
|
|
|
216
|
-
=== Create bibliographic item from
|
|
193
|
+
=== Create bibliographic item from XML or YAML
|
|
217
194
|
|
|
218
195
|
[source,ruby]
|
|
219
196
|
----
|
|
220
|
-
|
|
221
|
-
=>
|
|
222
|
-
"id"=>"IEC61058-2-4-1995+AMD1-2003CSV",
|
|
197
|
+
Relaton::Iec::Item.from_xml File.read("spec/fixtures/bibitem.xml")
|
|
198
|
+
=> #<Relaton::Iec::ItemData:0x000000012e5c9d90
|
|
223
199
|
...
|
|
224
200
|
|
|
225
|
-
|
|
226
|
-
=> #<
|
|
201
|
+
Relaton::Iec::Item.from_yaml File.read("spec/fixtures/item.yaml")
|
|
202
|
+
=> #<Relaton::Iec::ItemData:0x000000012f282460
|
|
227
203
|
...
|
|
228
204
|
----
|
|
229
205
|
|
|
@@ -255,28 +231,28 @@ URN structure: +
|
|
|
255
231
|
|
|
256
232
|
For more information see https://github.com/relaton/relaton-iec/issues/22
|
|
257
233
|
|
|
258
|
-
The method `
|
|
234
|
+
The method `Relaton::Iec.code_to_urn(code, lang)` converts document identifier to URN.
|
|
259
235
|
|
|
260
236
|
* `code` is a document identifier
|
|
261
237
|
* `lang` is a laguage code (optional). Examples: en, fr, en-fr etc.
|
|
262
238
|
|
|
263
239
|
[source,ruby]
|
|
264
240
|
----
|
|
265
|
-
|
|
241
|
+
Relaton::Iec.code_to_urn "IEC 60050-102:2007/AMD1:2017"
|
|
266
242
|
=> "urn:iec:std:iec:60050-102:2007:::::amd:1:2017"
|
|
267
243
|
|
|
268
|
-
|
|
244
|
+
Relaton::Iec.code_to_urn "IEC 60034-1:1969+AMD1:1977+AMD2:1979+AMD3:1980 CSV", "en-fr"
|
|
269
245
|
=> "urn:iec:std:iec:60034-1:1969::csv:en-fr:plus:amd:1:1977:plus:amd:2:1979:plus:amd:3:1980"
|
|
270
246
|
----
|
|
271
247
|
|
|
272
|
-
The method `
|
|
248
|
+
The method `Relaton::Iec.urn_to_code(urn)` converts URN to document identifier.
|
|
273
249
|
|
|
274
250
|
[source,ruby]
|
|
275
251
|
----
|
|
276
|
-
|
|
252
|
+
Relaton::Iec.urn_to_code "urn:iec:std:iec:60050-102:2007:::::amd:1:2017"
|
|
277
253
|
=> ["IEC 60050-102:2007/AMD1:2017", ""]
|
|
278
254
|
|
|
279
|
-
|
|
255
|
+
Relaton::Iec.urn_to_code "urn:iec:std:iec:60034-1:1969::csv:en-fr:plus:amd:1:1977:plus:amd:2:1979:plus:amd:3:1980"
|
|
280
256
|
=> ["IEC 60034-1:1969+AMD1:1977+AMD2:1979+AMD3:1980 CSV", "en-fr"]
|
|
281
257
|
----
|
|
282
258
|
|
|
@@ -286,7 +262,7 @@ This gem uses the https://bitbucket.org/sdo-hapi/api-specifications/wiki/Guideli
|
|
|
286
262
|
- `iec-harmonized-all` - fetches all the documents using the API
|
|
287
263
|
- `iec-harmonized-latest` - fetches the latest documents using the API
|
|
288
264
|
|
|
289
|
-
The method `
|
|
265
|
+
The method `Relaton::Iec::DataFetcher.fetch(source, output: "data", format: "yaml") fetches IEC documents from the dataset and saves them to the `./data` folder in YAML format.
|
|
290
266
|
Arguments:
|
|
291
267
|
|
|
292
268
|
- `source` - data source. Possible values: `iec-harmonized-all`, `iec-harmonized-latest` (default `iec-harmonized-latest`).
|
|
@@ -295,7 +271,7 @@ Arguments:
|
|
|
295
271
|
|
|
296
272
|
[source,ruby]
|
|
297
273
|
----
|
|
298
|
-
|
|
274
|
+
Relaton::Iec::DataFetcher.fetch
|
|
299
275
|
Started at: 2022-06-23 09:36:55 +0200
|
|
300
276
|
Stopped at: 2022-06-23 09:36:58 +0200
|
|
301
277
|
Done in: 752 sec.
|
|
@@ -304,7 +280,7 @@ Done in: 752 sec.
|
|
|
304
280
|
|
|
305
281
|
=== Logging
|
|
306
282
|
|
|
307
|
-
|
|
283
|
+
Relaton::Iec 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.
|
|
308
284
|
|
|
309
285
|
== Development
|
|
310
286
|
|