relaton-ogc 1.0.1 → 1.5.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b088d537d63459d8726a2d8fb8bf00993575966b00507b7568e4ba6b9b44b6
4
- data.tar.gz: 16dd2695d1e9b5c934d55090c4bf942ee6c3b19f3032ae97b229e825f97600f2
3
+ metadata.gz: fc39d17ed04cfaca8b1e544cf4a511ebd4ee8b4566904a27fa31ff3fba2a97ab
4
+ data.tar.gz: ab98f0bf8e099d4f1d80368063e6759615145a13d885d30f2574c5d895a32f89
5
5
  SHA512:
6
- metadata.gz: d95c6c2db9d946f1c89e2dc4baf82d710431563798d52d83cbf3e9f34cdc26d65871cdd2e760525c40292440a9ceb1bf569bb59bfd6a690c8afe0d47d8905a2a
7
- data.tar.gz: '08bd0df5a580fd85eb1d889ed30df24d86ba268d5674ca48cafde514779c2de56505b297f9b3c0c1991630f5d88bab7bd4304ddbfa0001d3a4acafcea89b1fe5'
6
+ metadata.gz: 46b575cb7ff292f68a36c430ed70ea6b51874397be121e31b935987c516df7122843ba2bd2a5e81de33f1781d830c46f1057aeef5d85e1823c4f3faef3bc1df5
7
+ data.tar.gz: 1aace3ee28f612164e47859d6bda6a3ce547806099a311a20f0ed3f2ff847922c8d01137238830dc008f42eb96a1b2374286173eaf6f330bfda726b79a63daaf
@@ -29,4 +29,5 @@ jobs:
29
29
  bundle install --jobs 4 --retry 3
30
30
  - name: Run specs
31
31
  run: |
32
+ unset JAVA_TOOL_OPTIONS
32
33
  bundle exec rake
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.3
8
+ TargetRubyVersion: 2.4
9
9
  Rails:
10
- Enabled: true
10
+ Enabled: false
@@ -18,7 +18,7 @@ Add this line to your application's Gemfile:
18
18
 
19
19
  [source,ruby]
20
20
  ----
21
- gem 'relaton_ogc'
21
+ gem 'relaton-ogc'
22
22
  ----
23
23
 
24
24
  And then execute:
@@ -27,7 +27,7 @@ And then execute:
27
27
 
28
28
  Or install it yourself as:
29
29
 
30
- $ gem install relaton_ogc
30
+ $ gem install relaton-ogc
31
31
 
32
32
  == Usage
33
33
 
@@ -35,8 +35,11 @@ Or install it yourself as:
35
35
 
36
36
  [source,ruby]
37
37
  ----
38
+ require 'relaton_ogc'
39
+ => true
40
+
38
41
  hits = RelatonOgc::OgcBibliography.search("OGC 19-025r1")
39
- => [<RelatonOgc::Hit:0x007fcab6b9aab8 @text="OGC 19-025r1" @fetched="false" @fullIdentifier="" @title="">]
42
+ => <RelatonOgc::HitCollection:0x007fcc8e085ba8 @ref=OGC 19-025r1 @fetched=false>
40
43
 
41
44
  tem = hits[0].fetch
42
45
  => #<RelatonOgc::OgcBibliographicItem:0x007fcab3cb4758
@@ -72,7 +75,10 @@ item.to_xml bibdata: true
72
75
  </date>
73
76
  ...
74
77
  <ext>
75
- <doctype>public-engineering-report</doctype>
78
+ <doctype>engineering-report</doctype>
79
+ <editorialgroup>
80
+ <committee>technical</committee>
81
+ </editorialgroup>
76
82
  </ext>
77
83
  </bibdata>"
78
84
  ----
@@ -81,7 +87,8 @@ item.to_xml bibdata: true
81
87
  [source,ruby]
82
88
  ----
83
89
  RelatonOgc::OgcBibliography.get "OGC 19-025r1", "2019", {}
84
- fetching OGC 19-025r1...
90
+ [relaton-ogc] ("OGC 19-025r1") fetching...
91
+ [relaton-ogc] ("OGC 19-025r1") found 19-025r1
85
92
  => #<RelatonOgc::OgcBibliographicItem:0x007fc322e9aba0
86
93
  ...
87
94
  ----
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -512,7 +532,7 @@
512
532
  </define>
513
533
  <define name="LocalityType">
514
534
  <data type="string">
515
- <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>
516
536
  </data>
517
537
  </define>
518
538
  <define name="referenceFrom">
@@ -641,9 +661,9 @@
641
661
  <optional>
642
662
  <ref name="status"/>
643
663
  </optional>
