relaton 3.0.0.pre.alpha.16 → 3.0.0.pre.alpha.18
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/data/equivalence/adoption-chains.yaml +38 -0
- data/lib/relaton/3gpp/CLAUDE.md +187 -0
- data/lib/relaton/3gpp/README.adoc +149 -0
- data/lib/relaton/adobe/CLAUDE.md +104 -0
- data/lib/relaton/bib/CLAUDE.md +130 -0
- data/lib/relaton/bib/README.adoc +330 -0
- data/lib/relaton/bib/model/series.rb +1 -1
- data/lib/relaton/bipm/CLAUDE.md +173 -0
- data/lib/relaton/bipm/README.adoc +352 -0
- data/lib/relaton/bipm/data_fetcher.rb +3 -2
- data/lib/relaton/bsi/CLAUDE.md +35 -0
- data/lib/relaton/bsi/README.adoc +112 -0
- data/lib/relaton/calconnect/CLAUDE.md +177 -0
- data/lib/relaton/calconnect/README.adoc +140 -0
- data/lib/relaton/ccsds/CLAUDE.md +74 -0
- data/lib/relaton/ccsds/README.adoc +154 -0
- data/lib/relaton/cen/CLAUDE.md +219 -0
- data/lib/relaton/cen/README.adoc +155 -0
- data/lib/relaton/cie/CLAUDE.md +90 -0
- data/lib/relaton/cie/README.adoc +121 -0
- data/lib/relaton/core/CLAUDE.md +140 -0
- data/lib/relaton/core/README.adoc +64 -0
- data/lib/relaton/core/data_fetcher.rb +50 -3
- data/lib/relaton/db/CLAUDE.md +373 -0
- data/lib/relaton/db.rb +19 -1
- data/lib/relaton/doi/CLAUDE.md +105 -0
- data/lib/relaton/doi/README.adoc +89 -0
- data/lib/relaton/easc/CLAUDE.md +85 -0
- data/lib/relaton/ecma/CLAUDE.md +217 -0
- data/lib/relaton/ecma/README.adoc +178 -0
- data/lib/relaton/equivalence.rb +89 -0
- data/lib/relaton/etsi/CLAUDE.md +219 -0
- data/lib/relaton/etsi/README.adoc +137 -0
- data/lib/relaton/evs/CLAUDE.md +120 -0
- data/lib/relaton/evs/README.adoc +27 -0
- data/lib/relaton/gb/CLAUDE.md +47 -0
- data/lib/relaton/gb/README.adoc +169 -0
- data/lib/relaton/gost/CLAUDE.md +100 -0
- data/lib/relaton/iala/CLAUDE.md +97 -0
- data/lib/relaton/iana/CLAUDE.md +105 -0
- data/lib/relaton/iana/README.adoc +107 -0
- data/lib/relaton/iec/CLAUDE.md +13 -0
- data/lib/relaton/iec/README.adoc +280 -0
- data/lib/relaton/iec/data_fetcher.rb +24 -8
- data/lib/relaton/iec/project_fetcher.rb +48 -0
- data/lib/relaton/iec/project_parser.rb +111 -0
- data/lib/relaton/iec.rb +5 -0
- data/lib/relaton/ieee/CLAUDE.md +176 -0
- data/lib/relaton/ieee/README.adoc +131 -0
- data/lib/relaton/ietf/CLAUDE.md +357 -0
- data/lib/relaton/ietf/README.adoc +167 -0
- data/lib/relaton/iho/CLAUDE.md +70 -0
- data/lib/relaton/iho/README.adoc +119 -0
- data/lib/relaton/index/CLAUDE.md +207 -0
- data/lib/relaton/index/README.adoc +221 -0
- data/lib/relaton/index/dataset_lock.rb +122 -0
- data/lib/relaton/index/family.rb +63 -0
- data/lib/relaton/index/type.rb +32 -0
- data/lib/relaton/index.rb +3 -0
- data/lib/relaton/isbn/CLAUDE.md +47 -0
- data/lib/relaton/isbn/README.adoc +91 -0
- data/lib/relaton/iso/CLAUDE.md +38 -0
- data/lib/relaton/iso/README.adoc +370 -0
- data/lib/relaton/iso/data_fetcher.rb +16 -1
- data/lib/relaton/itu/CLAUDE.md +685 -0
- data/lib/relaton/itu/README.adoc +188 -0
- data/lib/relaton/jcgm/CLAUDE.md +107 -0
- data/lib/relaton/jis/CLAUDE.md +64 -0
- data/lib/relaton/jis/README.adoc +167 -0
- data/lib/relaton/logger/CLAUDE.md +37 -0
- data/lib/relaton/logger/README.adoc +120 -0
- data/lib/relaton/nist/CLAUDE.md +180 -0
- data/lib/relaton/nist/README.adoc +389 -0
- data/lib/relaton/nist/bibliography.rb +17 -1
- data/lib/relaton/nist/data_fetcher.rb +60 -4
- data/lib/relaton/nist/hit_collection.rb +121 -59
- data/lib/relaton/nist/scraper.rb +21 -7
- data/lib/relaton/oasis/CLAUDE.md +251 -0
- data/lib/relaton/oasis/README.adoc +132 -0
- data/lib/relaton/ogc/CLAUDE.md +242 -0
- data/lib/relaton/ogc/README.adoc +134 -0
- data/lib/relaton/oiml/CLAUDE.md +47 -0
- data/lib/relaton/oiml/README.adoc +70 -0
- data/lib/relaton/omg/CLAUDE.md +137 -0
- data/lib/relaton/omg/README.adoc +101 -0
- data/lib/relaton/plateau/CLAUDE.md +126 -0
- data/lib/relaton/plateau/README.adoc +139 -0
- data/lib/relaton/sdo/CLAUDE.md +81 -0
- data/lib/relaton/un/CLAUDE.md +91 -0
- data/lib/relaton/un/README.adoc +125 -0
- data/lib/relaton/version.rb +1 -1
- data/lib/relaton/w3c/CLAUDE.md +369 -0
- data/lib/relaton/w3c/README.adoc +140 -0
- data/lib/relaton/w3c/data_fetcher.rb +1 -1
- data/lib/relaton/xsf/CLAUDE.md +189 -0
- data/lib/relaton/xsf/README.adoc +127 -0
- data/lib/relaton.rb +1 -0
- metadata +83 -2
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
= Relaton::Iso: retrieve ISO Standards for bibliographic use using the BibliographicItem model
|
|
2
|
+
|
|
3
|
+
Relaton::Iso is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
|
|
4
|
+
|
|
5
|
+
You can use it to retrieve metadata of ISO Standards from https://www.iso.org, and access such metadata through the `IsoBibliographicItem` object.
|
|
6
|
+
|
|
7
|
+
== Usage
|
|
8
|
+
|
|
9
|
+
=== Search for standards using keywords
|
|
10
|
+
|
|
11
|
+
[source,ruby]
|
|
12
|
+
----
|
|
13
|
+
require 'relaton/iso'
|
|
14
|
+
=> true
|
|
15
|
+
|
|
16
|
+
hit_collection = Relaton::Iso::Bibliography.search("ISO 19115")
|
|
17
|
+
=> <Relaton::Iso::HitCollection:0x0000000003a9a8 @ref=ISO 19115 @fetched=false>
|
|
18
|
+
|
|
19
|
+
hit_collection.first
|
|
20
|
+
=> #<Relaton::Iso::Hit:0x00000001398ecdc8 ...>
|
|
21
|
+
|
|
22
|
+
item = hit_collection[2].item
|
|
23
|
+
=> #<Relaton::Iso::ItemData:0x0000000139d07070 ...>
|
|
24
|
+
|
|
25
|
+
item.docidentifier.first.to_s
|
|
26
|
+
=> "ISO 19115-2:2019"
|
|
27
|
+
|
|
28
|
+
item.docidentifier.find { |id| id.type == "URN" }.to_s
|
|
29
|
+
=> "urn:iso:std:iso:19115:-2:stage-90.93"
|
|
30
|
+
----
|
|
31
|
+
|
|
32
|
+
=== Fetch document by reference and year
|
|
33
|
+
|
|
34
|
+
[source,ruby]
|
|
35
|
+
----
|
|
36
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115:2003"
|
|
37
|
+
[relaton-iso] INFO: (ISO 19115:2003) Fetching from Relaton repository ...
|
|
38
|
+
[relaton-iso] INFO: (ISO 19115:2003) Found: `ISO 19115:2003`
|
|
39
|
+
=> #<Relaton::Iso::ItemData:0x000000013c4cdac8 ...>
|
|
40
|
+
|
|
41
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115", "2003"
|
|
42
|
+
[relaton-iso] INFO: (ISO 19115:2003) Fetching from Relaton repository ...
|
|
43
|
+
[relaton-iso] INFO: (ISO 19115:2003) Found: `ISO 19115:2003`
|
|
44
|
+
=> #<Relaton::Iso::ItemData:0x000000013c4c5148 ...>
|
|
45
|
+
|
|
46
|
+
item.docidentifier[0].to_s
|
|
47
|
+
=> "ISO 19115:2003"
|
|
48
|
+
----
|
|
49
|
+
|
|
50
|
+
=== Fetch non-part document
|
|
51
|
+
|
|
52
|
+
[source,ruby]
|
|
53
|
+
----
|
|
54
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115"
|
|
55
|
+
[relaton-iso] INFO: (ISO 19115) Fetching from Relaton repository ...
|
|
56
|
+
[relaton-iso] INFO: (ISO 19115) Found: `ISO 19115:2003`
|
|
57
|
+
=> #<Relaton::Iso::ItemData:0x000000013b6a6418 ...>
|
|
58
|
+
|
|
59
|
+
item.docidentifier[0].to_s
|
|
60
|
+
=> "ISO 19115"
|
|
61
|
+
----
|
|
62
|
+
|
|
63
|
+
=== Fetch a part document
|
|
64
|
+
|
|
65
|
+
[source,ruby]
|
|
66
|
+
----
|
|
67
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115-1"
|
|
68
|
+
[relaton-iso] INFO: (ISO 19115-1) Fetching from Relaton repository ...
|
|
69
|
+
[relaton-iso] INFO: (ISO 19115-1) Found: `ISO 19115-1:2014`
|
|
70
|
+
=> #<Relaton::Iso::ItemData:0x000000013c761410 ...>
|
|
71
|
+
|
|
72
|
+
item.docidentifier[0].to_s
|
|
73
|
+
=> "ISO 19115-1"
|
|
74
|
+
----
|
|
75
|
+
|
|
76
|
+
=== Fetch all-parts document
|
|
77
|
+
|
|
78
|
+
[source,ruby]
|
|
79
|
+
----
|
|
80
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115 (all parts)"
|
|
81
|
+
[relaton-iso] INFO: (ISO 19115 (all parts)) Fetching from Relaton repository ...
|
|
82
|
+
[relaton-iso] INFO: (ISO 19115 (all parts)) Found: `ISO 19115 (all parts)`
|
|
83
|
+
=> #<Relaton::Iso::ItemData:0x000000013bb87950 ...>
|
|
84
|
+
|
|
85
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115", nil, all_parts: true
|
|
86
|
+
[relaton-iso] INFO: (ISO 19115 (all parts)) Fetching from Relaton repository ...
|
|
87
|
+
[relaton-iso] INFO: (ISO 19115 (all parts)) Found: `ISO 19115 (all parts)`
|
|
88
|
+
=> #<Relaton::Iso::ItemData:0x000000013c855150 ...>
|
|
89
|
+
|
|
90
|
+
item.docidentifier[0].to_s
|
|
91
|
+
=> "ISO 19115 (all parts)"
|
|
92
|
+
|
|
93
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115-1 (all parts)"
|
|
94
|
+
[relaton-iso] INFO: (ISO 19115-1 (all parts)) Fetching from Relaton repository ...
|
|
95
|
+
[relaton-iso] INFO: (ISO 19115-1 (all parts)) Found: `ISO 19115 (all parts)`
|
|
96
|
+
=> #<Relaton::Iso::ItemData:0x000000013b54c590 ...>
|
|
97
|
+
|
|
98
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115-1", nil, all_parts: true
|
|
99
|
+
[relaton-iso] INFO: (ISO 19115-1 (all parts)) Fetching from Relaton repository ...
|
|
100
|
+
[relaton-iso] INFO: (ISO 19115-1 (all parts)) Found: `ISO 19115 (all parts)`
|
|
101
|
+
=> #<Relaton::Iso::ItemData:0x000000013b54dad0 ...>
|
|
102
|
+
|
|
103
|
+
item.docidentifier[0].to_s
|
|
104
|
+
=> "ISO 19115 (all parts)"
|
|
105
|
+
----
|
|
106
|
+
|
|
107
|
+
=== Non-standard ISO/IEC documents
|
|
108
|
+
|
|
109
|
+
==== General
|
|
110
|
+
|
|
111
|
+
ISO/IEC Directives and related documents are fetched from the `relaton-data-iso`
|
|
112
|
+
repository managed by the Relaton team.
|
|
113
|
+
|
|
114
|
+
The following PubID patterns are used to fetch particular documents.
|
|
115
|
+
|
|
116
|
+
==== ISO/IEC Directives in Parts
|
|
117
|
+
|
|
118
|
+
`ISO/IEC DIR 1 ISO SUP`::
|
|
119
|
+
ISO/IEC Directives, Consolidated ISO Supplement -- Procedures specific to ISO.
|
|
120
|
+
This is the undated reference.
|
|
121
|
+
|
|
122
|
+
`ISO/IEC DIR 1 ISO SUP:{yyyy}`::: Available edition years from 2003 (ed1) to 2023 (ed14).
|
|
123
|
+
|
|
124
|
+
`ISO/IEC DIR 1`::
|
|
125
|
+
ISO/IEC Directives, Part 1. This is the undated reference.
|
|
126
|
+
|
|
127
|
+
`ISO/IEC DIR 1 ISO`:: ISO-published version of "ISO/IEC Directives, Part 1".
|
|
128
|
+
`ISO/IEC DIR 1 ISO:{yyyy}`::: Edition years from 1986 (ed1) to 2023 (ed19).
|
|
129
|
+
|
|
130
|
+
`ISO/IEC DIR 1 IEC`:: IEC-published version of "ISO/IEC Directives, Part 1"
|
|
131
|
+
`ISO/IEC DIR 1 IEC:{yyyy}`::: Edition years from 1986 (ed1) to 2023 (ed19).
|
|
132
|
+
|
|
133
|
+
`ISO/IEC DIR 2`::
|
|
134
|
+
ISO/IEC Directives, Part 2. This is the undated reference.
|
|
135
|
+
|
|
136
|
+
`ISO/IEC DIR 2 ISO`:: ISO-published version of "ISO/IEC Directives, Part 2"
|
|
137
|
+
`ISO/IEC DIR 2 ISO:{yyyy}`::: Edition years from 1986 (ed1) to 2021 (ed9).
|
|
138
|
+
|
|
139
|
+
`ISO/IEC DIR 2 IEC`:: IEC-published version of "ISO/IEC Directives, Part 2"
|
|
140
|
+
`ISO/IEC DIR 2 IEC:{yyyy}`::: Edition years from 1986 (ed1) to 2021 (ed9).
|
|
141
|
+
|
|
142
|
+
`ISO/IEC DIR 3`::
|
|
143
|
+
ISO/IEC Directives, Part 3. This is the undated reference.
|
|
144
|
+
This is of historical interest, as originally ISO/IEC published the Directives
|
|
145
|
+
in 3 parts:
|
|
146
|
+
Part 1 "Procedures for the technical work",
|
|
147
|
+
Part 2 "Methodology for the development of International Standards",
|
|
148
|
+
Part 3 "Drafting and presentation of International Standards".
|
|
149
|
+
In the 2004 versions, Parts 1 and 2 merged into the new Part 1, and Part 3
|
|
150
|
+
was renamed as Part 2.
|
|
151
|
+
|
|
152
|
+
`ISO/IEC DIR 3:{yyyy}`::: Edition years: 1986 (ed1), 1989 (ed2), 1997 (ed3).
|
|
153
|
+
|
|
154
|
+
==== ISO/IEC Directives ISO Supplements related
|
|
155
|
+
|
|
156
|
+
`ISO/IEC DIR 1 ISO SUP`::
|
|
157
|
+
ISO/IEC Directives, Consolidated ISO Supplement -- Procedures specific to ISO.
|
|
158
|
+
This is the undated reference.
|
|
159
|
+
|
|
160
|
+
`ISO/IEC DIR 1 ISO SUP:{yyyy}`::: Available edition years from 2003 (ed1) to 2023 (ed14).
|
|
161
|
+
|
|
162
|
+
==== ISO/IEC Directives IEC Supplements related
|
|
163
|
+
|
|
164
|
+
`ISO/IEC DIR IEC SUP`::
|
|
165
|
+
ISO/IEC Directives, IEC Supplement -- Procedures specific to IEC.
|
|
166
|
+
This is the undated reference.
|
|
167
|
+
|
|
168
|
+
`ISO/IEC DIR IEC SUP:{yyyy}`::: Available edition years from 2009 (ed4) to 2023 (ed17).
|
|
169
|
+
|
|
170
|
+
`ISO/IEC DIR 1 + IEC SUP`::
|
|
171
|
+
The consolidated version of "ISO/IEC Directives, Part 1 + IEC Supplement -- Procedures specific to IEC".
|
|
172
|
+
This is the undated reference.
|
|
173
|
+
|
|
174
|
+
`ISO/IEC DIR 1 + IEC SUP:{yyyy}`::: Available edition years from 2016 (ed12) to 2023 (ed19).
|
|
175
|
+
|
|
176
|
+
==== ISO/IEC JTC 1 governance documents
|
|
177
|
+
|
|
178
|
+
`ISO/IEC JTC 1 DIR`::
|
|
179
|
+
ISO/IEC JTC 1 Directives. This is the undated reference. Notice that
|
|
180
|
+
these are "internal directives" of ISO/IEC JTC 1. This series existed
|
|
181
|
+
until 2007, after which it became "ISO/IEC Directives -- JTC 1 Supplement".
|
|
182
|
+
|
|
183
|
+
`ISO/IEC JTC 1 DIR:{yyyy}`::: Available edition years are:
|
|
184
|
+
2004 (5th Edition),
|
|
185
|
+
2005 (5th Edition, Version 1.0),
|
|
186
|
+
2006 (5th Edition, Version 2.0),
|
|
187
|
+
2007 (5th Edition, Version 3.0).
|
|
188
|
+
|
|
189
|
+
`ISO/IEC DIR JTC 1`::
|
|
190
|
+
ISO/IEC Directives, JTC 1 Supplement -- Procedures specific to JTC 1.
|
|
191
|
+
This is the undated reference.
|
|
192
|
+
|
|
193
|
+
`ISO/IEC DIR JTC 1:{yyyy}`:::
|
|
194
|
+
Available edition years from 2010 (ed1) to 2023 (ed12).
|
|
195
|
+
|
|
196
|
+
==== ISO/TC 184/SC 4 important N-documents
|
|
197
|
+
|
|
198
|
+
`ISO/TC 184/SC 4 N2412`::
|
|
199
|
+
ISO/TC 184/SC 4 Supplementary directives - Rules for the structure and drafting of SC 4 standards for industrial data. 2008-12-16.
|
|
200
|
+
|
|
201
|
+
`ISO/TC 184/SC 4 N2412`::
|
|
202
|
+
ISO/TC 184/SC 4 Supplementary directives - Rules for the structure and drafting of SC 4 standards for industrial data. 2020-07-31.
|
|
203
|
+
|
|
204
|
+
`ISO/TC 184/SC 4 N3500`::
|
|
205
|
+
ISO/TC 184/SC 4 Handbook -- SC 4 Supplement to ISO directives.
|
|
206
|
+
2020-08-09.
|
|
207
|
+
|
|
208
|
+
=== XML serialization
|
|
209
|
+
|
|
210
|
+
Possible options:
|
|
211
|
+
|
|
212
|
+
- *bibdata* - If true then wrapp item with _bibdata_ element and add _ext_ element.
|
|
213
|
+
- *note* - Array of hashes `{ text: "Note", type: "note" }`. These notes will be added to XML.
|
|
214
|
+
|
|
215
|
+
[source,ruby]
|
|
216
|
+
----
|
|
217
|
+
item.to_xml
|
|
218
|
+
=> "<bibitem id="ISO19115-1-2014" type="standard" schema-version="v1.5.6">
|
|
219
|
+
<title language="en" script="Latn" type="title-intro" format="text/plain">Geographic information</title>
|
|
220
|
+
<title language="en" script="Latn" type="title-main" format="text/plain">Metadata</title>
|
|
221
|
+
...
|
|
222
|
+
</bibitem>"
|
|
223
|
+
|
|
224
|
+
item.to_xml bibdata: true
|
|
225
|
+
=> "<bibdata type="standard" schema-version="v1.5.6">
|
|
226
|
+
<title language="en" script="Latn" type="title-intro" format="text/plain">Geographic information</title>
|
|
227
|
+
...
|
|
228
|
+
<ext schema-version="v1.1.2">
|
|
229
|
+
<doctype>international-standard</doctype>
|
|
230
|
+
...
|
|
231
|
+
</ext>
|
|
232
|
+
</bibdata>"
|
|
233
|
+
|
|
234
|
+
item.to_xml note: [{ content: "Note", type: "note" }]
|
|
235
|
+
=> "<bibitem id="ISO19115-1-2014" type="standard" schema-version="v1.5.6">
|
|
236
|
+
...
|
|
237
|
+
<note type="note">Note</note>
|
|
238
|
+
...
|
|
239
|
+
</bibitem>"
|
|
240
|
+
----
|
|
241
|
+
|
|
242
|
+
=== Get specific language
|
|
243
|
+
|
|
244
|
+
[source,ruby]
|
|
245
|
+
----
|
|
246
|
+
item.title 'en'
|
|
247
|
+
=> [#<Relaton::Bib::Title:0x000000013e3de2f0
|
|
248
|
+
@content="Geographic information",
|
|
249
|
+
@format="text/plain",
|
|
250
|
+
@language="en",
|
|
251
|
+
@locale=nil,
|
|
252
|
+
@script="Latn",
|
|
253
|
+
@type="title-intro">,
|
|
254
|
+
#<Relaton::Bib::Title:0x000000013e3de250
|
|
255
|
+
@content="Metadata",
|
|
256
|
+
@format="text/plain",
|
|
257
|
+
@language="en",
|
|
258
|
+
@locale=nil,
|
|
259
|
+
@script="Latn",
|
|
260
|
+
@type="title-main">,
|
|
261
|
+
#<Relaton::Bib::Title:0x000000013e3de110
|
|
262
|
+
@content="Geographic information - Metadata",
|
|
263
|
+
@format="text/plain",
|
|
264
|
+
@language="en",
|
|
265
|
+
@locale=nil,
|
|
266
|
+
@script="Latn",
|
|
267
|
+
@type="main">]
|
|
268
|
+
|
|
269
|
+
item.title 'fr'
|
|
270
|
+
=> [#<Relaton::Bib::Title:0x000000013e3de070
|
|
271
|
+
@content="Information géographique",
|
|
272
|
+
@format="text/plain",
|
|
273
|
+
@language="fr",
|
|
274
|
+
@locale=nil,
|
|
275
|
+
@script="Latn",
|
|
276
|
+
@type="title-intro">,
|
|
277
|
+
#<Relaton::Bib::Title:0x000000013e3ddfd0
|
|
278
|
+
@content="Métadonnées",
|
|
279
|
+
@format="text/plain",
|
|
280
|
+
@language="fr",
|
|
281
|
+
@locale=nil,
|
|
282
|
+
@script="Latn",
|
|
283
|
+
@type="title-main">,
|
|
284
|
+
#<Relaton::Bib::Title:0x000000013e3dde90
|
|
285
|
+
@content="Information géographique - Métadonnées",
|
|
286
|
+
@format="text/plain",
|
|
287
|
+
@language="fr",
|
|
288
|
+
@locale=nil,
|
|
289
|
+
@script="Latn",
|
|
290
|
+
@type="main">]
|
|
291
|
+
|
|
292
|
+
item = Relaton::Iso::Bibliography.get "ISO 19115:2003"
|
|
293
|
+
[relaton-iso] (ISO 19115:2003) Fetching from iso.org ...
|
|
294
|
+
[relaton-iso] (ISO 19115:2003) Found: `ISO 19115:2003`
|
|
295
|
+
=> #<Relaton::Iso::ItemData:0x000000013eefe888 ...>
|
|
296
|
+
|
|
297
|
+
item.abstract 'en'
|
|
298
|
+
=> [#<Relaton::Bib::LocalizedMarkedUpString:0x000000013e4790c0
|
|
299
|
+
@content= "ISO 19115:2003 defines the schema required for describing geographic information ...",
|
|
300
|
+
@language="en",
|
|
301
|
+
@locale=nil,
|
|
302
|
+
@script="Latn">]
|
|
303
|
+
----
|
|
304
|
+
|
|
305
|
+
=== Typed links
|
|
306
|
+
|
|
307
|
+
Each ISO document has `src` type link and optional `obp`, `rss`, and `pub` link types.
|
|
308
|
+
|
|
309
|
+
[source,ruby]
|
|
310
|
+
----
|
|
311
|
+
item.source
|
|
312
|
+
=> [#<Relaton::Bib::Uri:0x000000013ee73080
|
|
313
|
+
@content="https://www.iso.org/standard/26020.html",
|
|
314
|
+
@language=nil,
|
|
315
|
+
@locale=nil,
|
|
316
|
+
@script=nil,
|
|
317
|
+
@type="src">,
|
|
318
|
+
#<Relaton::Bib::Uri:0x000000013ee73030
|
|
319
|
+
@content="https://www.iso.org/contents/data/standard/02/60/26020.detail.rss",
|
|
320
|
+
@language=nil,
|
|
321
|
+
@locale=nil,
|
|
322
|
+
@script=nil,
|
|
323
|
+
@type="rss">]
|
|
324
|
+
----
|
|
325
|
+
|
|
326
|
+
[[bulk-data-ingest]]
|
|
327
|
+
=== Bulk data ingest
|
|
328
|
+
|
|
329
|
+
The curated dataset under https://github.com/relaton/relaton-data-iso[relaton-data-iso] is rebuilt daily by `Relaton::Iso::DataFetcher`, which streams the
|
|
330
|
+
https://www.iso.org/open-data.html[ISO Open Data programme] JSONL feeds — `iso_deliverables_metadata.jsonl` for documents (~80,000 records) and `iso_technical_committees.jsonl` for committee titles — and writes one YAML per primary docid.
|
|
331
|
+
|
|
332
|
+
Two source modes are exposed (also reachable via `relaton-cli`'s dataset list and the GitHub Actions workflow input):
|
|
333
|
+
|
|
334
|
+
[source,ruby]
|
|
335
|
+
----
|
|
336
|
+
# Incremental: skip the run if upstream `Last-Modified` matches the local
|
|
337
|
+
# `last_modified.txt`. Falls back to a full pass when `data/` or
|
|
338
|
+
# `index-v1.yaml` is missing.
|
|
339
|
+
Relaton::Iso::DataFetcher.fetch("iso-open-data", output: "data", format: "yaml")
|
|
340
|
+
|
|
341
|
+
# Full refresh: wipe `output` and re-emit every record. Use when the local
|
|
342
|
+
# tree is suspect or after a parser change that affects emitted YAML.
|
|
343
|
+
Relaton::Iso::DataFetcher.fetch("iso-open-data-all", output: "data", format: "yaml")
|
|
344
|
+
----
|
|
345
|
+
|
|
346
|
+
=== Logging
|
|
347
|
+
|
|
348
|
+
RelatonIso 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.
|
|
349
|
+
|
|
350
|
+
== Development
|
|
351
|
+
|
|
352
|
+
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.
|
|
353
|
+
|
|
354
|
+
To update the ISO index test fixture (used by WebMock in tests), run `rake spec:update_index`. This downloads the latest `index-v1.zip` from the https://github.com/relaton/relaton-data-iso[relaton-data-iso] repository.
|
|
355
|
+
|
|
356
|
+
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).
|
|
357
|
+
|
|
358
|
+
== Exceptional Citations
|
|
359
|
+
|
|
360
|
+
Single-document lookups via `Bibliography.get` first consult the curated relaton-data-iso index (regenerated daily from the ISO Open Data programme — see <<bulk-data-ingest>>) and fall back to scraping individual pages on http://www.iso.org for items not yet indexed. The following documents are not returned as search results from the ISO website, and the gem returns manually generated references to them.
|
|
361
|
+
|
|
362
|
+
* `IEV`: used in the metanorma-iso gem to reference Electropedia entries generically. Is resolved to an "all parts" reference to IEC 60050, which in turn is resolved into the specific documents cited by their top-level clause.
|
|
363
|
+
|
|
364
|
+
== Contributing
|
|
365
|
+
|
|
366
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-iso
|
|
367
|
+
|
|
368
|
+
== License
|
|
369
|
+
|
|
370
|
+
The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT license].
|
|
@@ -248,7 +248,7 @@ module Relaton
|
|
|
248
248
|
docid = doc.docidentifier.detect(&:primary)
|
|
249
249
|
return unless docid
|
|
250
250
|
|
|
251
|
-
file =
|
|
251
|
+
file = docid_file(docid.content.to_s)
|
|
252
252
|
if File.exist?(file)
|
|
253
253
|
rewrite_with_same_or_newer(doc, docid, file)
|
|
254
254
|
else
|
|
@@ -256,6 +256,21 @@ module Relaton
|
|
|
256
256
|
end
|
|
257
257
|
end
|
|
258
258
|
|
|
259
|
+
# Distinct docids can sanitize to one filename (`ISO/DIS 15869.3` and
|
|
260
|
+
# `ISO/DIS 15869-3`); take a path of our own rather than treating the
|
|
261
|
+
# other document as an older edition. A reserved path only ever belongs
|
|
262
|
+
# to one docid, and `reset_output` wiped `@output`, so an existing file
|
|
263
|
+
# is this same document again.
|
|
264
|
+
def docid_file(id)
|
|
265
|
+
file = unique_output_file(id)
|
|
266
|
+
plain = output_file(id)
|
|
267
|
+
if file != plain && !@files.include?(file)
|
|
268
|
+
Util.warn "File #{plain} exists. Docid: #{id}. " \
|
|
269
|
+
"Writing #{file} instead."
|
|
270
|
+
end
|
|
271
|
+
file
|
|
272
|
+
end
|
|
273
|
+
|
|
259
274
|
def rewrite_with_same_or_newer(doc, docid, file)
|
|
260
275
|
existing = Item.from_yaml(File.read(file, encoding: "UTF-8"))
|
|
261
276
|
if edition_greater?(doc, existing) || replace_substage98?(doc, existing)
|