relaton-un 1.7.2 → 1.10.1

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: 3a931cfbea2867ba727688d5407a1b655a69f54d6210dc9c923fd6cde21d5e20
4
- data.tar.gz: f5d8a482ad6beb6629a310810908a4b9aab27bae0d4dbec4ca5e6a7d80638ea0
3
+ metadata.gz: f4e4c99e686c0404548000a0a43cde77f7e5596a7f4a00bf6366a820850717e8
4
+ data.tar.gz: 971ce2228135c5755f20eb67883c213f7d4a75cd2749b6ce824a7453226874bf
5
5
  SHA512:
6
- metadata.gz: 409b3cb8e88267363a8f11da399546ddcc64c25bdd6dd58c62354be7beb39048ebda95395c99a57a54f6e3fca40944f64ed7583a7dc0d586b287078763e1bf07
7
- data.tar.gz: 63d0b6a49b7e8b22721d9548dfd970b920c14aef96812e589433a064280fc25ecd302eed5c1cc3cc1ca64db009a3c66d0392c33570b88623689531304da2cb6d
6
+ metadata.gz: 43872981020e361dcbc7fe270a1f2d859ae2d923e52e44997229232b05d485d6f1b66449067aba7f0168daa78b65221163bc67943bc49a5deb5214d719acf2f8
7
+ data.tar.gz: aa280783dc71bed1b0b298006ed354256cf4f3e12fdf9dbd2c65967499b6bb27191d578af07325bf25326d5f4cd4c8a60f07b92178ad8c3e93ab36afa425e5e1
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
data/.rubocop.yml CHANGED
@@ -2,9 +2,11 @@
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
4
 
5
+ require: rubocop-rails
6
+
5
7
  inherit_from:
6
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
9
  AllCops:
8
- TargetRubyVersion: 2.4
10
+ TargetRubyVersion: 2.5
9
11
  Rails:
10
12
  Enabled: false
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in relaton-un.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
data/README.adoc CHANGED
@@ -89,6 +89,18 @@ RelatonUn::UnBibliography.get "UN TRADE/CEFACT/2004/32"
89
89
  ...
90
90
  ----
91
91
 