644
- <optional>
664
+ <zeroOrMore>
645
665
  <ref name="copyright"/>
646
- </optional>
666
+ </zeroOrMore>
647
667
  <zeroOrMore>
648
668
  <ref name="docrelation"/>
649
669
  </zeroOrMore>
@@ -1001,7 +1021,17 @@
1001
1021
  <optional>
1002
1022
  <ref name="to"/>
1003
1023
  </optional>
1004
- <ref name="owner"/>
1024
+ <oneOrMore>
1025
+ <ref name="owner"/>
1026
+ </oneOrMore>
1027
+ <optional>
1028
+ <ref name="copyright_scope"/>
1029
+ </optional>
1030
+ </element>
1031
+ </define>
1032
+ <define name="copyright_scope">
1033
+ <element name="scope">
1034
+ <text/>
1005
1035
  </element>
1006
1036
  </define>
1007
1037
  <define name="from">
@@ -42,8 +42,11 @@
42
42
  </define>
43
43
  <define name="xref">
44
44
  <element name="xref">
45
+ <!-- attribute target { xsd:IDREF }, -->
45
46
  <attribute name="target">
46
- <data type="IDREF"/>
47
+ <data type="string">
48
+ <param name="pattern">\i\c*|\c+#\c+</param>
49
+ </data>
47
50
  </attribute>
48
51
  <optional>
49
52
  <attribute name="type">
@@ -53,9 +56,101 @@
53
56
  <optional>
54
57
  <attribute name="alt"/>
55
58
  </optional>
59
+ <optional>
60
+ <attribute name="case">
61
+ <choice>
62
+ <value>capital</value>
63
+ <value>lowercase</value>
64
+ </choice>
65
+ </attribute>
66
+ </optional>
67
+ <optional>
68
+ <attribute name="droploc">
69
+ <data type="boolean"/>
70
+ </attribute>
71
+ </optional>
56
72
  <text/>
57
73
  </element>
58
74
  </define>
75
+ <define name="ul">
76
+ <element name="ul">
77
+ <attribute name="id">
78
+ <data type="ID"/>
79
+ </attribute>
80
+ <optional>
81
+ <attribute name="keep-with-next">
82
+ <data type="boolean"/>
83
+ </attribute>
84
+ </optional>
85
+ <optional>
86
+ <attribute name="keep-lines-together">
87
+ <data type="boolean"/>
88
+ </attribute>
89
+ </optional>
90
+ <oneOrMore>
91
+ <ref name="li"/>
92
+ </oneOrMore>
93
+ <zeroOrMore>
94
+ <ref name="note"/>
95
+ </zeroOrMore>
96
+ </element>
97
+ </define>
98
+ <define name="ol">
99
+ <element name="ol">
100
+ <attribute name="id">
101
+ <data type="ID"/>
102
+ </attribute>
103
+ <optional>
104
+ <attribute name="keep-with-next">
105
+ <data type="boolean"/>
106
+ </attribute>
107
+ </optional>
108
+ <optional>
109
+ <attribute name="keep-lines-together">
110
+ <data type="boolean"/>
111
+ </attribute>
112
+ </optional>
113
+ <attribute name="type">
114
+ <choice>
115
+ <value>roman</value>
116
+ <value>alphabet</value>
117
+ <value>arabic</value>
118
+ <value>roman_upper</value>
119
+ <value>alphabet_upper</value>
120
+ </choice>
121
+ </attribute>
122
+ <oneOrMore>
123
+ <ref name="li"/>
124
+ </oneOrMore>
125
+ <zeroOrMore>
126
+ <ref name="note"/>
127
+ </zeroOrMore>
128
+ </element>
129
+ </define>
130
+ <define name="dl">
131
+ <element name="dl">
132
+ <attribute name="id">
133
+ <data type="ID"/>
134
+ </attribute>
135
+ <optional>
136
+ <attribute name="keep-with-next">
137
+ <data type="boolean"/>
138
+ </attribute>
139
+ </optional>
140
+ <optional>
141
+ <attribute name="keep-lines-together">
142
+ <data type="boolean"/>
143
+ </attribute>
144
+ </optional>
145
+ <oneOrMore>
146
+ <ref name="dt"/>
147
+ <ref name="dd"/>
148
+ </oneOrMore>
149
+ <zeroOrMore>
150
+ <ref name="note"/>
151
+ </zeroOrMore>
152
+ </element>
153
+ </define>
59
154
  <define name="example">
60
155
  <element name="example">
61
156
  <attribute name="id">
@@ -69,6 +164,19 @@
69
164
  <optional>
70
165
  <attribute name="subsequence"/>
71
166
  </optional>
