relaton-ogc 1.9.1 → 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: 7fa7cf7cb4a2e7b21cb49a4fbb482f08119776626d18b6ab186080905783d516
4
- data.tar.gz: d4bb20a2c3f35b1c25ac99882c5a3f7a405a420cc5d3dbcb2f6359b0f2f6166f
3
+ metadata.gz: e0971dd92d1bf002f5a785a9fe4387020bf359f903097c39095c4f1546d19adc
4
+ data.tar.gz: 90bfffeaf964a740981517482b17101cb1217d4fa1f9978675dd6bab6a4fbce4
5
5
  SHA512:
6
- metadata.gz: d5679900661ae943e2e929500314cfbb98fe416ebe8c809fccd0daa6f5d2c6232d9c85844d406372ab41af3c413de914944fd7b0433e24c7582a80942fe7d710
7
- data.tar.gz: c187307b81cc069bc652f38e494ed01de8dfe96de9c00b7fc4c719f73dcff62335cc3d4167a4d32b1b402d31ac9df7e76fe5a77e6e2295cf4c6f1937c6b1f4a5
6
+ metadata.gz: 8bc329ea61761ca7c36c893b699d19a8dc6bfcc6a8d5ff00f96cb575821a4a1fa81c49fed946e6812db29b4f3630d08dab2cda6ba214d99f632e48856b4943f4
7
+ data.tar.gz: 97a9fd195f3a0afd5cab59489c264bdc93cb30011d719b39207d2c43db6ee51ebf6450f7d0be49d97c5a95c6142c83075a9b1626479532eb6c151fdd26c07e4d
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
@@ -39,9 +39,9 @@ require 'relaton_ogc'
39
39
  => true
40
40
 
41
41
  hits = RelatonOgc::OgcBibliography.search("OGC 19-025r1")
42
- => <RelatonOgc::HitCollection:0x007fcc8e085ba8 @ref=OGC 19-025r1 @fetched=false>
42
+ => <RelatonOgc::HitCollection:0x007fcc8e085ba8 @ref=OGC 19-025r1 @fetched=true>
43
43
 
44
- tem = hits[0].fetch
44
+ item = hits[0].fetch
45
45
  => #<RelatonOgc::OgcBibliographicItem:0x007fcab3cb4758
46
46
  ...
47
47
  ----
@@ -101,6 +101,16 @@ RelatonOgc::XMLParser.from_xml File.read('spec/fixtures/ogc_bib_item.xml')
101
101
  ...
102
102
  ----
103
103
 
104
+ === Typed links
105
+
106
+ Each OGC document has `obp` type link.
107
+
108
+ [source,ruby]
109
+ ----
110
+ item.link
111
+ => [#<RelatonBib::TypedUri:0x00007fc848994568 @content=#<Addressable::URI:0x8e8 URI:https://portal.ogc.org/files/?artifact_id=88037>, @type="obp">]
112
+ ----
113
+
104
114
  === Create bibliographic item from YAML
105
115
  [source,ruby]
106
116
  ----
@@ -113,6 +123,25 @@ RelatonOgc::OgcBibliographicItem.from_hash hash
113
123
  ...
114
124
  ----
115
125
 
126
+ === Fetch data
127
+
128
+ This gem uses the https://raw.githubusercontent.com/opengeospatial/NamingAuthority/master/incubation/bibliography/bibliography.json dataset as a data sources.
129
+
130
+ The method `RelatonOgc::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the datast and save them to the `./data` folder in YAML format.
131
+ Arguments:
132
+
133
+ - `output` - folder to save documents (default './data').
134
+ - `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml` (default `yaml`).
135
+
136
+ [source,ruby]
137
+ ----
138
+ RelatonOgc::DataFetcher.fetch
139
+ Started at: 2021-09-14 11:21:46 +0200
140
+ [relaton-ogc] WARNING Duplicated documents: 15-113r5, 08-094r1, 10-025r1, 12-128r14, 16-079, 16-007r3, 13-026r8, 12-128r12, 15-078r6, 12-176r7, 09-102r3, 14-095, 14-115, 07-147r2, 12-000, 12-006, 09-025r1, 07-036, 07-110r4, 03-105r1, 06-042, 07-165r1, 12-066, 06-104r4, 11-122r1, 09-000, 04-094, 07-006r1, 06-035r1, 03-006r3, 05-134, 04-021r3, 02-058, 01-009
141
+ Stopped at: 2021-09-14 11:21:48 +0200
142
+ => nil
143
+ ----
144
+
116
145
  == Development
117
146
 
118
147
  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.
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"/>
@@ -828,6 +825,11 @@
828
825
  <optional>
829
826
  <attribute name="scope"/>
830
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
831
833
  <text/>
832
834
  </element>
833
835
  </define>