relaton-itu 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/grammars/biblio.rng +1 -1
- data/grammars/isodoc.rng +427 -0
- data/lib/relaton_itu/hash_converter.rb +1 -1
- data/lib/relaton_itu/itu_bibliographic_item.rb +5 -4
- data/lib/relaton_itu/itu_bibliography.rb +1 -1
- data/lib/relaton_itu/scrapper.rb +3 -25
- data/lib/relaton_itu/structured_identifier.rb +4 -0
- data/lib/relaton_itu/version.rb +1 -1
- data/lib/relaton_itu/xml_parser.rb +1 -1
- data/relaton-itu.gemspec +2 -2
- metadata +5 -6
- data/grammars/isostandard.rng +0 -530
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731a09736ad5aadeb53f70290bc4e7e03679360d419f9f1227327d6a3f0b4b06
|
4
|
+
data.tar.gz: e7b7a3a1d60722e150de1cee48bed3843a0759fe1110cf454d4a468449828509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad25807e4727e037d2dce85b4e6f9324948fe0a620462c9d4daddabd8deadc12d157d290a1206748d6ff05a2bf27a9ccd832cb801ce4ccf009c645110ab54eb3
|
7
|
+
data.tar.gz: 42adeed13d2531f34b3c9809028a58f2d2b3b2d1642a188d6425bd30bc5a79d4a00e9946c2af34427851a1554c70dc54eca65821efc1c66015403aece9d9a835
|
data/grammars/biblio.rng
CHANGED
@@ -532,7 +532,7 @@
|
|
532
532
|
</define>
|
533
533
|
<define name="LocalityType">
|
534
534
|
<data type="string">
|
535
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|locality:[a-zA-Z0-9_]+</param>
|
535
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
536
536
|
</data>
|
537
537
|
</define>
|
538
538
|
<define name="referenceFrom">
|
data/grammars/isodoc.rng
CHANGED
@@ -64,6 +64,85 @@
|
|
64
64
|
<text/>
|
65
65
|
</element>
|
66
66
|
</define>
|
67
|
+
<define name="ul">
|
68
|
+
<element name="ul">
|
69
|
+
<attribute name="id">
|
70
|
+
<data type="ID"/>
|
71
|
+
</attribute>
|
72
|
+
<optional>
|
73
|
+
<attribute name="keep-with-next">
|
74
|
+
<data type="boolean"/>
|
75
|
+
</attribute>
|
76
|
+
</optional>
|
77
|
+
<optional>
|
78
|
+
<attribute name="keep-lines-together">
|
79
|
+
<data type="boolean"/>
|
80
|
+
</attribute>
|
81
|
+
</optional>
|
82
|
+
<oneOrMore>
|
83
|
+
<ref name="li"/>
|
84
|
+
</oneOrMore>
|
85
|
+
<zeroOrMore>
|
86
|
+
<ref name="note"/>
|
87
|
+
</zeroOrMore>
|
88
|
+
</element>
|
89
|
+
</define>
|
90
|
+
<define name="ol">
|
91
|
+
<element name="ol">
|
92
|
+
<attribute name="id">
|
93
|
+
<data type="ID"/>
|
94
|
+
</attribute>
|
95
|
+
<optional>
|
96
|
+
<attribute name="keep-with-next">
|
97
|
+
<data type="boolean"/>
|
98
|
+
</attribute>
|
99
|
+
</optional>
|
100
|
+
<optional>
|
101
|
+
<attribute name="keep-lines-together">
|
102
|
+
<data type="boolean"/>
|
103
|
+
</attribute>
|
104
|
+
</optional>
|
105
|
+
<attribute name="type">
|
106
|
+
<choice>
|
107
|
+
<value>roman</value>
|
108
|
+
<value>alphabet</value>
|
109
|
+
<value>arabic</value>
|
110
|
+
<value>roman_upper</value>
|
111
|
+
<value>alphabet_upper</value>
|
112
|
+
</choice>
|
113
|
+
</attribute>
|
114
|
+
<oneOrMore>
|
115
|
+
<ref name="li"/>
|
116
|
+
</oneOrMore>
|
117
|
+
<zeroOrMore>
|
118
|
+
<ref name="note"/>
|
119
|
+
</zeroOrMore>
|
120
|
+
</element>
|
121
|
+
</define>
|
122
|
+
<define name="dl">
|
123
|
+
<element name="dl">
|
124
|
+
<attribute name="id">
|
125
|
+
<data type="ID"/>
|
126
|
+
</attribute>
|
127
|
+
<optional>
|
128
|
+
<attribute name="keep-with-next">
|
129
|
+
<data type="boolean"/>
|
130
|
+
</attribute>
|
131
|
+
</optional>
|
132
|
+
<optional>
|
133
|
+
<attribute name="keep-lines-together">
|
134
|
+
<data type="boolean"/>
|
135
|
+
</attribute>
|
136
|
+
</optional>
|
137
|
+
<oneOrMore>
|
138
|
+
<ref name="dt"/>
|
139
|
+
<ref name="dd"/>
|
140
|
+
</oneOrMore>
|
141
|
+
<zeroOrMore>
|
142
|
+
<ref name="note"/>
|
143
|
+
</zeroOrMore>
|
144
|
+
</element>
|
145
|
+
</define>
|
67
146
|
<define name="example">
|
68
147
|
<element name="example">
|
69
148
|
<attribute name="id">
|
@@ -77,6 +156,19 @@
|
|
77
156
|
<optional>
|
78
157
|
<attribute name="subsequence"/>
|
79
158
|
</optional>
|
159
|
+
<optional>
|
160
|
+
<attribute name="number"/>
|
161
|
+
</optional>
|
162
|
+
<optional>
|
163
|
+
<attribute name="keep-with-next">
|
164
|
+
<data type="boolean"/>
|
165
|
+
</attribute>
|
166
|
+
</optional>
|
167
|
+
<optional>
|
168
|
+
<attribute name="keep-lines-together">
|
169
|
+
<data type="boolean"/>
|
170
|
+
</attribute>
|
171
|
+
</optional>
|
80
172
|
<optional>
|
81
173
|
<ref name="tname"/>
|
82
174
|
</optional>
|
@@ -97,6 +189,296 @@
|
|
97
189
|
</zeroOrMore>
|
98
190
|
</element>
|
99
191
|
</define>
|
192
|
+
<define name="table">
|
193
|
+
<element name="table">
|
194
|
+
<attribute name="id">
|
195
|
+
<data type="ID"/>
|
196
|
+
</attribute>
|
197
|
+
<optional>
|
198
|
+
<attribute name="unnumbered">
|
199
|
+
<data type="boolean"/>
|
200
|
+
</attribute>
|
201
|
+
</optional>
|
202
|
+
<optional>
|
203
|
+
<attribute name="number"/>
|
204
|
+
</optional>
|
205
|
+
<optional>
|
206
|
+
<attribute name="subsequence"/>
|
207
|
+
</optional>
|
208
|
+
<optional>
|
209
|
+
<attribute name="alt"/>
|
210
|
+
</optional>
|
211
|
+
<optional>
|
212
|
+
<attribute name="summary"/>
|
213
|
+
</optional>
|
214
|
+
<optional>
|
215
|
+
<attribute name="uri">
|
216
|
+
<data type="anyURI"/>
|
217
|
+
</attribute>
|
218
|
+
</optional>
|
219
|
+
<optional>
|
220
|
+
<attribute name="keep-with-next">
|
221
|
+
<data type="boolean"/>
|
222
|
+
</attribute>
|
223
|
+
</optional>
|
224
|
+
<optional>
|
225
|
+
<attribute name="keep-lines-together">
|
226
|
+
<data type="boolean"/>
|
227
|
+
</attribute>
|
228
|
+
</optional>
|
229
|
+
<optional>
|
230
|
+
<ref name="tname"/>
|
231
|
+
</optional>
|
232
|
+
<optional>
|
233
|
+
<ref name="thead"/>
|
234
|
+
</optional>
|
235
|
+
<ref name="tbody"/>
|
236
|
+
<optional>
|
237
|
+
<ref name="tfoot"/>
|
238
|
+
</optional>
|
239
|
+
<zeroOrMore>
|
240
|
+
<ref name="table-note"/>
|
241
|
+
</zeroOrMore>
|
242
|
+
<optional>
|
243
|
+
<ref name="dl"/>
|
244
|
+
</optional>
|
245
|
+
</element>
|
246
|
+
</define>
|
247
|
+
<define name="figure">
|
248
|
+
<element name="figure">
|
249
|
+
<attribute name="id">
|
250
|
+
<data type="ID"/>
|
251
|
+
</attribute>
|
252
|
+
<optional>
|
253
|
+
<attribute name="unnumbered">
|
254
|
+
<data type="boolean"/>
|
255
|
+
</attribute>
|
256
|
+
</optional>
|
257
|
+
<optional>
|
258
|
+
<attribute name="number"/>
|
259
|
+
</optional>
|
260
|
+
<optional>
|
261
|
+
<attribute name="subsequence"/>
|
262
|
+
</optional>
|
263
|
+
<optional>
|
264
|
+
<attribute name="keep-with-next">
|
265
|
+
<data type="boolean"/>
|
266
|
+
</attribute>
|
267
|
+
</optional>
|
268
|
+
<optional>
|
269
|
+
<attribute name="keep-lines-together">
|
270
|
+
<data type="boolean"/>
|
271
|
+
</attribute>
|
272
|
+
</optional>
|
273
|
+
<optional>
|
274
|
+
<attribute name="class"/>
|
275
|
+
</optional>
|
276
|
+
<optional>
|
277
|
+
<ref name="source"/>
|
278
|
+
</optional>
|
279
|
+
<optional>
|
280
|
+
<ref name="tname"/>
|
281
|
+
</optional>
|
282
|
+
<choice>
|
283
|
+
<ref name="image"/>
|
284
|
+
<ref name="video"/>
|
285
|
+
<ref name="audio"/>
|
286
|
+
<ref name="pre"/>
|
287
|
+
<oneOrMore>
|
288
|
+
<ref name="paragraph-with-footnote"/>
|
289
|
+
</oneOrMore>
|
290
|
+
<zeroOrMore>
|
291
|
+
<ref name="figure"/>
|
292
|
+
</zeroOrMore>
|
293
|
+
</choice>
|
294
|
+
<zeroOrMore>
|
295
|
+
<ref name="fn"/>
|
296
|
+
</zeroOrMore>
|
297
|
+
<optional>
|
298
|
+
<ref name="dl"/>
|
299
|
+
</optional>
|
300
|
+
<zeroOrMore>
|
301
|
+
<ref name="note"/>
|
302
|
+
</zeroOrMore>
|
303
|
+
</element>
|
304
|
+
</define>
|
305
|
+
<define name="sourcecode">
|
306
|
+
<element name="sourcecode">
|
307
|
+
<attribute name="id">
|
308
|
+
<data type="ID"/>
|
309
|
+
</attribute>
|
310
|
+
<optional>
|
311
|
+
<attribute name="unnumbered">
|
312
|
+
<data type="boolean"/>
|
313
|
+
</attribute>
|
314
|
+
</optional>
|
315
|
+
<optional>
|
316
|
+
<attribute name="number"/>
|
317
|
+
</optional>
|
318
|
+
<optional>
|
319
|
+
<attribute name="subsequence"/>
|
320
|
+
</optional>
|
321
|
+
<optional>
|
322
|
+
<attribute name="keep-with-next">
|
323
|
+
<data type="boolean"/>
|
324
|
+
</attribute>
|
325
|
+
</optional>
|
326
|
+
<optional>
|
327
|
+
<attribute name="keep-lines-together">
|
328
|
+
<data type="boolean"/>
|
329
|
+
</attribute>
|
330
|
+
</optional>
|
331
|
+
<optional>
|
332
|
+
<attribute name="lang"/>
|
333
|
+
</optional>
|
334
|
+
<optional>
|
335
|
+
<ref name="tname"/>
|
336
|
+
</optional>
|
337
|
+
<oneOrMore>
|
338
|
+
<choice>
|
339
|
+
<text/>
|
340
|
+
<ref name="callout"/>
|
341
|
+
</choice>
|
342
|
+
</oneOrMore>
|
343
|
+
<zeroOrMore>
|
344
|
+
<ref name="annotation"/>
|
345
|
+
</zeroOrMore>
|
346
|
+
<zeroOrMore>
|
347
|
+
<ref name="note"/>
|
348
|
+
</zeroOrMore>
|
349
|
+
</element>
|
350
|
+
</define>
|
351
|
+
<define name="formula">
|
352
|
+
<element name="formula">
|
353
|
+
<attribute name="id">
|
354
|
+
<data type="ID"/>
|
355
|
+
</attribute>
|
356
|
+
<optional>
|
357
|
+
<attribute name="unnumbered">
|
358
|
+
<data type="boolean"/>
|
359
|
+
</attribute>
|
360
|
+
</optional>
|
361
|
+
<optional>
|
362
|
+
<attribute name="number"/>
|
363
|
+
</optional>
|
364
|
+
<optional>
|
365
|
+
<attribute name="subsequence"/>
|
366
|
+
</optional>
|
367
|
+
<optional>
|
368
|
+
<attribute name="keep-with-next">
|
369
|
+
<data type="boolean"/>
|
370
|
+
</attribute>
|
371
|
+
</optional>
|
372
|
+
<optional>
|
373
|
+
<attribute name="keep-lines-together">
|
374
|
+
<data type="boolean"/>
|
375
|
+
</attribute>
|
376
|
+
</optional>
|
377
|
+
<optional>
|
378
|
+
<attribute name="inequality">
|
379
|
+
<data type="boolean"/>
|
380
|
+
</attribute>
|
381
|
+
</optional>
|
382
|
+
<ref name="stem"/>
|
383
|
+
<optional>
|
384
|
+
<ref name="dl"/>
|
385
|
+
</optional>
|
386
|
+
<zeroOrMore>
|
387
|
+
<ref name="note"/>
|
388
|
+
</zeroOrMore>
|
389
|
+
</element>
|
390
|
+
</define>
|
391
|
+
<define name="ParagraphType">
|
392
|
+
<attribute name="id">
|
393
|
+
<data type="ID"/>
|
394
|
+
</attribute>
|
395
|
+
<optional>
|
396
|
+
<attribute name="align">
|
397
|
+
<ref name="Alignments"/>
|
398
|
+
</attribute>
|
399
|
+
</optional>
|
400
|
+
<optional>
|
401
|
+
<attribute name="keep-with-next">
|
402
|
+
<data type="boolean"/>
|
403
|
+
</attribute>
|
404
|
+
</optional>
|
405
|
+
<optional>
|
406
|
+
<attribute name="keep-lines-together">
|
407
|
+
<data type="boolean"/>
|
408
|
+
</attribute>
|
409
|
+
</optional>
|
410
|
+
<zeroOrMore>
|
411
|
+
<ref name="TextElement"/>
|
412
|
+
</zeroOrMore>
|
413
|
+
<zeroOrMore>
|
414
|
+
<ref name="note"/>
|
415
|
+
</zeroOrMore>
|
416
|
+
</define>
|
417
|
+
<define name="paragraph-with-footnote">
|
418
|
+
<element name="p">
|
419
|
+
<attribute name="id">
|
420
|
+
<data type="ID"/>
|
421
|
+
</attribute>
|
422
|
+
<optional>
|
423
|
+
<attribute name="align">
|
424
|
+
<ref name="Alignments"/>
|
425
|
+
</attribute>
|
426
|
+
</optional>
|
427
|
+
<optional>
|
428
|
+
<attribute name="keep-with-next">
|
429
|
+
<data type="boolean"/>
|
430
|
+
</attribute>
|
431
|
+
</optional>
|
432
|
+
<optional>
|
433
|
+
<attribute name="keep-lines-together">
|
434
|
+
<data type="boolean"/>
|
435
|
+
</attribute>
|
436
|
+
</optional>
|
437
|
+
<zeroOrMore>
|
438
|
+
<choice>
|
439
|
+
<ref name="TextElement"/>
|
440
|
+
<ref name="fn"/>
|
441
|
+
</choice>
|
442
|
+
</zeroOrMore>
|
443
|
+
<zeroOrMore>
|
444
|
+
<ref name="note"/>
|
445
|
+
</zeroOrMore>
|
446
|
+
</element>
|
447
|
+
</define>
|
448
|
+
<define name="quote">
|
449
|
+
<element name="quote">
|
450
|
+
<attribute name="id">
|
451
|
+
<data type="ID"/>
|
452
|
+
</attribute>
|
453
|
+
<optional>
|
454
|
+
<attribute name="alignment">
|
455
|
+
<ref name="Alignments"/>
|
456
|
+
</attribute>
|
457
|
+
</optional>
|
458
|
+
<optional>
|
459
|
+
<attribute name="keep-with-next">
|
460
|
+
<data type="boolean"/>
|
461
|
+
</attribute>
|
462
|
+
</optional>
|
463
|
+
<optional>
|
464
|
+
<attribute name="keep-lines-together">
|
465
|
+
<data type="boolean"/>
|
466
|
+
</attribute>
|
467
|
+
</optional>
|
468
|
+
<optional>
|
469
|
+
<ref name="quote-source"/>
|
470
|
+
</optional>
|
471
|
+
<optional>
|
472
|
+
<ref name="quote-author"/>
|
473
|
+
</optional>
|
474
|
+
<oneOrMore>
|
475
|
+
<ref name="paragraph-with-footnote"/>
|
476
|
+
</oneOrMore>
|
477
|
+
<zeroOrMore>
|
478
|
+
<ref name="note"/>
|
479
|
+
</zeroOrMore>
|
480
|
+
</element>
|
481
|
+
</define>
|
100
482
|
<define name="BibDataExtensionType">
|
101
483
|
<ref name="doctype"/>
|
102
484
|
<optional>
|
@@ -165,6 +547,30 @@
|
|
165
547
|
<attribute name="id">
|
166
548
|
<data type="ID"/>
|
167
549
|
</attribute>
|
550
|
+
<optional>
|
551
|
+
<attribute name="unnumbered">
|
552
|
+
<data type="boolean"/>
|
553
|
+
</attribute>
|
554
|
+
</optional>
|
555
|
+
<optional>
|
556
|
+
<attribute name="number"/>
|
557
|
+
</optional>
|
558
|
+
<optional>
|
559
|
+
<attribute name="subsequence"/>
|
560
|
+
</optional>
|
561
|
+
<optional>
|
562
|
+
<attribute name="keep-with-next">
|
563
|
+
<data type="boolean"/>
|
564
|
+
</attribute>
|
565
|
+
</optional>
|
566
|
+
<optional>
|
567
|
+
<attribute name="keep-lines-together">
|
568
|
+
<data type="boolean"/>
|
569
|
+
</attribute>
|
570
|
+
</optional>
|
571
|
+
<optional>
|
572
|
+
<attribute name="type"/>
|
573
|
+
</optional>
|
168
574
|
<oneOrMore>
|
169
575
|
<choice>
|
170
576
|
<ref name="paragraph"/>
|
@@ -910,6 +1316,27 @@
|
|
910
1316
|
<attribute name="id">
|
911
1317
|
<data type="ID"/>
|
912
1318
|
</attribute>
|
1319
|
+
<optional>
|
1320
|
+
<attribute name="unnumbered">
|
1321
|
+
<data type="boolean"/>
|
1322
|
+
</attribute>
|
1323
|
+
</optional>
|
1324
|
+
<optional>
|
1325
|
+
<attribute name="number"/>
|
1326
|
+
</optional>
|
1327
|
+
<optional>
|
1328
|
+
<attribute name="subsequence"/>
|
1329
|
+
</optional>
|
1330
|
+
<optional>
|
1331
|
+
<attribute name="keep-with-next">
|
1332
|
+
<data type="boolean"/>
|
1333
|
+
</attribute>
|
1334
|
+
</optional>
|
1335
|
+
<optional>
|
1336
|
+
<attribute name="keep-lines-together">
|
1337
|
+
<data type="boolean"/>
|
1338
|
+
</attribute>
|
1339
|
+
</optional>
|
913
1340
|
<oneOrMore>
|
914
1341
|
<choice>
|
915
1342
|
<ref name="paragraph"/>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module RelatonItu
|
2
|
-
class ItuBibliographicItem <
|
2
|
+
class ItuBibliographicItem < RelatonBib::BibliographicItem
|
3
3
|
TYPES = %w[
|
4
4
|
recommendation recommendation-supplement recommendation-amendment
|
5
5
|
recommendation-corrigendum recommendation-errata recommendation-annex
|
@@ -9,11 +9,12 @@ module RelatonItu
|
|
9
9
|
|
10
10
|
# @params structuredidentifier [RelatonItu::StructuredIdentifier]
|
11
11
|
def initialize(**args)
|
12
|
-
@doctype = args.delete :doctype
|
13
|
-
if doctype && !TYPES.include?(doctype)
|
14
|
-
warn "[relaton-itu] WARNING: invalid doctype: #{doctype}"
|
12
|
+
# @doctype = args.delete :doctype
|
13
|
+
if args[:doctype] && !TYPES.include?(args[:doctype])
|
14
|
+
warn "[relaton-itu] WARNING: invalid doctype: #{args[:doctype]}"
|
15
15
|
end
|
16
16
|
super
|
17
|
+
# @doctype = args[:doctype]
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
data/lib/relaton_itu/scrapper.rb
CHANGED
@@ -43,6 +43,7 @@ module RelatonItu
|
|
43
43
|
|
44
44
|
ItuBibliographicItem.new(
|
45
45
|
fetched: Date.today.to_s,
|
46
|
+
type: "standard",
|
46
47
|
docid: fetch_docid(doc),
|
47
48
|
edition: edition,
|
48
49
|
language: ["en"],
|
@@ -170,7 +171,7 @@ module RelatonItu
|
|
170
171
|
doc.xpath('//div[contains(@id, "tab_sup")]//table/tr[position()>2]').map do |r|
|
171
172
|
ref = r.at('./td/span[contains(@id, "title_e")]/nobr/a')
|
172
173
|
fref = RelatonBib::FormattedRef.new(content: ref.text, language: "en", script: "Latn")
|
173
|
-
bibitem =
|
174
|
+
bibitem = ItuBibliographicItem.new(formattedref: fref, type: "standard")
|
174
175
|
{ type: "complements", bibitem: bibitem }
|
175
176
|
end
|
176
177
|
end
|
@@ -183,30 +184,7 @@ module RelatonItu
|
|
183
184
|
t = doc.at("//td[@class='title']|//div/table[1]/tr[4]/td/strong")
|
184
185
|
return [] unless t
|
185
186
|
|
186
|
-
|
187
|
-
case titles.size
|
188
|
-
when 0
|
189
|
-
intro, main, part = nil, "", nil
|
190
|
-
when 1
|
191
|
-
intro, main, part = nil, titles[0], nil
|
192
|
-
when 2
|
193
|
-
if /^(Part|Partie) \d+:/ =~ titles[1]
|
194
|
-
intro, main, part = nil, titles[0], titles[1]
|
195
|
-
else
|
196
|
-
intro, main, part = titles[0], titles[1], nil
|
197
|
-
end
|
198
|
-
when 3
|
199
|
-
intro, main, part = titles[0], titles[1], titles[2]
|
200
|
-
else
|
201
|
-
intro, main, part = titles[0], titles[1], titles[2..-1]&.join(" -- ")
|
202
|
-
end
|
203
|
-
[{
|
204
|
-
title_intro: intro,
|
205
|
-
title_main: main,
|
206
|
-
title_part: part,
|
207
|
-
language: "en",
|
208
|
-
script: "Latn",
|
209
|
-
}]
|
187
|
+
RelatonBib::TypedTitleString.from_string t.text, "en", "Latn"
|
210
188
|
end
|
211
189
|
|
212
190
|
# Fetch dates
|
data/lib/relaton_itu/version.rb
CHANGED
data/relaton-itu.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
-
spec.files = Dir.chdir(File.expand_path(
|
21
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
22
22
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
23
|
end
|
24
24
|
spec.bindir = "exe"
|
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency "vcr", "~> 5.0.0"
|
38
38
|
spec.add_development_dependency "webmock"
|
39
39
|
|
40
|
-
spec.add_dependency "relaton-
|
40
|
+
spec.add_dependency "relaton-bib", "~> 1.2.0"
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -151,19 +151,19 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name: relaton-
|
154
|
+
name: relaton-bib
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.2.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.2.0
|
167
167
|
description: 'RelatonItu: retrieve ITU Standards for bibliographic use using the BibliographicItem
|
168
168
|
model'
|
169
169
|
email:
|
@@ -187,7 +187,6 @@ files:
|
|
187
187
|
- grammars/basicdoc.rng
|
188
188
|
- grammars/biblio.rng
|
189
189
|
- grammars/isodoc.rng
|
190
|
-
- grammars/isostandard.rng
|
191
190
|
- grammars/itu.rng
|
192
191
|
- grammars/reqt.rng
|
193
192
|
- lib/relaton_itu.rb
|
data/grammars/isostandard.rng
DELETED
@@ -1,530 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
|
4
|
-
<include href="isodoc.rng">
|
5
|
-
<start>
|
6
|
-
<ref name="iso-standard"/>
|
7
|
-
</start>
|
8
|
-
<define name="organization">
|
9
|
-
<element name="organization">
|
10
|
-
<oneOrMore>
|
11
|
-
<ref name="orgname"/>
|
12
|
-
</oneOrMore>
|
13
|
-
<optional>
|
14
|
-
<ref name="abbreviation"/>
|
15
|
-
</optional>
|
16
|
-
<optional>
|
17
|
-
<ref name="uri"/>
|
18
|
-
</optional>
|
19
|
-
<zeroOrMore>
|
20
|
-
<ref name="org-identifier"/>
|
21
|
-
</zeroOrMore>
|
22
|
-
<zeroOrMore>
|
23
|
-
<ref name="contact"/>
|
24
|
-
</zeroOrMore>
|
25
|
-
<optional>
|
26
|
-
<ref name="technical-committee"/>
|
27
|
-
</optional>
|
28
|
-
<optional>
|
29
|
-
<ref name="subcommittee"/>
|
30
|
-
</optional>
|
31
|
-
<optional>
|
32
|
-
<ref name="workgroup"/>
|
33
|
-
</optional>
|
34
|
-
<optional>
|
35
|
-
<ref name="secretariat"/>
|
36
|
-
</optional>
|
37
|
-
</element>
|
38
|
-
</define>
|
39
|
-
<define name="BibDataExtensionType">
|
40
|
-
<ref name="doctype"/>
|
41
|
-
<ref name="editorialgroup"/>
|
42
|
-
<zeroOrMore>
|
43
|
-
<ref name="ics"/>
|
44
|
-
</zeroOrMore>
|
45
|
-
<ref name="structuredidentifier"/>
|
46
|
-
<optional>
|
47
|
-
<ref name="stagename"/>
|
48
|
-
</optional>
|
49
|
-
</define>
|
50
|
-
<define name="bdate">
|
51
|
-
<element name="date">
|
52
|
-
<attribute name="type">
|
53
|
-
<choice>
|
54
|
-
<ref name="BibliographicDateType"/>
|
55
|
-
<text/>
|
56
|
-
</choice>
|
57
|
-
</attribute>
|
58
|
-
<choice>
|
59
|
-
<group>
|
60
|
-
<element name="from">
|
61
|
-
<ref name="ISO8601Date"/>
|
62
|
-
</element>
|
63
|
-
<optional>
|
64
|
-
<element name="to">
|
65
|
-
<ref name="ISO8601Date"/>
|
66
|
-
</element>
|
67
|
-
</optional>
|
68
|
-
</group>
|
69
|
-
<element name="on">
|
70
|
-
<choice>
|
71
|
-
<ref name="ISO8601Date"/>
|
72
|
-
<value>--</value>
|
73
|
-
<value>–</value>
|
74
|
-
</choice>
|
75
|
-
</element>
|
76
|
-
</choice>
|
77
|
-
</element>
|
78
|
-
</define>
|
79
|
-
<define name="ul">
|
80
|
-
<element name="ul">
|
81
|
-
<attribute name="id">
|
82
|
-
<data type="ID"/>
|
83
|
-
</attribute>
|
84
|
-
<oneOrMore>
|
85
|
-
<ref name="ul_li"/>
|
86
|
-
</oneOrMore>
|
87
|
-
<zeroOrMore>
|
88
|
-
<ref name="note"/>
|
89
|
-
</zeroOrMore>
|
90
|
-
</element>
|
91
|
-
</define>
|
92
|
-
<define name="sections">
|
93
|
-
<element name="sections">
|
94
|
-
<zeroOrMore>
|
95
|
-
<choice>
|
96
|
-
<ref name="note"/>
|
97
|
-
<ref name="admonition"/>
|
98
|
-
</choice>
|
99
|
-
</zeroOrMore>
|
100
|
-
<ref name="clause"/>
|
101
|
-
<optional>
|
102
|
-
<choice>
|
103
|
-
<ref name="term-clause"/>
|
104
|
-
<ref name="terms"/>
|
105
|
-
</choice>
|
106
|
-
</optional>
|
107
|
-
<optional>
|
108
|
-
<ref name="definitions"/>
|
109
|
-
</optional>
|
110
|
-
<oneOrMore>
|
111
|
-
<ref name="clause"/>
|
112
|
-
</oneOrMore>
|
113
|
-
</element>
|
114
|
-
</define>
|
115
|
-
<define name="Clause-Section">
|
116
|
-
<optional>
|
117
|
-
<attribute name="id">
|
118
|
-
<data type="ID"/>
|
119
|
-
</attribute>
|
120
|
-
</optional>
|
121
|
-
<optional>
|
122
|
-
<attribute name="language"/>
|
123
|
-
</optional>
|
124
|
-
<optional>
|
125
|
-
<attribute name="script"/>
|
126
|
-
</optional>
|
127
|
-
<optional>
|
128
|
-
<attribute name="inline-header">
|
129
|
-
<data type="boolean"/>
|
130
|
-
</attribute>
|
131
|
-
</optional>
|
132
|
-
<optional>
|
133
|
-
<attribute name="obligation">
|
134
|
-
<choice>
|
135
|
-
<value>normative</value>
|
136
|
-
<value>informative</value>
|
137
|
-
</choice>
|
138
|
-
</attribute>
|
139
|
-
</optional>
|
140
|
-
<optional>
|
141
|
-
<ref name="section-title"/>
|
142
|
-
</optional>
|
143
|
-
<choice>
|
144
|
-
<group>
|
145
|
-
<oneOrMore>
|
146
|
-
<ref name="BasicBlock"/>
|
147
|
-
</oneOrMore>
|
148
|
-
<zeroOrMore>
|
149
|
-
<ref name="note"/>
|
150
|
-
</zeroOrMore>
|
151
|
-
</group>
|
152
|
-
<oneOrMore>
|
153
|
-
<ref name="clause-subsection"/>
|
154
|
-
</oneOrMore>
|
155
|
-
</choice>
|
156
|
-
</define>
|
157
|
-
<define name="term">
|
158
|
-
<element name="term">
|
159
|
-
<optional>
|
160
|
-
<attribute name="id">
|
161
|
-
<data type="ID"/>
|
162
|
-
</attribute>
|
163
|
-
</optional>
|
164
|
-
<ref name="preferred"/>
|
165
|
-
<zeroOrMore>
|
166
|
-
<ref name="admitted"/>
|
167
|
-
</zeroOrMore>
|
168
|
-
<zeroOrMore>
|
169
|
-
<ref name="deprecates"/>
|
170
|
-
</zeroOrMore>
|
171
|
-
<optional>
|
172
|
-
<ref name="termdomain"/>
|
173
|
-
</optional>
|
174
|
-
<ref name="definition"/>
|
175
|
-
<zeroOrMore>
|
176
|
-
<ref name="termnote"/>
|
177
|
-
</zeroOrMore>
|
178
|
-
<zeroOrMore>
|
179
|
-
<ref name="termexample"/>
|
180
|
-
</zeroOrMore>
|
181
|
-
<zeroOrMore>
|
182
|
-
<ref name="termsource"/>
|
183
|
-
</zeroOrMore>
|
184
|
-
</element>
|
185
|
-
</define>
|
186
|
-
<define name="definition">
|
187
|
-
<element name="definition">
|
188
|
-
<oneOrMore>
|
189
|
-
<choice>
|
190
|
-
<ref name="paragraph"/>
|
191
|
-
<ref name="figure"/>
|
192
|
-
<ref name="formula"/>
|
193
|
-
</choice>
|
194
|
-
</oneOrMore>
|
195
|
-
</element>
|
196
|
-
</define>
|
197
|
-
<define name="annex">
|
198
|
-
<element name="annex">
|
199
|
-
<optional>
|
200
|
-
<attribute name="id">
|
201
|
-
<data type="ID"/>
|
202
|
-
</attribute>
|
203
|
-
</optional>
|
204
|
-
<optional>
|
205
|
-
<attribute name="language"/>
|
206
|
-
</optional>
|
207
|
-
<optional>
|
208
|
-
<attribute name="script"/>
|
209
|
-
</optional>
|
210
|
-
<optional>
|
211
|
-
<attribute name="inline-header">
|
212
|
-
<data type="boolean"/>
|
213
|
-
</attribute>
|
214
|
-
</optional>
|
215
|
-
<optional>
|
216
|
-
<attribute name="obligation">
|
217
|
-
<choice>
|
218
|
-
<value>normative</value>
|
219
|
-
<value>informative</value>
|
220
|
-
</choice>
|
221
|
-
</attribute>
|
222
|
-
</optional>
|
223
|
-
<optional>
|
224
|
-
<ref name="section-title"/>
|
225
|
-
</optional>
|
226
|
-
<zeroOrMore>
|
227
|
-
<!--
|
228
|
-
allow hanging paragraps in annexes: they introduce lists
|
229
|
-
( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
|
230
|
-
-->
|
231
|
-
<ref name="BasicBlock"/>
|
232
|
-
</zeroOrMore>
|
233
|
-
<zeroOrMore>
|
234
|
-
<ref name="note"/>
|
235
|
-
</zeroOrMore>
|
236
|
-
<zeroOrMore>
|
237
|
-
<ref name="clause-hanging-paragraph-with-footnote"/>
|
238
|
-
</zeroOrMore>
|
239
|
-
<zeroOrMore>
|
240
|
-
<ref name="annex-appendix"/>
|
241
|
-
</zeroOrMore>
|
242
|
-
</element>
|
243
|
-
</define>
|
244
|
-
<define name="AdmonitionType">
|
245
|
-
<choice>
|
246
|
-
<value>danger</value>
|
247
|
-
<value>caution</value>
|
248
|
-
<value>warning</value>
|
249
|
-
<value>important</value>
|
250
|
-
<value>safety precautions</value>
|
251
|
-
</choice>
|
252
|
-
</define>
|
253
|
-
<define name="preface">
|
254
|
-
<element name="preface">
|
255
|
-
<optional>
|
256
|
-
<ref name="preface_abstract"/>
|
257
|
-
</optional>
|
258
|
-
<ref name="foreword"/>
|
259
|
-
<optional>
|
260
|
-
<ref name="introduction"/>
|
261
|
-
</optional>
|
262
|
-
</element>
|
263
|
-
</define>
|
264
|
-
<define name="DocumentType">
|
265
|
-
<choice>
|
266
|
-
<value>international-standard</value>
|
267
|
-
<value>technical-specification</value>
|
268
|
-
<value>technical-report</value>
|
269
|
-
<value>publicly-available-specification</value>
|
270
|
-
<value>international-workshop-agreement</value>
|
271
|
-
<value>guide</value>
|
272
|
-
<value>amendment</value>
|
273
|
-
<value>technical-corrigendum</value>
|
274
|
-
</choice>
|
275
|
-
</define>
|
276
|
-
<define name="structuredidentifier">
|
277
|
-
<element name="structuredidentifier">
|
278
|
-
<optional>
|
279
|
-
<attribute name="type"/>
|
280
|
-
</optional>
|
281
|
-
<group>
|
282
|
-
<ref name="documentnumber"/>
|
283
|
-
<optional>
|
284
|
-
<ref name="tc-documentnumber"/>
|
285
|
-
</optional>
|
286
|
-
</group>
|
287
|
-
</element>
|
288
|
-
</define>
|
289
|
-
<define name="foreword">
|
290
|
-
<element name="foreword">
|
291
|
-
<ref name="Basic-Section"/>
|
292
|
-
</element>
|
293
|
-
</define>
|
294
|
-
<define name="introduction">
|
295
|
-
<element name="introduction">
|
296
|
-
<ref name="Content-Section"/>
|
297
|
-
</element>
|
298
|
-
</define>
|
299
|
-
<define name="editorialgroup">
|
300
|
-
<element name="editorialgroup">
|
301
|
-
<oneOrMore>
|
302
|
-
<ref name="technical-committee"/>
|
303
|
-
</oneOrMore>
|
304
|
-
<zeroOrMore>
|
305
|
-
<ref name="subcommittee"/>
|
306
|
-
</zeroOrMore>
|
307
|
-
<zeroOrMore>
|
308
|
-
<ref name="workgroup"/>
|
309
|
-
</zeroOrMore>
|
310
|
-
<optional>
|
311
|
-
<ref name="secretariat"/>
|
312
|
-
</optional>
|
313
|
-
</element>
|
314
|
-
</define>
|
315
|
-
<define name="Content-Section">
|
316
|
-
<optional>
|
317
|
-
<attribute name="id">
|
318
|
-
<data type="ID"/>
|
319
|
-
</attribute>
|
320
|
-
</optional>
|
321
|
-
<optional>
|
322
|
-
<attribute name="language"/>
|
323
|
-
</optional>
|
324
|
-
<optional>
|
325
|
-
<attribute name="script"/>
|
326
|
-
</optional>
|
327
|
-
<optional>
|
328
|
-
<attribute name="obligation">
|
329
|
-
<choice>
|
330
|
-
<value>normative</value>
|
331
|
-
<value>informative</value>
|
332
|
-
</choice>
|
333
|
-
</attribute>
|
334
|
-
</optional>
|
335
|
-
<optional>
|
336
|
-
<ref name="section-title"/>
|
337
|
-
</optional>
|
338
|
-
<choice>
|
339
|
-
<group>
|
340
|
-
<zeroOrMore>
|
341
|
-
<ref name="BasicBlock"/>
|
342
|
-
</zeroOrMore>
|
343
|
-
<zeroOrMore>
|
344
|
-
<ref name="note"/>
|
345
|
-
</zeroOrMore>
|
346
|
-
</group>
|
347
|
-
<oneOrMore>
|
348
|
-
<ref name="content-subsection"/>
|
349
|
-
</oneOrMore>
|
350
|
-
</choice>
|
351
|
-
</define>
|
352
|
-
<define name="table">
|
353
|
-
<element name="table">
|
354
|
-
<attribute name="id">
|
355
|
-
<data type="ID"/>
|
356
|
-
</attribute>
|
357
|
-
<optional>
|
358
|
-
<attribute name="width"/>
|
359
|
-
</optional>
|
360
|
-
<optional>
|
361
|
-
<attribute name="unnumbered">
|
362
|
-
<data type="boolean"/>
|
363
|
-
</attribute>
|
364
|
-
</optional>
|
365
|
-
<optional>
|
366
|
-
<attribute name="subsequence"/>
|
367
|
-
</optional>
|
368
|
-
<optional>
|
369
|
-
<attribute name="alt"/>
|
370
|
-
</optional>
|
371
|
-
<optional>
|
372
|
-
<attribute name="summary"/>
|
373
|
-
</optional>
|
374
|
-
<optional>
|
375
|
-
<attribute name="uri">
|
376
|
-
<data type="anyURI"/>
|
377
|
-
</attribute>
|
378
|
-
</optional>
|
379
|
-
<optional>
|
380
|
-
<ref name="tname"/>
|
381
|
-
</optional>
|
382
|
-
<optional>
|
383
|
-
<ref name="thead"/>
|
384
|
-
</optional>
|
385
|
-
<ref name="tbody"/>
|
386
|
-
<optional>
|
387
|
-
<ref name="tfoot"/>
|
388
|
-
</optional>
|
389
|
-
<zeroOrMore>
|
390
|
-
<ref name="table-note"/>
|
391
|
-
</zeroOrMore>
|
392
|
-
<optional>
|
393
|
-
<ref name="dl"/>
|
394
|
-
</optional>
|
395
|
-
</element>
|
396
|
-
</define>
|
397
|
-
</include>
|
398
|
-
<!-- end overrides -->
|
399
|
-
<!--
|
400
|
-
We display the Normative References between scope and terms; but to keep the
|
401
|
-
grammar simple, we keep the references together
|
402
|
-
-->
|
403
|
-
<define name="iso-standard">
|
404
|
-
<element name="iso-standard">
|
405
|
-
<ref name="bibdata"/>
|
406
|
-
<zeroOrMore>
|
407
|
-
<ref name="termdocsource"/>
|
408
|
-
</zeroOrMore>
|
409
|
-
<optional>
|
410
|
-
<ref name="boilerplate"/>
|
411
|
-
</optional>
|
412
|
-
<ref name="preface"/>
|
413
|
-
<oneOrMore>
|
414
|
-
<ref name="sections"/>
|
415
|
-
</oneOrMore>
|
416
|
-
<zeroOrMore>
|
417
|
-
<ref name="annex"/>
|
418
|
-
</zeroOrMore>
|
419
|
-
<ref name="bibliography"/>
|
420
|
-
</element>
|
421
|
-
</define>
|
422
|
-
<define name="documentnumber">
|
423
|
-
<element name="project-number">
|
424
|
-
<optional>
|
425
|
-
<attribute name="part">
|
426
|
-
<data type="int"/>
|
427
|
-
</attribute>
|
428
|
-
</optional>
|
429
|
-
<optional>
|
430
|
-
<attribute name="subpart">
|
431
|
-
<data type="int"/>
|
432
|
-
</attribute>
|
433
|
-
</optional>
|
434
|
-
<text/>
|
435
|
-
</element>
|
436
|
-
</define>
|
437
|
-
<define name="tc-documentnumber">
|
438
|
-
<element name="tc-document-number">
|
439
|
-
<data type="int"/>
|
440
|
-
</element>
|
441
|
-
</define>
|
442
|
-
<define name="subcommittee">
|
443
|
-
<element name="subcommittee">
|
444
|
-
<ref name="IsoWorkgroup"/>
|
445
|
-
</element>
|
446
|
-
</define>
|
447
|
-
<define name="workgroup">
|
448
|
-
<element name="workgroup">
|
449
|
-
<ref name="IsoWorkgroup"/>
|
450
|
-
</element>
|
451
|
-
</define>
|
452
|
-
<define name="secretariat">
|
453
|
-
<element name="secretariat">
|
454
|
-
<text/>
|
455
|
-
</element>
|
456
|
-
</define>
|
457
|
-
<define name="clause-hanging-paragraph-with-footnote">
|
458
|
-
<element name="clause">
|
459
|
-
<optional>
|
460
|
-
<attribute name="id">
|
461
|
-
<data type="ID"/>
|
462
|
-
</attribute>
|
463
|
-
</optional>
|
464
|
-
<optional>
|
465
|
-
<attribute name="language"/>
|
466
|
-
</optional>
|
467
|
-
<optional>
|
468
|
-
<attribute name="script"/>
|
469
|
-
</optional>
|
470
|
-
<optional>
|
471
|
-
<attribute name="inline-header">
|
472
|
-
<data type="boolean"/>
|
473
|
-
</attribute>
|
474
|
-
</optional>
|
475
|
-
<optional>
|
476
|
-
<attribute name="obligation">
|
477
|
-
<choice>
|
478
|
-
<value>normative</value>
|
479
|
-
<value>informative</value>
|
480
|
-
</choice>
|
481
|
-
</attribute>
|
482
|
-
</optional>
|
483
|
-
<optional>
|
484
|
-
<ref name="section-title"/>
|
485
|
-
</optional>
|
486
|
-
<zeroOrMore>
|
487
|
-
<!-- allow hanging paragraphs in annexes: they introduce lists -->
|
488
|
-
<ref name="BasicBlock"/>
|
489
|
-
</zeroOrMore>
|
490
|
-
<zeroOrMore>
|
491
|
-
<ref name="note"/>
|
492
|
-
</zeroOrMore>
|
493
|
-
<zeroOrMore>
|
494
|
-
<ref name="clause-hanging-paragraph-with-footnote"/>
|
495
|
-
</zeroOrMore>
|
496
|
-
</element>
|
497
|
-
</define>
|
498
|
-
<define name="annex-appendix">
|
499
|
-
<element name="appendix">
|
500
|
-
<ref name="Clause-Section"/>
|
501
|
-
</element>
|
502
|
-
</define>
|
503
|
-
<define name="ul_li">
|
504
|
-
<element name="li">
|
505
|
-
<optional>
|
506
|
-
<attribute name="id">
|
507
|
-
<data type="ID"/>
|
508
|
-
</attribute>
|
509
|
-
</optional>
|
510
|
-
<optional>
|
511
|
-
<attribute name="uncheckedcheckbox">
|
512
|
-
<data type="boolean"/>
|
513
|
-
</attribute>
|
514
|
-
</optional>
|
515
|
-
<optional>
|
516
|
-
<attribute name="checkedcheckbox">
|
517
|
-
<data type="boolean"/>
|
518
|
-
</attribute>
|
519
|
-
</optional>
|
520
|
-
<oneOrMore>
|
521
|
-
<ref name="BasicBlock"/>
|
522
|
-
</oneOrMore>
|
523
|
-
</element>
|
524
|
-
</define>
|
525
|
-
<define name="stagename">
|
526
|
-
<element name="stagename">
|
527
|
-
<text/>
|
528
|
-
</element>
|
529
|
-
</define>
|
530
|
-
</grammar>
|