167
+ <optional>
168
+ <attribute name="number"/>
169
+ </optional>
170
+ <optional>
171
+ <attribute name="keep-with-next">
172
+ <data type="boolean"/>
173
+ </attribute>
174
+ </optional>
175
+ <optional>
176
+ <attribute name="keep-lines-together">
177
+ <data type="boolean"/>
178
+ </attribute>
179
+ </optional>
72
180
  <optional>
73
181
  <ref name="tname"/>
74
182
  </optional>
@@ -89,6 +197,296 @@
89
197
  </zeroOrMore>
90
198
  </element>
91
199
  </define>
200
+ <define name="table">
201
+ <element name="table">
202
+ <attribute name="id">
203
+ <data type="ID"/>
204
+ </attribute>
205
+ <optional>
206
+ <attribute name="unnumbered">
207
+ <data type="boolean"/>
208
+ </attribute>
209
+ </optional>
210
+ <optional>
211
+ <attribute name="number"/>
212
+ </optional>
213
+ <optional>
214
+ <attribute name="subsequence"/>
215
+ </optional>
216
+ <optional>
217
+ <attribute name="alt"/>
218
+ </optional>
219
+ <optional>
220
+ <attribute name="summary"/>
221
+ </optional>
222
+ <optional>
223
+ <attribute name="uri">
224
+ <data type="anyURI"/>
225
+ </attribute>
226
+ </optional>
227
+ <optional>
228
+ <attribute name="keep-with-next">
229
+ <data type="boolean"/>
230
+ </attribute>
231
+ </optional>
232
+ <optional>
233
+ <attribute name="keep-lines-together">
234
+ <data type="boolean"/>
235
+ </attribute>
236
+ </optional>
237
+ <optional>
238
+ <ref name="tname"/>
239
+ </optional>
240
+ <optional>
241
+ <ref name="thead"/>
242
+ </optional>
243
+ <ref name="tbody"/>
244
+ <optional>
245
+ <ref name="tfoot"/>
246
+ </optional>
247
+ <zeroOrMore>
248
+ <ref name="table-note"/>
249
+ </zeroOrMore>
250
+ <optional>
251
+ <ref name="dl"/>
252
+ </optional>
253
+ </element>
254
+ </define>
255
+ <define name="figure">
256
+ <element name="figure">
257
+ <attribute name="id">
258
+ <data type="ID"/>
259
+ </attribute>
260
+ <optional>
261
+ <attribute name="unnumbered">
262
+ <data type="boolean"/>
263
+ </attribute>
264
+ </optional>
265
+ <optional>
266
+ <attribute name="number"/>
267
+ </optional>
268
+ <optional>
269
+ <attribute name="subsequence"/>
270
+ </optional>
271
+ <optional>
272
+ <attribute name="keep-with-next">
273
+ <data type="boolean"/>
274
+ </attribute>
275
+ </optional>
276
+ <optional>
277
+ <attribute name="keep-lines-together">
278
+ <data type="boolean"/>
279
+ </attribute>
280
+ </optional>
281
+ <optional>
282
+ <attribute name="class"/>
283
+ </optional>
284
+ <optional>
285
+ <ref name="source"/>
286
+ </optional>
287
+ <optional>
288
+ <ref name="tname"/>
289
+ </optional>
290
+ <choice>
291
+ <ref name="image"/>
292
+ <ref name="video"/>
293
+ <ref name="audio"/>
294
+ <ref name="pre"/>
295
+ <oneOrMore>
296
+ <ref name="paragraph-with-footnote"/>
297
+ </oneOrMore>
298
+ <zeroOrMore>
299
+ <ref name="figure"/>
300
+ </zeroOrMore>
301
+ </choice>
302
+ <zeroOrMore>
303
+ <ref name="fn"/>
304
+ </zeroOrMore>
305
+ <optional>
306
+ <ref name="dl"/>
307
+ </optional>
308
+ <zeroOrMore>
309
+ <ref name="note"/>
310
+ </zeroOrMore>
311
+ </element>
312
+ </define>
313
+ <define name="sourcecode">
314
+ <element name="sourcecode">
315
+ <attribute name="id">
316
+ <data type="ID"/>
317
+ </attribute>
318
+ <optional>
319
+ <attribute name="unnumbered">
320
+ <data type="boolean"/>
321
+ </attribute>
322
+ </optional>
323
+ <optional>
324
+ <attribute name="number"/>
325
+ </optional>
326
+ <optional>
327
+ <attribute name="subsequence"/>
328
+ </optional>
329
+ <optional>
330
+ <attribute name="keep-with-next">
331
+ <data type="boolean"/>
332
+ </attribute>
333
+ </optional>
334
+ <optional>
335
+ <attribute name="keep-lines-together">
336
+ <data type="boolean"/>
337
+ </attribute>
338
+ </optional>
339
+ <optional>
340
+ <attribute name="lang"/>
341
+ </optional>
342
+ <optional>
343
+ <ref name="tname"/>
344
+ </optional>
345
+ <oneOrMore>
346
+ <choice>
347
+ <text/>
348
+ <ref name="callout"/>
349
+ </choice>
350
+ </oneOrMore>
351
+ <zeroOrMore>
352
+ <ref name="annotation"/>
353
+ </zeroOrMore>
354
+ <zeroOrMore>
355
+ <ref name="note"/>
356
+ </zeroOrMore>
357
+ </element>
358
+ </define>
359
+ <define name="formula">
360
+ <element name="formula">
361
+ <attribute name="id">
362
+ <data type="ID"/>
363
+ </attribute>
364
+ <optional>
365
+ <attribute name="unnumbered">
366
+ <data type="boolean"/>
367
+ </attribute>
368
+ </optional>
369
+ <optional>
370
+ <attribute name="number"/>
371
+ </optional>
372
+ <optional>
373
+ <attribute name="subsequence"/>
374
+ </optional>
375
+ <optional>
376
+ <attribute name="keep-with-next">
377
+ <data type="boolean"/>
378
+ </attribute>
379
+ </optional>
380
+ <optional>
381
+ <attribute name="keep-lines-together">
382
+ <data type="boolean"/>
383
+ </attribute>
384
+ </optional>
385
+ <optional>
386
+ <attribute name="inequality">
387
+ <data type="boolean"/>
388
+ </attribute>
389
+ </optional>
390
+ <ref name="stem"/>
391
+ <optional>
392
+ <ref name="dl"/>
393
+ </optional>
394
+ <zeroOrMore>
395
+ <ref name="note"/>
396
+ </zeroOrMore>
397
+ </element>
398
+ </define>
399
+ <define name="ParagraphType">
400
+ <attribute name="id">
401
+ <data type="ID"/>
402
+ </attribute>
403
+ <optional>
404
+ <attribute name="align">
405
+ <ref name="Alignments"/>
406
+ </attribute>
407
+ </optional>
408
+ <optional>
409
+ <attribute name="keep-with-next">
410
+ <data type="boolean"/>
411
+ </attribute>
412
+ </optional>
413
+ <optional>
414
+ <attribute name="keep-lines-together">
415
+ <data type="boolean"/>
416
+ </attribute>
417
+ </optional>
418
+ <zeroOrMore>
419
+ <ref name="TextElement"/>
420
+ </zeroOrMore>
421
+ <zeroOrMore>
422
+ <ref name="note"/>
423
+ </zeroOrMore>
424
+ </define>
425
+ <define name="paragraph-with-footnote">
426
+ <element name="p">
427
+ <attribute name="id">
428
+ <data type="ID"/>
429
+ </attribute>
430
+ <optional>
431
+ <attribute name="align">
432
+ <ref name="Alignments"/>
433
+ </attribute>
434
+ </optional>
435
+ <optional>
436
+ <attribute name="keep-with-next">
437
+ <data type="boolean"/>
438
+ </attribute>
439
+ </optional>
440
+ <optional>
441
+ <attribute name="keep-lines-together">
442
+ <data type="boolean"/>
443
+ </attribute>
444
+ </optional>
445
+ <zeroOrMore>
446
+ <choice>
447
+ <ref name="TextElement"/>
448
+ <ref name="fn"/>
449
+ </choice>
450
+ </zeroOrMore>
451
+ <zeroOrMore>
452
+ <ref name="note"/>
453
+ </zeroOrMore>
454
+ </element>
455
+ </define>
456
+ <define name="quote">
457
+ <element name="quote">
458
+ <attribute name="id">
459
+ <data type="ID"/>
460
+ </attribute>
461
+ <optional>
462
+ <attribute name="alignment">
463
+ <ref name="Alignments"/>
464
+ </attribute>
465
+ </optional>
466
+ <optional>
467
+ <attribute name="keep-with-next">
468
+ <data type="boolean"/>
469
+ </attribute>
470
+ </optional>
471
+ <optional>
472
+ <attribute name="keep-lines-together">
473
+ <data type="boolean"/>
474
+ </attribute>
475
+ </optional>
476
+ <optional>
477
+ <ref name="quote-source"/>
478
+ </optional>
479
+ <optional>
480
+ <ref name="quote-author"/>
481
+ </optional>
482
+ <oneOrMore>
483
+ <ref name="paragraph-with-footnote"/>
484
+ </oneOrMore>
485
+ <zeroOrMore>
486
+ <ref name="note"/>
487
+ </zeroOrMore>
488
+ </element>
489
+ </define>
92
490
  <define name="BibDataExtensionType">