92
+ === Typed links
93
+
94
+ UN documens may have `pdf` and `word` link types.
95
+
96
+ [source,ruby]
97
+ ----
98
+ item.link
99
+ => [#<RelatonBib::TypedUri:0x00007f81af368250
100
+ @content=#<Addressable::URI:0x9ec URI:https://documents-dds-ny.un.org/doc/UNDOC/GEN/G04/306/83/pdf/G0430683.pdf?OpenElement>, @type="pdf">,
101
+ #<RelatonBib::TypedUri:0x00007f81af3630e8 @content=#<Addressable::URI:0xa00 URI:https://documents-dds-ny.un.org/doc/UNDOC/GEN/G04/306/83/doc/G0430683.DOC?OpenElement>, @type="word">]
102
+ ----
103
+
92
104
  === Create bibliographic item from XML
93
105
  [source,ruby]
94
106
  ----
@@ -1,9 +1,10 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng"/>
4
- <start>
5
- <ref name="document"/>
6
- </start>
3
+ <include href="biblio.rng">
4
+ <start>
5
+ <ref name="document"/>
6
+ </start>
7
+ </include>
7
8
  <define name="document">
8
9
  <element name="document">
9
10
  <optional>
@@ -43,13 +44,16 @@
43
44
  </attribute>
44
45
  </optional>
45
46
  <optional>
46
- <ref name="section-title"/>
47
+ <attribute name="language"/>
47
48
  </optional>
48
49
  <optional>
49
- <ref name="BasicBlock"/>
50
+ <attribute name="script"/>
51
+ </optional>
52
+ <optional>
53
+ <ref name="section-title"/>
50
54
  </optional>
51
55
  <zeroOrMore>
52
- <ref name="note"/>
56
+ <ref name="BasicBlock"/>
53
57
  </zeroOrMore>
54
58
  </define>
55
59
  <define name="references">
@@ -92,6 +96,10 @@
92
96
  <ref name="example"/>
93
97
  <ref name="review"/>
94
98
  <ref name="pre"/>
99
+ <ref name="note"/>
100
+ <ref name="pagebreak"/>
101
+ <ref name="hr"/>
102
+ <ref name="bookmark"/>
95
103
  </choice>
96
104
  </define>
97
105
  <define name="paragraph">
@@ -165,9 +173,11 @@
165
173
  <data type="dateTime"/>
166
174
  </attribute>
167
175
  </optional>
168
- <attribute name="from">
169
- <data type="IDREF"/>
170
- </attribute>
176
+ <optional>
177
+ <attribute name="from">
178
+ <data type="IDREF"/>
179
+ </attribute>
180
+ </optional>
171
181
  <optional>
172
182
  <attribute name="to">
173
183
  <data type="IDREF"/>
@@ -188,6 +198,14 @@
188
198
  <data type="boolean"/>
189
199
  </attribute>
190
200
  </optional>
201
+ <optional>
202
+ <attribute name="subsequence"/>
203
+ </optional>
204
+ <optional>
205
+ <attribute name="inequality">
206
+ <data type="boolean"/>
207
+ </attribute>
208
+ </optional>
191
209
  <ref name="stem"/>
192
210
  <optional>
193
211
  <ref name="dl"/>
@@ -241,6 +259,9 @@
241
259
  <data type="boolean"/>
242
260
  </attribute>
243
261
  </optional>
262
+ <optional>
263
+ <attribute name="subsequence"/>
264
+ </optional>
244
265
  <optional>
245
266
  <attribute name="lang"/>
246
267
  </optional>
@@ -266,6 +287,9 @@
266
287
  <attribute name="id">
267
288
  <data type="ID"/>
268
289
  </attribute>
290
+ <optional>
291
+ <attribute name="alt"/>
292
+ </optional>
269
293
  <optional>
270
294
  <ref name="tname"/>
271
295
  </optional>
@@ -285,9 +309,15 @@
285
309
  <data type="boolean"/>
286
310
  </attribute>
287
311
  </optional>
312
+ <optional>
313
+ <attribute name="subsequence"/>
314
+ </optional>
288
315
  <optional>
289
316
  <attribute name="alt"/>
290
317
  </optional>
318
+ <optional>
319
+ <attribute name="summary"/>
320
+ </optional>
291
321
  <optional>
292
322
  <attribute name="uri">
293
323
  <data type="anyURI"/>
@@ -313,12 +343,16 @@
313
343
  </define>
314
344
  <define name="tname">
315
345
  <element name="name">
316
- <text/>
317
- </element>
318
- </define>
319
- <define name="tclass">
320
- <element name="name">
321
- <text/>
346
+ <oneOrMore>
347
+ <choice>
348
+ <ref name="PureTextElement"/>
349
+ <ref name="eref"/>
350
+ <ref name="stem"/>
351
+ <ref name="keyword"/>
352
+ <ref name="xref"/>
353
+ <ref name="hyperlink"/>
354
+ </choice>
355
+ </oneOrMore>
322
356
  </element>
323
357
  </define>
324
358
  <define name="thead">
@@ -370,6 +404,16 @@
370
404
  </choice>
371
405
  </attribute>
372
406
  </optional>
407
+ <optional>
408
+ <attribute name="valign">
409
+ <choice>
410
+ <value>top</value>
411
+ <value>middle</value>
412
+ <value>bottom</value>
413
+ <value>baseline</value>
414
+ </choice>
415
+ </attribute>
416
+ </optional>
373
417
  <choice>
374
418
  <zeroOrMore>
375
419
  <ref name="TextElement"/>
@@ -397,6 +441,16 @@
397
441
  </choice>
398
442
  </attribute>
399
443
  </optional>
444
+ <optional>
445
+ <attribute name="valign">
446
+ <choice>
447
+ <value>top</value>
448
+ <value>middle</value>
449
+ <value>bottom</value>
450
+ <value>baseline</value>
451
+ </choice>
452
+ </attribute>
453
+ </optional>
400
454
  <choice>
401
455
  <zeroOrMore>
402
456
  <ref name="TextElement"/>
@@ -417,6 +471,12 @@
417
471
  <data type="boolean"/>
418
472
  </attribute>
419
473
  </optional>
474
+ <optional>
475
+ <attribute name="subsequence"/>
476
+ </optional>
477
+ <optional>
478
+ <ref name="tname"/>
479
+ </optional>
420
480
  <oneOrMore>
421
481
  <choice>
422
482
  <ref name="formula"/>
@@ -481,17 +541,25 @@
481
541
  </attribute>
482
542
  </optional>
483
543
  <optional>
484
- <ref name="source"/>
544
+ <attribute name="subsequence"/>
485
545
  </optional>
486
546
  <optional>
487
- <ref name="tname"/>
547
+ <attribute name="class"/>
488
548
  </optional>
489
549
  <optional>
490
- <ref name="tclass"/>
550
+ <ref name="source"/>
551
+ </optional>
552
+ <optional>
553
+ <ref name="tname"/>
491
554
  </optional>
492
555
  <choice>
493
556
  <ref name="image"/>
557
+ <ref name="video"/>
558
+ <ref name="audio"/>
494
559
  <ref name="pre"/>
560
+ <oneOrMore>
561
+ <ref name="paragraph-with-footnote"/>
562
+ </oneOrMore>
495
563
  <zeroOrMore>
496
564
  <ref name="figure"/>
497
565
  </zeroOrMore>
@@ -529,6 +597,8 @@
529
597
  <ref name="pagebreak"/>
530
598
  <ref name="bookmark"/>
531
599
  <ref name="image"/>
600
+ <ref name="index"/>
601
+ <ref name="index-xref"/>
532
602
  </choice>
533
603
  </define>
534
604
  <define name="PureTextElement">
@@ -553,21 +623,38 @@
553
623
  <define name="em">
554
624
  <element name="em">
555
625
  <zeroOrMore>
556
- <ref name="PureTextElement"/>
626
+ <choice>
627
+ <ref name="PureTextElement"/>
628
+ <ref name="stem"/>
629
+ <ref name="eref"/>
630
+ <ref name="xref"/>
631
+ <ref name="hyperlink"/>
632
+ </choice>
557
633
  </zeroOrMore>
558
634
  </element>
559
635
  </define>
560
636
  <define name="strong">
561
637
  <element name="strong">
562
638
  <zeroOrMore>
563
- <ref name="PureTextElement"/>
639
+ <choice>
640
+ <ref name="PureTextElement"/>
641
+ <ref name="stem"/>
642
+ <ref name="eref"/>
643
+ <ref name="xref"/>
644
+ <ref name="hyperlink"/>
645
+ </choice>
564
646
  </zeroOrMore>
565
647
  </element>
566
648
  </define>
567
649
  <define name="tt">
568
650
  <element name="tt">
569
651
  <zeroOrMore>
570
- <ref name="PureTextElement"/>
652
+ <choice>
653
+ <ref name="PureTextElement"/>
654
+ <ref name="eref"/>
655
+ <ref name="xref"/>
656
+ <ref name="hyperlink"/>
657
+ </choice>
571
658
  </zeroOrMore>
572
659
  </element>
573
660
  </define>
@@ -653,6 +740,65 @@
653
740
  <empty/>
654
741
  </element>
655
742
  </define>
743
+ <define name="index">
744
+ <element name="index">
745
+ <optional>
746
+ <attribute name="to">
747
+ <data type="IDREF"/>
748
+ </attribute>
749
+ </optional>
750
+ <element name="primary">
751
+ <oneOrMore>
752
+ <ref name="PureTextElement"/>
753
+ </oneOrMore>
754
+ </element>
755
+ <optional>
756
+ <element name="secondary">
757
+ <oneOrMore>
758
+ <ref name="PureTextElement"/>
759
+ </oneOrMore>
760
+ </element>
761
+ </optional>
762
+ <optional>
763
+ <element name="tertiary">
764
+ <oneOrMore>
765
+ <ref name="PureTextElement"/>
766
+ </oneOrMore>
767
+ </element>
768
+ </optional>
769
+ </element>
770
+ </define>
771
+ <define name="index-xref">
772
+ <element name="index-xref">
773
+ <attribute name="also">
774
+ <data type="boolean"/>
775
+ </attribute>
776
+ <element name="primary">
777
+ <oneOrMore>
778
+ <ref name="PureTextElement"/>
779
+ </oneOrMore>
780
+ </element>
781
+ <optional>
782
+ <element name="secondary">
783
+ <oneOrMore>
784
+ <ref name="PureTextElement"/>
785
+ </oneOrMore>
786
+ </element>
787
+ </optional>
788
+ <optional>
789
+ <element name="tertiary">
790
+ <oneOrMore>
791
+ <ref name="PureTextElement"/>
792
+ </oneOrMore>
793
+ </element>
794
+ </optional>
795
+ <element name="target">
796
+ <oneOrMore>
797
+ <ref name="PureTextElement"/>
798
+ </oneOrMore>
799
+ </element>
800
+ </element>
801
+ </define>
656
802
  <!-- bare ID element, used for referencing arbitrary spans of text -->
657
803
  <define name="bookmark">
658
804
  <element name="bookmark">
@@ -689,7 +835,9 @@
689
835
  <attribute name="alt"/>
690
836
  </optional>
691
837
  <ref name="CitationType"/>
692
- <text/>
838
+ <oneOrMore>
839
+ <ref name="PureTextElement"/>
840
+ </oneOrMore>
693
841
  </define>
694
842
  <define name="hyperlink">
695
843
  <element name="link">
@@ -702,7 +850,9 @@
702
850
  <optional>
703
851
  <attribute name="alt"/>
704
852
  </optional>
705
- <text/>
853
+ <oneOrMore>
854
+ <ref name="PureTextElement"/>
855
+ </oneOrMore>
706
856
  </element>
707
857
  </define>
708
858
  <define name="xref">
@@ -716,7 +866,9 @@
716
866
  <optional>
717
867
  <attribute name="alt"/>
718
868
  </optional>
719
- <text/>
869
+ <oneOrMore>
870
+ <ref name="PureTextElement"/>
871
+ </oneOrMore>
720
872
  </element>
721
873
  </define>
722
874
  <define name="fn">
@@ -778,6 +930,9 @@
778
930
  <optional>
779
931
  <attribute name="alt"/>
780
932
  </optional>
933
+ <optional>
934
+ <attribute name="title"/>
935
+ </optional>
781
936
  <optional>
782
937
  <attribute name="longdesc">
783
938
  <data type="anyURI"/>
@@ -786,7 +941,7 @@
786
941
  </element>
787
942
  </define>
788
943
  <define name="video">
789
- <element name="image">
944
+ <element name="video">
790
945
  <attribute name="id">
791
946
  <data type="ID"/>
792
947
  </attribute>
@@ -816,6 +971,9 @@
816
971
  <optional>
817
972
  <attribute name="alt"/>
818
973
  </optional>
974
+ <optional>
975
+ <attribute name="title"/>
976
+ </optional>
819
977
  <optional>
820
978
  <attribute name="longdesc">
821
979
  <data type="anyURI"/>
@@ -827,7 +985,7 @@
827
985
  </element>
828
986
  </define>
829
987
  <define name="audio">
830
- <element name="image">
988
+ <element name="audio">
831
989
  <attribute name="id">
832
990
  <data type="ID"/>
833
991
  </attribute>
@@ -841,6 +999,9 @@
841
999
  <optional>
842
1000
  <attribute name="alt"/>
843
1001
  </optional>
1002
+ <optional>
1003
+ <attribute name="title"/>
1004
+ </optional>
844
1005
  <optional>
845
1006
  <attribute name="longdesc">
846
1007
  <data type="anyURI"/>
@@ -925,6 +1086,9 @@
925
1086
  <value>alphabet_upper</value>
926
1087
  </choice>
927
1088
  </attribute>
1089
+ <optional>
1090
+ <attribute name="start"/>
1091
+ </optional>
928
1092
  <oneOrMore>
929
1093
  <ref name="li"/>
930
1094
  </oneOrMore>
data/grammars/biblio.rng CHANGED
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -401,9 +398,9 @@
401
398
  <choice>
402
399
  <!-- iso191606 TODO -->
403
400
  <group>
404
- <oneOrMore>
401
+ <zeroOrMore>
405
402
  <ref name="street"/>
406
- </oneOrMore>
403
+ </zeroOrMore>
407
404
  <ref name="city"/>
408
405
  <optional>
409
406
  <ref name="state"/>
@@ -452,6 +449,7 @@
452
449
  <attribute name="type">
453
450
  <choice>
454
451
  <value>isni</value>
452
+ <value>orcid</value>
455
453
  <value>uri</value>
456
454
  </choice>
457
455
  </attribute>
@@ -461,10 +459,7 @@
461
459
  <define name="org-identifier">
462
460
  <element name="identifier">
463
461
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
462
+ <data type="string" datatypeLibrary=""/>
468
463
  </attribute>
469
464
  <text/>
470
465
  </element>
@@ -789,6 +784,7 @@
789
784
  <value>adapted</value>
790
785
  <value>vote-started</value>
791
786
  <value>vote-ended</value>
787
+ <value>announced</value>
792
788
  </choice>
793
789
  </define>
794
790
  <define name="bdate">
@@ -829,6 +825,11 @@
829
825
  <optional>
830
826
  <attribute name="scope"/>
831
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
832
833
  <text/>
833
834
  </element>
834
835
  </define>
@@ -1106,7 +1107,7 @@
1106
1107
  <value>complementOf</value>
1107
1108
  <value>obsoletes</value>
1108
1109
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1110
+ <value>cites</value>
1110
1111
  <value>isCitedIn</value>
1111
1112
  </choice>
1112
1113
  </define>