relaton-cie 1.9.1 → 1.11.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: 2d5d26de612f4a997641b1f7325f48624e0f9d349d43373236bb10ec27115fb8
4
- data.tar.gz: 31bec1cd855722cff7d70b57106b78182d98683c8c98984027827cf1f8ae9579
3
+ metadata.gz: 1d2cefa2cb49b7ac6fe1f579cc7f90e12079d15924e2f08063c9f35d1d86e0fa
4
+ data.tar.gz: '019d52977cb7e3faa12ac4cd18fd574b453beb344a9bd3be20dfc51dce04fdc1'
5
5
  SHA512:
6
- metadata.gz: 63027b7c118820397e616d083cd6aed0748fc9eb13efa3d12428a7441bddfb9f31b9375825cea31825cccc3ba518c9ffc39c0e4984299cdf49c519c5dc1d979a
7
- data.tar.gz: e01df911e2fe2d1974bfc5004bbbf49ffb336872c7bead4722997050e38c141ef349d41f5c92f31d7acebdaa4c02dcca1cde012983c79533255687e77f31d298
6
+ metadata.gz: 5a5ada2761d2668f4f81a7c2277004ac2be55c612fa630cff23b80992aa8121328a08347e6961475998a2eeff963b736048f0e0a6c88568a532d8f9fdcdcea39
7
+ data.tar.gz: 0a6825c093957f67d19fd76497a557cba0718bd3e558c44789c542cb0a6609eedbfc0419f8638b9ff280851e69542e7d13e8701133b60602317b44979cd0ef67
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
@@ -112,6 +112,15 @@ item.to_xml bibdata: true
112
112
  <doctype>document</doctype>
113
113
  </ext>
114
114
  </bibdata>"
115
+ ----
116
+ === Typed links
117
+
118
+ Each CIE document has `src` type link.
119
+
120
+ [source,ruby]
121
+ ----
122
+ item.link
123
+ => [#<RelatonBib::TypedUri:0x00007fe58e8d4048 @content=#<Addressable::URI:0xbe50 URI:https://www.techstreet.com/cie/standards/cie-001-1980?product_id=1210107>, @type="src">]
115
124
  ----
116
125
 
117
126
  === Parse a file locally
@@ -123,6 +132,25 @@ item = RelatonBib::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
123
132
  ...
124
133
  ----
125
134
 
135
+ === Fetch data
136
+
137
+ This gem uses the https://www.techstreet.com/cie/searches/31156444 dataset as one of data sources.
138
+
139
+ The method `RelatonCie::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the datast and save them to the `./data` folder in YAML format.
140
+ Arguments:
141
+
142
+ - `output` - folder to save documents (default './data').
143
+ - `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml` (default `yaml`).
144
+
145
+ [source,ruby]
146
+ ----
147
+ RelatonCie::DataFetcher.fetch
148
+ Started at: 2021-09-08 16:37:53 +0200
149
+ Stopped at: 2021-09-08 16:49:17 +0200
150
+ Done in: 684 sec.
151
+ => nil
152
+ ----
153
+
126
154
  == Development
127
155
 
128
156
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -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
@@ -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"/>
@@ -680,6 +677,9 @@
680
677
  <zeroOrMore>
681
678
  <ref name="extent"/>
682
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
683
683
  <zeroOrMore>
684
684
  <ref name="accesslocation"/>
685
685
  </zeroOrMore>
@@ -828,6 +828,11 @@
828
828
  <optional>
829
829
  <attribute name="scope"/>
830
830
  </optional>
831
+ <optional>
832
+ <attribute name="primary">
833
+ <data type="boolean"/>
834
+ </attribute>
835
+ </optional>
831
836
  <text/>
832
837
  </element>
833
838
  </define>
@@ -920,9 +925,29 @@
920
925
  <text/>
921
926
  </element>
922
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
923
941
  <define name="extent">
924
942
  <element name="extent">
925
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
926
951
  </element>
927
952
  </define>
928
953
  <define name="series">