93
491
  <ref name="doctype"/>
94
492
  <optional>
@@ -157,6 +555,30 @@
157
555
  <attribute name="id">
158
556
  <data type="ID"/>
159
557
  </attribute>
558
+ <optional>
559
+ <attribute name="unnumbered">
560
+ <data type="boolean"/>
561
+ </attribute>
562
+ </optional>
563
+ <optional>
564
+ <attribute name="number"/>
565
+ </optional>
566
+ <optional>
567
+ <attribute name="subsequence"/>
568
+ </optional>
569
+ <optional>
570
+ <attribute name="keep-with-next">
571
+ <data type="boolean"/>
572
+ </attribute>
573
+ </optional>
574
+ <optional>
575
+ <attribute name="keep-lines-together">
576
+ <data type="boolean"/>
577
+ </attribute>
578
+ </optional>
579
+ <optional>
580
+ <attribute name="type"/>
581
+ </optional>
160
582
  <oneOrMore>
161
583
  <choice>
162
584
  <ref name="paragraph"/>
@@ -164,6 +586,8 @@
164
586
  <ref name="ol"/>
165
587
  <ref name="dl"/>
166
588
  <ref name="formula"/>
589
+ <ref name="quote"/>
590
+ <ref name="sourcecode"/>
167
591
  </choice>
