relaton-un 1.9.0 → 1.10.0

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: 1b64d7b0f28b07e64887e9364f5f5e6ac208b56e41b98b4510bf9d390d196158
4
- data.tar.gz: a64346fb10bd24bfa6b4ca63a1e5fc6c34e696b9a76ed79bb162eb599a3cf8a6
3
+ metadata.gz: b8cddb509c1d3493c6e33544358f4e1826e2431f3fc1425c5a101e8fc30ed3bf
4
+ data.tar.gz: 0a9090a2aa04fe9fa9432fbc5ea96ff66db4a1345becf4db6c4cb92baa3e2a69
5
5
  SHA512:
6
- metadata.gz: 3733280407058b932f89d5bf7bafd4bd00eaa3669e5d87cc7eab54f0cc0b1e16a412cb5b0d2e20777f2cfb40b6c98ddee3ac63b7174ce28892025cea80693bc9
7
- data.tar.gz: 56d9ec70ddda0db1f8849877207cbd82d27bca6011f4916326d5ce456a86385c76ba6974c97b5a34ad8c278dc5afeb1c9a5488120b742c4eccae4af1164038fa
6
+ metadata.gz: 86723673e87178d39bb6b41208d33820e8d518e2db675b1f7e5cc3afa6340603868332281b08e5d42c2200a0e8f63ce379476746453ffe7accc0098f6607d999
7
+ data.tar.gz: 63e99c6607c427466c13e68304b067d0e76b250e766eb0c5407609c47f96d28ac7bef78ee62f66ed97b5a58520473343b46d5b2eefe5dac47df200ec22376d71
data/.rubocop.yml CHANGED
@@ -2,6 +2,8 @@
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:
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
  ----
@@ -173,9 +173,11 @@
173
173
  <data type="dateTime"/>
174
174
  </attribute>
175
175
  </optional>
176
- <attribute name="from">
177
- <data type="IDREF"/>
178
- </attribute>
176
+ <optional>
177
+ <attribute name="from">
178
+ <data type="IDREF"/>
179
+ </attribute>
180
+ </optional>
179
181
  <optional>
180
182
  <attribute name="to">
181
183
  <data type="IDREF"/>
@@ -624,6 +626,9 @@
624
626
  <choice>
625
627
  <ref name="PureTextElement"/>
626
628
  <ref name="stem"/>
629
+ <ref name="eref"/>
630
+ <ref name="xref"/>
631
+ <ref name="hyperlink"/>
627
632
  </choice>
628
633
  </zeroOrMore>
629
634
  </element>
@@ -634,6 +639,9 @@
634
639
  <choice>
635
640
  <ref name="PureTextElement"/>
636
641
  <ref name="stem"/>
642
+ <ref name="eref"/>
643
+ <ref name="xref"/>
644
+ <ref name="hyperlink"/>
637
645
  </choice>
638
646
  </zeroOrMore>
639
647
  </element>
@@ -641,7 +649,12 @@
641
649
  <define name="tt">
642
650
  <element name="tt">
643
651
  <zeroOrMore>
644
- <ref name="PureTextElement"/>
652
+ <choice>
653
+ <ref name="PureTextElement"/>
654
+ <ref name="eref"/>
655
+ <ref name="xref"/>
656
+ <ref name="hyperlink"/>
657
+ </choice>
645
658
  </zeroOrMore>
646
659
  </element>
647
660
  </define>
@@ -822,7 +835,9 @@
822
835
  <attribute name="alt"/>
823
836
  </optional>
824
837
  <ref name="CitationType"/>
825
- <text/>
838
+ <oneOrMore>
839
+ <ref name="PureTextElement"/>
840
+ </oneOrMore>
826
841
  </define>
827
842
  <define name="hyperlink">
828
843
  <element name="link">
@@ -835,7 +850,9 @@
835
850
  <optional>
836
851
  <attribute name="alt"/>
837
852
  </optional>
838
- <text/>
853
+ <oneOrMore>
854
+ <ref name="PureTextElement"/>
855
+ </oneOrMore>
839
856
  </element>
840
857
  </define>
841
858
  <define name="xref">
@@ -849,7 +866,9 @@
849
866
  <optional>
850
867
  <attribute name="alt"/>
851
868
  </optional>
852
- <text/>
869
+ <oneOrMore>
870
+ <ref name="PureTextElement"/>
871
+ </oneOrMore>
853
872
  </element>
854
873
  </define>
855
874
  <define name="fn">
data/grammars/biblio.rng CHANGED
@@ -401,9 +401,9 @@
401
401
  <choice>
402
402
  <!-- iso191606 TODO -->
403
403
  <group>
404
- <oneOrMore>
404
+ <zeroOrMore>
405
405
  <ref name="street"/>
406
- </oneOrMore>
406
+ </zeroOrMore>
407
407
  <ref name="city"/>
408
408
  <optional>
409
409
  <ref name="state"/>