relaton-nist 1.19.1 → 1.19.3
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/README.adoc +278 -106
- data/lib/relaton_nist/data_fetcher.rb +2 -2
- data/lib/relaton_nist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a4b4d939bc25c7c8968747b391784b5e0238a6961b5544d6f48cd77848addf9
|
|
4
|
+
data.tar.gz: f5684a7aa32f04b30fed89c1d43dc0c5247562a94bf97b1d65f6b0c80de2f054
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa2d613dc42ac689b422b73d0b930459bbfdad99ca8e0e4302a8f586931f89f90ae0189d6d052e8e003659b75df4f5a07941835d4f03f4e98ead50ebcfef738d
|
|
7
|
+
data.tar.gz: 19b7411e9f15891b7513dd934a678702fcfaccc80512385e2354d69ca66f2cf3617b2f8e88ce47b7141ee885dc933e59931731dec14e1b90e550964184f4ff92
|
data/README.adoc
CHANGED
|
@@ -10,7 +10,8 @@ image:https://img.shields.io/github/commits-since/relaton/relaton-nist/latest.sv
|
|
|
10
10
|
|
|
11
11
|
== Purpose
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Relaton for NIST provides bibliographic information of NIST publications using
|
|
14
|
+
the
|
|
14
15
|
https://github.com/metanorma/metanorma-model-nist#nist-bibliographic-item-model[NistBibliographicItem model].
|
|
15
16
|
|
|
16
17
|
Relaton for NIST has been developed in cooperation with the NIST Cybersecurity
|
|
@@ -18,18 +19,25 @@ Resource Center (CSRC) and the Computer Security Division (ITL/CSD).
|
|
|
18
19
|
|
|
19
20
|
== Data sources
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
=== General
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
Relaton for NIST retrieves bibliographic information from two sources,
|
|
25
|
+
in the following priority:
|
|
26
|
+
|
|
27
|
+
. NIST Cybersecurity Resource Center (CSRC)
|
|
28
|
+
|
|
29
|
+
. NIST Library of the NIST Information Services Office (ISO)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
=== NIST Cybersecurity Resource Center (CSRC)
|
|
33
|
+
|
|
34
|
+
The NIST CSRC bibliographic feed is used as the primary source for all CSRC
|
|
35
|
+
publications.
|
|
28
36
|
|
|
29
37
|
Bibliographic information offered through CSRC is provided with enhanced
|
|
30
|
-
metadata
|
|
38
|
+
metadata unavailable from the NIST Library dataset, including:
|
|
31
39
|
|
|
32
|
-
*
|
|
40
|
+
* versioned drafts (the NIST Library dataset only contains the latest publication: latest draft or final publication)
|
|
33
41
|
* revision information: revision number, iteration
|
|
34
42
|
* document stage information: retired, withdrawn, etc.
|
|
35
43
|
* bibliographic dates, including issued date, updated date, published date,
|
|
@@ -37,20 +45,38 @@ metadata that is not available in the NIST Library dataset, including:
|
|
|
37
45
|
* document relationships: supersession and replacements
|
|
38
46
|
* contacts: enhanced name parts and affiliation information
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
sources:
|
|
42
|
-
|
|
43
|
-
. bibliographic feed from NIST CSRC
|
|
44
|
-
. NIST Library dataset
|
|
45
|
-
|
|
46
|
-
The NIST CSRC provides:
|
|
48
|
+
The NIST CSRC provides the following documents:
|
|
47
49
|
|
|
48
50
|
* NIST SP 800-*
|
|
49
51
|
* NIST SP 500-*
|
|
50
52
|
* NIST SP 1800-*
|
|
51
53
|
* NIST FIPS {31, 39, 41, 46, 46-$$*$$, 48, 65, 73, 74, 81, 83, 87, 102, 112, 113, 139, 140-$$*$$, 141, 171, 180, 180-$$*$$, 181, 186, 186-$$*$$, 188, 190, 191, 196, 197, 198, 198-1, 199, 200, 201, 201-*, 202}
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
As this feed is provided by CSRC in the native Relaton JSON format, no data
|
|
56
|
+
transform is necessary.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
=== NIST Library
|
|
60
|
+
|
|
61
|
+
The NIST Library offers the full NIST Technical Publications dataset at
|
|
62
|
+
https://github.com/usnistgov/NIST-Tech-Pubs[GitHub].
|
|
63
|
+
|
|
64
|
+
The library data is managed internally using MARC21, and the GitHub repository
|
|
65
|
+
offers this information via MARC21 XML and MODS (in XML).
|
|
66
|
+
|
|
67
|
+
Relaton for NIST uses the MODS dataset obtained from the following location:
|
|
68
|
+
|
|
69
|
+
* https://github.com/usnistgov/NIST-Tech-Pubs/releases[NIST-Tech-Pubs/releases],
|
|
70
|
+
the `allrecords-MODS.xml` file
|
|
71
|
+
|
|
72
|
+
The MODS XML file is parsed using the
|
|
73
|
+
https://github.com/relaton/loc_mods[`loc_mods`] library and its data mapped to
|
|
74
|
+
the Relaton model.
|
|
75
|
+
|
|
76
|
+
The NIST Library dataset provides documents listed in the
|
|
77
|
+
https://github.com/relaton/relaton-data-nist/blob/main/index-v1.yaml[index].
|
|
78
|
+
|
|
79
|
+
|
|
54
80
|
|
|
55
81
|
== Installation
|
|
56
82
|
|
|
@@ -63,104 +89,85 @@ gem 'relaton-nist'
|
|
|
63
89
|
|
|
64
90
|
And then execute:
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
[source,sh]
|
|
93
|
+
----
|
|
94
|
+
$ bundle
|
|
95
|
+
----
|
|
67
96
|
|
|
68
97
|
Or install it yourself as:
|
|
69
98
|
|
|
70
|
-
|
|
99
|
+
[source,sh]
|
|
100
|
+
----
|
|
101
|
+
$ gem install relaton_nist
|
|
102
|
+
----
|
|
71
103
|
|
|
72
104
|
== Usage
|
|
73
105
|
|
|
74
|
-
===
|
|
106
|
+
=== Retrieving an entry
|
|
75
107
|
|
|
108
|
+
==== By NIST PubID
|
|
109
|
+
|
|
110
|
+
Relaton supports using the
|
|
111
|
+
https://www.nist.gov/system/files/documents/2022/04/01/PubID_Syntax_NIST_TechPubs.pdf[NIST PubID]
|
|
112
|
+
as the retrieval key for bibliographic entries.
|
|
113
|
+
|
|
114
|
+
NOTE: Relaton for NIST is the first public implementation of the
|
|
115
|
+
https://www.nist.gov/news-events/news/2021/08/nist-technical-series-publications-proposed-publication-identifier-syntax[NIST PubID].
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
.Retrieving a bibliographic entry using NIST PubID
|
|
119
|
+
[example]
|
|
120
|
+
====
|
|
76
121
|
[source,ruby]
|
|
77
122
|
----
|
|
78
|
-
require 'relaton_nist'
|
|
79
|
-
=>
|
|
123
|
+
> require 'relaton_nist'
|
|
124
|
+
=>
|
|
125
|
+
true
|
|
80
126
|
|
|
81
|
-
hit_collection = RelatonNist::NistBibliography.search("NISTIR 8200")
|
|
127
|
+
> hit_collection = RelatonNist::NistBibliography.search("NISTIR 8200")
|
|
82
128
|
[relaton-nist] (NIST IR 8200) Fetching from csrc.nist.gov ...
|
|
83
129
|
[relaton-nist] (NIST IR 8200) Fetching from Relaton repository ...
|
|
84
|
-
=>
|
|
130
|
+
=>
|
|
131
|
+
<RelatonNist::HitCollection:0x00000000004b28 @ref=NIST IR 8200 @fetched=false>
|
|
85
132
|
|
|
86
|
-
item = hit_collection[0].fetch
|
|
87
|
-
=>
|
|
88
|
-
|
|
133
|
+
> item = hit_collection[0].fetch
|
|
134
|
+
=>
|
|
135
|
+
#<RelatonNist::NistBibliographicItem:0x007fc049aa6778
|
|
136
|
+
# ...
|
|
89
137
|
----
|
|
138
|
+
====
|
|
90
139
|
|
|
91
|
-
=== XML serialization
|
|
92
|
-
[source,ruby]
|
|
93
|
-
----
|
|
94
|
-
item.to_xml
|
|
95
|
-
=> "<bibitem id="NISTIR8200" type="standard" schema-version="v1.2.9">
|
|
96
|
-
<fetched>2023-10-16</fetched>
|
|
97
|
-
<title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
|
|
98
|
-
...
|
|
99
|
-
<bibitem>"
|
|
100
|
-
----
|
|
101
|
-
With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and adds flavor `ext` element.
|
|
102
|
-
[source,ruby]
|
|
103
|
-
----
|
|
104
|
-
item.to_xml bibdata: true
|
|
105
|
-
=> "<bibdata type="standard" schema-version="v1.2.9">
|
|
106
|
-
<fetched>2023-10-16</fetched>
|
|
107
|
-
<title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
|
|
108
|
-
...
|
|
109
|
-
<ext schema-version="v1.0.0">
|
|
110
|
-
<doctype>standard</doctype>
|
|
111
|
-
</ext>
|
|
112
|
-
</bibdata>"
|
|
113
|
-
----
|
|
114
140
|
|
|
115
|
-
|
|
141
|
+
The publication year can also be given if the publication has seen multiple
|
|
142
|
+
revisions or editions.
|
|
143
|
+
|
|
144
|
+
.Retrieving a bibliographic entry using NIST PubID with year
|
|
145
|
+
[example]
|
|
146
|
+
====
|
|
116
147
|
[source,ruby]
|
|
117
148
|
----
|
|
118
|
-
RelatonNist::NistBibliography.get("NIST IR 8200", "2018")
|
|
149
|
+
> RelatonNist::NistBibliography.get("NIST IR 8200", "2018")
|
|
119
150
|
[relaton-nist] (NIST SP 8200:2018) Fetching from csrc.nist.gov ...
|
|
120
151
|
[relaton-nist] (NIST IR 8200:2018) Fetching from Relaton repository...
|
|
121
152
|
[relaton-nist] (NIST IR 8200:2018) Found: `NIST IR 8200`
|
|
122
|
-
=>
|
|
123
|
-
|
|
153
|
+
=>
|
|
154
|
+
#<RelatonNist::NistBibliographicItem:0x00007fab74a572c0
|
|
155
|
+
# ...
|
|
124
156
|
----
|
|
157
|
+
====
|
|
125
158
|
|
|
126
|
-
=== Get short citation
|
|
127
|
-
A short citation is a convention about a citation's format. The format for NIST publications is:
|
|
128
|
-
----
|
|
129
|
-
NIST {abbrev(series)} {docnumber} {(edition), optional} {(stage), optional}
|
|
130
|
-
# or
|
|
131
|
-
{abbrev(series)} {docnumber} {(edition), optional} {(stage), optional}
|
|
132
|
-
----
|
|
133
|
-
- `(stage)` is empty if the state is "final" (published). In case the state is "draft" it should be:
|
|
134
|
-
* PD for public draft
|
|
135
|
-
* IPD for initial iteration public draft or 2PD, 3PD and so one for following iterations
|
|
136
|
-
* FPD for final public draft
|
|
137
|
-
- `(edition)` is the date of publication or update
|
|
138
|
-
- `docnumber` is the full NIST number, including revision, e.g., 800-52
|
|
139
|
-
|
|
140
|
-
The format for FIPS publications is:
|
|
141
|
-
----
|
|
142
|
-
FIPS {docnumber}
|
|
143
|
-
# or
|
|
144
|
-
NIST FIPS {docnumber}
|
|
145
|
-
----
|
|
146
|
-
[source,ruby]
|
|
147
|
-
----
|
|
148
|
-
RelatonNist::NistBibliography.get("NIST SP 800-205 (February 2019) (IPD)")
|
|
149
|
-
[relaton-nist] (NIST SP 800-205) Fetching from csrc.nist.gov ...
|
|
150
|
-
[relaton-nist] (NIST SP 800-205) Found: `NIST SP 800-205 (Draft)`
|
|
151
|
-
=> #<RelatonNist::NistBibliographicItem:0x00000001105afdc8
|
|
152
|
-
...
|
|
153
|
-
----
|
|
154
159
|
|
|
155
|
-
|
|
160
|
+
A NIST PubID can contain these optional parameters `{ptN}{vN}{verN}{rN}{/Add}`:
|
|
156
161
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
- Addendum is specified as `/Add` (SP 800-38A/Add)
|
|
162
|
+
* Part is specified as `ptN` (SP 800-57pt1)
|
|
163
|
+
* Volume is specified as `vN` (SP 800-60v1)
|
|
164
|
+
* Version is specified as `verN` (SP 800-45ver2)
|
|
165
|
+
* Revision is specified as `rN` (SP 800-40r3) or `-N`
|
|
166
|
+
* Addendum is specified as `/Add` (SP 800-38A/Add)
|
|
163
167
|
|
|
168
|
+
.Retrieving a bibliographic entry with a PubID that contains revision
|
|
169
|
+
[example]
|
|
170
|
+
====
|
|
164
171
|
[source,ruby]
|
|
165
172
|
----
|
|
166
173
|
item = RelatonNist::NistBibliography.get 'NIST SP 800-67r1'
|
|
@@ -171,7 +178,14 @@ item = RelatonNist::NistBibliography.get 'NIST SP 800-67r1'
|
|
|
171
178
|
|
|
172
179
|
item.docidentifier.first.id
|
|
173
180
|
=> "NIST SP 800-67 Rev. 1"
|
|
181
|
+
----
|
|
182
|
+
====
|
|
174
183
|
|
|
184
|
+
.Retrieving a bibliographic entry with a PubID that specifies an addendum
|
|
185
|
+
[example]
|
|
186
|
+
====
|
|
187
|
+
[source,ruby]
|
|
188
|
+
----
|
|
175
189
|
item = RelatonNist::NistBibliography.get 'NIST SP 800-38A/Add'
|
|
176
190
|
[relaton-nist] (NIST SP 800-38A/Add) Fetching from csrc.nist.gov ...
|
|
177
191
|
[relaton-nist] (NIST SP 800-38A/Add) Found: `NIST SP 800-38A-Add`
|
|
@@ -181,11 +195,132 @@ item = RelatonNist::NistBibliography.get 'NIST SP 800-38A/Add'
|
|
|
181
195
|
item.docidentifier.first.id
|
|
182
196
|
=> "NIST SP 800-38A-Add"
|
|
183
197
|
----
|
|
198
|
+
====
|
|
199
|
+
|
|
200
|
+
==== By NIST PubID abbreviated form
|
|
201
|
+
|
|
202
|
+
The NIST PubID "abbreviated form" is the form of PubID printed on the inner
|
|
203
|
+
cover of a NIST publication.
|
|
204
|
+
|
|
205
|
+
The NIST PubID abbreviated format has the following syntax:
|
|
206
|
+
|
|
207
|
+
* `NIST {abbrev(series)} {docnumber} {(edition), optional} {(stage), optional}`, or
|
|
208
|
+
* `{abbrev(series)} {docnumber} {(edition), optional} {(stage), optional}`
|
|
209
|
+
|
|
210
|
+
Where,
|
|
184
211
|
|
|
185
|
-
|
|
212
|
+
`(stage)`::
|
|
213
|
+
empty if the state is "final" (published).
|
|
214
|
+
In case the state is "draft" it should be:
|
|
215
|
+
`PD`::: for the public draft
|
|
216
|
+
`IPD`::: for the initial public draft
|
|
217
|
+
`{n}PD`::: for subsequent public drafts, such as 2PD, 3PD and so on.
|
|
218
|
+
`FPD`::: for the final public draft
|
|
186
219
|
|
|
187
|
-
|
|
220
|
+
`(edition)`:: the date of publication or update
|
|
221
|
+
`docnumber`:: the full NIST document number, e.g., 800-52.
|
|
188
222
|
|
|
223
|
+
.Retrieving an entry using the NIST PubID abbreviated form
|
|
224
|
+
[example]
|
|
225
|
+
====
|
|
226
|
+
[source,ruby]
|
|
227
|
+
----
|
|
228
|
+
> RelatonNist::NistBibliography.get("NIST SP 800-205 (February 2019) (IPD)")
|
|
229
|
+
[relaton-nist] (NIST SP 800-205) Fetching from csrc.nist.gov ...
|
|
230
|
+
[relaton-nist] (NIST SP 800-205) Found: `NIST SP 800-205 (Draft)`
|
|
231
|
+
=>
|
|
232
|
+
#<RelatonNist::NistBibliographicItem:0x00000001105afdc8
|
|
233
|
+
# ...
|
|
234
|
+
----
|
|
235
|
+
====
|
|
236
|
+
|
|
237
|
+
==== By FIPS PubID
|
|
238
|
+
|
|
239
|
+
The format for FIPS publications is:
|
|
240
|
+
|
|
241
|
+
* `FIPS {docnumber}`, or
|
|
242
|
+
* `NIST FIPS {docnumber}`
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
.Retrieving an entry using the FIPS PubID
|
|
246
|
+
[example]
|
|
247
|
+
====
|
|
248
|
+
[source,ruby]
|
|
249
|
+
----
|
|
250
|
+
> RelatonNist::NistBibliography.get("NIST FIPS 140-3")
|
|
251
|
+
[relaton-nist] INFO: (NIST FIPS 140-3) Fetching from csrc.nist.gov ...
|
|
252
|
+
[relaton-nist] INFO: (NIST FIPS 140-3) Found: `NIST FIPS 140-3`
|
|
253
|
+
=>
|
|
254
|
+
# #<RelatonNist::NistBibliographicItem:0x000000013b68fb50
|
|
255
|
+
# ...
|
|
256
|
+
----
|
|
257
|
+
====
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
=== Serializing an entry
|
|
261
|
+
|
|
262
|
+
==== To Relaton XML
|
|
263
|
+
|
|
264
|
+
.Serializing an entry to Relaton XML
|
|
265
|
+
[example]
|
|
266
|
+
====
|
|
267
|
+
[source,ruby]
|
|
268
|
+
----
|
|
269
|
+
> item.to_xml
|
|
270
|
+
#=> "<bibitem id="NISTIR8200" type="standard" schema-version="v1.2.9">
|
|
271
|
+
# <fetched>2023-10-16</fetched>
|
|
272
|
+
# <title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
|
|
273
|
+
# ...
|
|
274
|
+
# <bibitem>"
|
|
275
|
+
----
|
|
276
|
+
====
|
|
277
|
+
|
|
278
|
+
When the option `bibdata: true` is given, the method outputs XML wrapped by
|
|
279
|
+
the `bibdata` element and adds a flavor-specific `ext` element.
|
|
280
|
+
|
|
281
|
+
.Serializing an entry to Relaton XML with `bibdata: true`
|
|
282
|
+
[example]
|
|
283
|
+
====
|
|
284
|
+
[source,ruby]
|
|
285
|
+
----
|
|
286
|
+
> item.to_xml bibdata: true
|
|
287
|
+
=>
|
|
288
|
+
"<bibdata type="standard" schema-version="v1.2.9">
|
|
289
|
+
# <fetched>2023-10-16</fetched>
|
|
290
|
+
# <title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
|
|
291
|
+
# ...
|
|
292
|
+
# <ext schema-version="v1.0.0">
|
|
293
|
+
# <doctype>standard</doctype>
|
|
294
|
+
# </ext>
|
|
295
|
+
# </bibdata>"
|
|
296
|
+
----
|
|
297
|
+
====
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
=== Accessing attributes
|
|
302
|
+
|
|
303
|
+
==== Identifier components
|
|
304
|
+
|
|
305
|
+
A NIST PubID can contain these optional parameters `{ptN}{vN}{verN}{rN}{/Add}`.
|
|
306
|
+
|
|
307
|
+
They can be accessed through the following methods:
|
|
308
|
+
|
|
309
|
+
* `part`
|
|
310
|
+
* `volume`
|
|
311
|
+
* `version`
|
|
312
|
+
* `revision`
|
|
313
|
+
* `addendum`
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
==== Typed links
|
|
317
|
+
|
|
318
|
+
NIST publications may have `src` and `doi` links, obtained using the `#link`
|
|
319
|
+
method.
|
|
320
|
+
|
|
321
|
+
.Accessing links of a NIST bibliographic item
|
|
322
|
+
[example]
|
|
323
|
+
====
|
|
189
324
|
[source,ruby]
|
|
190
325
|
----
|
|
191
326
|
item.link
|
|
@@ -196,8 +331,20 @@ item.link
|
|
|
196
331
|
@type="src">,
|
|
197
332
|
#<RelatonBib::TypedUri:0x00000001110879a8 @content=#<Addressable::URI:0x8d4 URI:https://doi.org/10.6028/NIST.SP.800-38A-Add>, @language=nil, @script=nil, @type="doi">]
|
|
198
333
|
----
|
|
334
|
+
====
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
=== Loading entries
|
|
199
338
|
|
|
200
|
-
|
|
339
|
+
// ==== From XML
|
|
340
|
+
|
|
341
|
+
==== From YAML
|
|
342
|
+
|
|
343
|
+
Offline Relaton YAML files can be loaded directly as bibliographic items.
|
|
344
|
+
|
|
345
|
+
.Loading a Relaton YAML file
|
|
346
|
+
[example]
|
|
347
|
+
====
|
|
201
348
|
[source,ruby]
|
|
202
349
|
----
|
|
203
350
|
hash = YAML.load_file 'spec/examples/nist_bib_item.yml'
|
|
@@ -208,40 +355,65 @@ RelatonNist::NistBibliographicItem.from_hash hash
|
|
|
208
355
|
=> #<RelatonNist::NistBibliographicItem:0x007f8b708505b8
|
|
209
356
|
...
|
|
210
357
|
----
|
|
358
|
+
====
|
|
359
|
+
|
|
211
360
|
|
|
212
|
-
===
|
|
361
|
+
=== Fetching data
|
|
213
362
|
|
|
214
|
-
|
|
363
|
+
On a search, the CSRC data sources are fetched and stored in the user's cache.
|
|
215
364
|
|
|
216
|
-
|
|
217
|
-
Arguments:
|
|
365
|
+
This gem uses the https://github.com/usnistgov/NIST-Tech-Pubs/releases/download/May2024/allrecords-MODS.xml dataset as NIST-Tech-Pubs data source.
|
|
218
366
|
|
|
219
|
-
|
|
220
|
-
- `format` - the format in which the documents are saved. Possible formats are: `yaml`, `xml`, `bibxxml` (default `yaml`).
|
|
367
|
+
The following method fetches all the documents from the NIST-Tech-Pubs dataset, then saves them to the `./data` folder in YAML format.
|
|
221
368
|
|
|
369
|
+
.Fetching all data with default configuration
|
|
370
|
+
[example]
|
|
371
|
+
====
|
|
222
372
|
[source,ruby]
|
|
223
373
|
----
|
|
224
|
-
RelatonNist::DataFetcher.fetch
|
|
374
|
+
> RelatonNist::DataFetcher.fetch
|
|
225
375
|
Started at: 2021-09-01 18:01:01 +0200
|
|
226
376
|
Stopped at: 2021-09-01 18:01:43 +0200
|
|
227
377
|
Done in: 42 sec.
|
|
228
378
|
=> nil
|
|
229
379
|
----
|
|
380
|
+
====
|
|
230
381
|
|
|
231
|
-
|
|
382
|
+
.Fetching all data to the `data` folder
|
|
383
|
+
[example]
|
|
384
|
+
====
|
|
385
|
+
[source,ruby]
|
|
386
|
+
----
|
|
387
|
+
> RelatonNist::DataFetcher.fetch(output: "data", format: "yaml")
|
|
388
|
+
----
|
|
389
|
+
====
|
|
390
|
+
|
|
391
|
+
Options:
|
|
392
|
+
|
|
393
|
+
`output`:: folder to save documents (default `./data`).
|
|
394
|
+
`format`:: format in which the documents are saved. Possible formats are:
|
|
395
|
+
`yaml`::: (default) save in Relaton YAML format
|
|
396
|
+
`xml`::: save in Relaton XML format
|
|
397
|
+
`bibxml`::: save in the IETF BibXML format
|
|
232
398
|
|
|
233
|
-
RelatonNist 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.
|
|
234
399
|
|
|
235
|
-
|
|
400
|
+
=== Logging
|
|
401
|
+
|
|
402
|
+
Relaton for NIST uses https://github.com/relaton/relaton-logger[relaton-logger]
|
|
403
|
+
for logging.
|
|
236
404
|
|
|
237
|
-
|
|
405
|
+
By default, it logs to `$STDOUT`. To change log levels and add other loggers,
|
|
406
|
+
refer to the https://github.com/relaton/relaton-logger#usage[relaton-logger]
|
|
407
|
+
documentation.
|
|
238
408
|
|
|
239
|
-
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).
|
|
240
409
|
|
|
241
410
|
== Contributing
|
|
242
411
|
|
|
243
|
-
Bug reports and pull requests are welcome
|
|
412
|
+
Bug reports and pull requests are welcome.
|
|
244
413
|
|
|
245
414
|
== License
|
|
246
415
|
|
|
247
|
-
|
|
416
|
+
Copyright Ribose.
|
|
417
|
+
|
|
418
|
+
The gem is available as open source under the terms of the
|
|
419
|
+
https://opensource.org/licenses/MIT[MIT License].
|
|
@@ -65,8 +65,8 @@ module RelatonNist
|
|
|
65
65
|
t2 = Time.now
|
|
66
66
|
puts "Stopped at: #{t2}"
|
|
67
67
|
puts "Done in: #{(t2 - t1).round} sec."
|
|
68
|
-
rescue StandardError => e
|
|
69
|
-
|
|
68
|
+
# rescue StandardError => e
|
|
69
|
+
# Util.error "#{e.message}\n#{e.backtrace[0..5].join("\n")}"
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def fetch_tech_pubs
|
data/lib/relaton_nist/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-nist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.19.
|
|
4
|
+
version: 1.19.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|