168
592
  </oneOrMore>
169
593
  </element>
@@ -247,6 +671,16 @@
247
671
  </choice>
248
672
  </attribute>
249
673
  </optional>
674
+ <optional>
675
+ <attribute name="valign">
676
+ <choice>
677
+ <value>top</value>
678
+ <value>middle</value>
679
+ <value>bottom</value>
680
+ <value>baseline</value>
681
+ </choice>
682
+ </attribute>
683
+ </optional>
250
684
  <choice>
251
685
  <zeroOrMore>
252
686
  <choice>
@@ -283,6 +717,16 @@
283
717
  </choice>
284
718
  </attribute>
285
719
  </optional>
720
+ <optional>
721
+ <attribute name="valign">
722
+ <choice>
723
+ <value>top</value>
724
+ <value>middle</value>
725
+ <value>bottom</value>
726
+ <value>baseline</value>
727
+ </choice>
728
+ </attribute>
729
+ </optional>
286
730
  <choice>
287
731
  <zeroOrMore>
288
732
  <choice>
@@ -441,7 +885,7 @@
441
885
  <oneOrMore>
442
886
  <choice>
443
887
  <ref name="content"/>
444
- <ref name="preface_abstract"/>
888
+ <ref name="abstract"/>
445
889
  <ref name="foreword"/>
446
890
  <ref name="introduction"/>
447
891
  <ref name="acknowledgements"/>
@@ -508,6 +952,9 @@
508
952
  <optional>
509
953
  <attribute name="script"/>
510
954
  </optional>
955
+ <optional>
956
+ <attribute name="type"/>
957
+ </optional>
511
958
  <optional>
512
959
  <attribute name="obligation">
513
960
  <choice>
@@ -547,9 +994,6 @@
547
994
  </define>
548
995
  <define name="content-subsection">
549
996
  <element name="clause">
550
- <optional>
551
- <attribute name="type"/>
552
- </optional>
553
997
  <ref name="Content-Section"/>
554
998
  </element>
555
999
  </define>
@@ -578,6 +1022,9 @@
578
1022
  </choice>
579
1023
  </attribute>
580
1024
  </optional>
1025
+ <optional>
1026
+ <attribute name="type"/>
1027
+ </optional>
581
1028
  <optional>
582
1029
  <ref name="section-title"/>
583
1030
  </optional>
@@ -597,9 +1044,6 @@
597
1044
  </define>
598
1045
  <define name="clause">
599
1046
  <element name="clause">
600
- <optional>
601
- <attribute name="type"/>
602
- </optional>
603
1047
  <ref name="Clause-Section"/>
604
1048
  </element>
605
1049
  </define>
@@ -628,18 +1072,24 @@
628
1072
  </choice>
629
1073
  </attribute>
630
1074
  </optional>
1075
+ <optional>
1076
+ <attribute name="type"/>
1077
+ </optional>
631
1078
  <optional>
632
1079
  <ref name="section-title"/>
633
1080
  </optional>
634
1081
  <group>
