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 +4 -4
- data/.rubocop.yml +2 -0
- data/README.adoc +31 -2
- data/grammars/biblio.rng +7 -5
- data/grammars/isodoc.rng +617 -89
- data/grammars/ogc.rng +13 -13
- data/grammars/reqt.rng +15 -4
- data/lib/relaton_ogc/data_fetcher.rb +98 -0
- data/lib/relaton_ogc/hit.rb +12 -1
- data/lib/relaton_ogc/hit_collection.rb +44 -59
- data/lib/relaton_ogc/ogc_bibliography.rb +2 -1
- data/lib/relaton_ogc/processor.rb +14 -1
- data/lib/relaton_ogc/scrapper.rb +5 -3
- data/lib/relaton_ogc/version.rb +1 -1
- data/lib/relaton_ogc.rb +1 -0
- data/relaton_ogc.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0971dd92d1bf002f5a785a9fe4387020bf359f903097c39095c4f1546d19adc
|
4
|
+
data.tar.gz: 90bfffeaf964a740981517482b17101cb1217d4fa1f9978675dd6bab6a4fbce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc329ea61761ca7c36c893b699d19a8dc6bfcc6a8d5ff00f96cb575821a4a1fa81c49fed946e6812db29b4f3630d08dab2cda6ba214d99f632e48856b4943f4
|
7
|
+
data.tar.gz: 97a9fd195f3a0afd5cab59489c264bdc93cb30011d719b39207d2c43db6ee51ebf6450f7d0be49d97c5a95c6142c83075a9b1626479532eb6c151fdd26c07e4d
|
data/.rubocop.yml
CHANGED
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=
|
42
|
+
=> <RelatonOgc::HitCollection:0x007fcc8e085ba8 @ref=OGC 19-025r1 @fetched=true>
|
43
43
|
|
44
|
-
|
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
|
-
<
|
401
|
+
<zeroOrMore>
|
405
402
|
<ref name="street"/>
|
406
|
-
</
|
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>
|