635
- <group>
636
- <zeroOrMore>
637
- <ref name="BasicBlock"/>
638
- </zeroOrMore>
639
- <zeroOrMore>
640
- <ref name="note"/>
641
- </zeroOrMore>
642
- </group>
1082
+ <choice>
1083
+ <group>
1084
+ <zeroOrMore>
1085
+ <ref name="BasicBlock"/>
1086
+ </zeroOrMore>
1087
+ <zeroOrMore>
1088
+ <ref name="note"/>
1089
+ </zeroOrMore>
1090
+ </group>
1091
+ <ref name="amend"/>
1092
+ </choice>
643
1093
  <zeroOrMore>
644
1094
  <choice>
645
1095
  <ref name="clause-subsection"/>
@@ -766,6 +1216,9 @@
766
1216
  <optional>
767
1217
  <attribute name="script"/>
768
1218
  </optional>
1219
+ <optional>
1220
+ <attribute name="type"/>
1221
+ </optional>
769
1222
  <optional>
770
1223
  <attribute name="obligation">
771
1224
  <choice>
@@ -902,7 +1355,36 @@
902
1355
  <attribute name="id">
903
1356
  <data type="ID"/>
904
1357
  </attribute>
905
- <ref name="paragraph"/>
1358
+ <optional>
1359
+ <attribute name="unnumbered">
1360
+ <data type="boolean"/>
1361
+ </attribute>
1362
+ </optional>
1363
+ <optional>
1364
+ <attribute name="number"/>
1365
+ </optional>
1366
+ <optional>
1367
+ <attribute name="subsequence"/>
1368
+ </optional>
1369
+ <optional>
1370
+ <attribute name="keep-with-next">
1371
+ <data type="boolean"/>
1372
+ </attribute>
1373
+ </optional>
1374
+ <optional>
1375
+ <attribute name="keep-lines-together">
1376
+ <data type="boolean"/>
1377
+ </attribute>
1378
+ </optional>
1379
+ <oneOrMore>
1380
+ <choice>
1381
+ <ref name="paragraph"/>
1382
+ <ref name="ul"/>
1383
+ <ref name="ol"/>
1384
+ <ref name="dl"/>
1385
+ <ref name="formula"/>
1386
+ </choice>
1387
+ </oneOrMore>
906
1388
  </element>
907
1389
  </define>
908
1390
  <define name="termexample">
@@ -1004,11 +1486,6 @@
1004
1486
  </optional>
1005
1487
  </element>
1006
1488
  </define>
1007
- <define name="preface_abstract">
1008
- <element name="abstract">
1009
- <ref name="Basic-Section"/>
1010
- </element>
1011
- </define>
1012
1489
  <define name="term-clause">
1013
1490
  <element name="clause">
1014
1491
  <optional>
@@ -1058,4 +1535,79 @@
1058
1535
  <ref name="CitationType"/>
1059
1536
  </element>
1060
1537
  </define>
1538
+ <define name="amend">
1539
+ <element name="amend">
1540
+ <optional>
1541
+ <attribute name="id">
1542
+ <data type="ID"/>
1543
+ </attribute>
1544
+ </optional>
1545
+ <attribute name="change">
1546
+ <choice>
1547
+ <value>add</value>
1548
+ <value>modify</value>
1549
+ <value>delete</value>
1550
+ </choice>
1551
+ </attribute>
1552
+ <optional>
1553
+ <attribute name="path"/>
1554
+ </optional>
1555
+ <optional>
1556
+ <attribute name="path_end"/>
1557
+ </optional>
1558
+ <optional>
1559
+ <attribute name="title"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <element name="location">
1563
+ <zeroOrMore>
1564
+ <ref name="locality"/>
1565
+ </zeroOrMore>
1566
+ </element>
1567
+ </optional>
1568
+ <zeroOrMore>
1569
+ <ref name="autonumber"/>
1570
+ </zeroOrMore>
1571
+ <optional>
1572
+ <element name="description">
1573
+ <zeroOrMore>
1574
+ <ref name="BasicBlock"/>
1575
+ </zeroOrMore>
1576
+ </element>
1577
+ </optional>
1578
+ <optional>
1579
+ <element name="newcontent">
1580
+ <zeroOrMore>
1581
+ <ref name="BasicBlock"/>
1582
+ </zeroOrMore>
1583
+ </element>
1584
+ </optional>
1585
+ <optional>
1586
+ <element name="description">
1587
+ <zeroOrMore>
1588
+ <ref name="BasicBlock"/>
1589
+ </zeroOrMore>
1590
+ </element>
1591
+ </optional>
1592
+ </element>
1593
+ </define>
1594
+ <define name="autonumber">
1595
+ <element name="autonumber">
1596
+ <attribute name="type">
1597
+ <choice>
1598
+ <value>requirement</value>
1599
+ <value>recommendation</value>
1600
+ <value>permission</value>
1601
+ <value>table</value>
1602
+ <value>figure</value>
1603
+ <value>admonition</value>
1604
+ <value>formula</value>
1605
+ <value>sourcecode</value>
1606
+ <value>example</value>
1607
+ <value>note</value>
1608
+ </choice>
1609
+ </attribute>
1610
+ <text/>
1611
+ </element>
1612
+ </define>
1061
1613
  </grammar>
@@ -54,7 +54,7 @@
54
54
  <define name="preface">
55
55
  <element name="preface">
56
56
  <optional>
57
- <ref name="preface_abstract"/>
57
+ <ref name="abstract"/>
58
58
  </optional>
59
59
  <ref name="foreword"/>
60
60
  <optional>
@@ -35,6 +35,11 @@ module RelatonOgc
35
35
  @workgroup = subgroup args[:workgroup]
36
36
  end
37
37
 
38
+ # @return [true]
39
+ def presence?
40
+ true
41
+ end
42
+
38
43
  # @param builder [Nokogiri::XML::Builder]
39
44
  def to_xml(builder)
40
45
  builder.editorialgroup do
@@ -52,6 +57,17 @@ module RelatonOgc
52
57
  hash
53
58
  end
54
59
 
60
+ # @param prefix [String]
61
+ # @return [String]
62
+ def to_asciibib(prefix)
63
+ pref = prefix.empty? ? prefix : prefix + "."
64
+ pref += "editorialgroup"
65
+ out = "#{pref}.committee:: #{committee}\n"
66
+ out += subcommittee.to_asciibib "#{pref}.subcommittee" if subcommittee
67
+ out += workgroup.to_asciibib "#{pref}.workgroup" if workgroup
68
+ out
69
+ end
70
+
55
71
  private
56
72
 
57
73
  # @param group [Hash, RelatonIsoBib::IsoSubgroup]
@@ -1,5 +1,5 @@
1
1
  module RelatonOgc
2
- class HashConverter < RelatonIsoBib::HashConverter
2
+ class HashConverter < RelatonBib::HashConverter
3
3
  class << self
4
4
  private
5
5
 
@@ -12,7 +12,7 @@ module RelatonOgc
12
12
  committee: eg[:committee],
13
13
  subcommittee: eg[:subcommittee],
14
14
  workgroup: eg[:workgroup],
15
- secretariat: eg[:secretariat],
15
+ secretariat: eg[:secretariat]
16
16
  )
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module RelatonOgc
2
- class OgcBibliographicItem < RelatonIsoBib::IsoBibliographicItem
2
+ class OgcBibliographicItem < RelatonBib::BibliographicItem
3
3
  TYPES = %w[
4
4
  abstract-specification-topic best-practice
5
5
  change-request-supporting-document
@@ -20,10 +20,12 @@ module RelatonOgc
20
20
  # @param docsubtype [String]
21
21
  def initialize(**args)
22
22
  if args[:docsubtype] && !SUBTYPES.include?(args[:docsubtype])
23
- warn "[relaton-ogc] invalid document subtype: #{args[:docsubtype]}"
23
+ warn "[relaton-ogc] WARNING: invalid document "\
24
+ "subtype: #{args[:docsubtype]}"
24
25
  end
25
26
 
26
27
  @docsubtype = args.delete :docsubtype
28
+ # @doctype = args.delete :doctype
27
29
  super
28
30
  end
29
31
 
@@ -33,5 +35,31 @@ module RelatonOgc
33
35
  hash["docsubtype"] = docsubtype if docsubtype
34
36
  hash
35
37
  end
38
+
39
+ # @param opts [Hash]
40
+ # @option opts [Nokogiri::XML::Builder] :builder XML builder
41
+ # @option opts [Boolean] :bibdata
42
+ # @option opts [Symbol, NilClass] :date_format (:short), :full
43
+ # @option opts [String, Symbol] :lang language
44
+ # @return [String] XML
45
+ def to_xml(**opts)
46
+ super **opts do |b|
47
+ b.ext do
48
+ b.doctype doctype if doctype
49
+ b.docsubtype docsubtype if docsubtype
50
+ editorialgroup&.to_xml b
51
+ ics.each { |i| i.to_xml b }
52
+ end
53
+ end
54
+ end
55
+
56
+ # @param prefix [String]
57
+ # @return [String]
58
+ def to_asciibib(prefix = "")
59
+ pref = prefix.empty? ? prefix : prefix + "."
60
+ out = super
61
+ out += "#{pref}docsubtype:: #{docsubtype}\n" if docsubtype
62
+ out
63
+ end
36
64
  end
37
65
  end
@@ -3,10 +3,10 @@ module RelatonOgc
3
3
  class << self
4
4
  # @param text [String]
5
5
  # @return [RelatonOgc::HitCollection]
6
- def search(text, year = nil, opts = {})
6
+ def search(text, year = nil, _opts = {})
7
7
  HitCollection.new text, year
8
8
  rescue Faraday::ConnectionFailed
9
- raise RelatonBib::RequestError, "Could not access https://www.nist.gov"
9
+ raise RelatonBib::RequestError, HitCollection::ENDPOINT
10
10
  end
11
11
 
12
12
  # @param code [String] the OGC standard Code to look up (e..g "8200")
@@ -38,6 +38,7 @@ module RelatonOgc
38
38
  type = fetch_type(hit["type"])
39
39
  OgcBibliographicItem.new(
40
40
  fetched: Date.today.to_s,
41
+ type: "standard",
41
42
  title: fetch_title(hit["title"]),
42
43
  docid: fetch_docid(hit["identifier"]),
43
44
  link: fetch_link(hit["URL"]),
@@ -61,18 +62,9 @@ module RelatonOgc
61
62
  end
62
63
 
63
64
  # @param title [String]
64
- # @return [Array<RelatonIsoBib::TypedTitleString>]
65
+ # @return [Array<RelatonBib::TypedTitleString>]
65
66
  def fetch_title(title)
66
- [
67
- RelatonIsoBib::TypedTitleString.new(
68
- type: "title-main", content: title, language: "en", script: "Latn",
69
- format: "text/plain"
70
- ),
71
- RelatonIsoBib::TypedTitleString.new(
72
- type: "main", content: title, language: "en", script: "Latn",
73
- format: "text/plain"
74
- ),
75
- ]
67
+ RelatonBib::TypedTitleString.from_string title, "en", "Latn"
76
68
  end
77
69
 
78
70
  # @param identifier [String]
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.5.pre".freeze
3
3
  end
@@ -3,21 +3,15 @@ require "nokogiri"
3
3
  module RelatonOgc
4
4
  class XMLParser < RelatonIsoBib::XMLParser
5
5
  class << self
6
- # Override RelatonIsoBib::XMLParser.form_xml method.
7
- # @param xml [String]
6
+ private
7
+
8
+ # override RelatonIsoBib::IsoBibliographicItem.bib_item method
9
+ # @param item_hash [Hash]
8
10
  # @return [RelatonOgc::OgcBibliographicItem]
9
- def from_xml(xml)
10
- doc = Nokogiri::XML(xml)
11
- item = doc.at "/bibitem|/bibdata"
12
- if item
13
- OgcBibliographicItem.new item_data(item)
14
- else
15
- warn "[relaton-ogc] can't find bibitem or bibdata element in the XML"
16
- end
11
+ def bib_item(item_hash)
12
+ OgcBibliographicItem.new item_hash
17
13
  end
18
14
 
19
- private
20
-
21
15
  # Override RelatonIsoBib::XMLParser.item_data method.
22
16
  # @param item [Nokogiri::XML::Element]
23
17
  # @returtn [Hash]
@@ -41,7 +35,7 @@ module RelatonOgc
41
35
  sc = iso_subgroup eg&.at("subcommittee")
42
36
  wg = iso_subgroup eg&.at("workgroup")
43
37
  EditorialGroup.new(
44
- committee: committe, subcommittee: sc, workgroup: wg,
38
+ committee: committe, subcommittee: sc, workgroup: wg
45
39
  )
46
40
  end
47
41
  end
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "webmock"
37
37
 
38
38
  spec.add_dependency "faraday", "~> 1.0.0"
39
- spec.add_dependency "relaton-iso-bib", ">= 1.0.1"
39
+ spec.add_dependency "relaton-iso-bib", "~> 1.5.pre"
40
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.5.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -168,16 +168,16 @@ dependencies:
168
168
  name: relaton-iso-bib
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.0.1
173
+ version: 1.5.pre
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.0.1
180
+ version: 1.5.pre
181
181
  description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
182
182
  model'
183
183
  email:
@@ -219,7 +219,7 @@ homepage: https://github.com/relaton/relaton-ogc
219
219
  licenses:
220
220
  - BSD-2-Clause
221
221
  metadata: {}
222
- post_install_message:
222
+ post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths:
225
225
  - lib
@@ -230,12 +230,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  requirements:
233
- - - ">="
233
+ - - ">"
234
234
  - !ruby/object:Gem::Version
235
- version: '0'
235
+ version: 1.3.1
236
236
  requirements: []
237
237
  rubygems_version: 3.0.6
238
- signing_key:
238
+ signing_key:
239
239
  specification_version: 4
240
240
  summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
241
241
  model'