relaton-ogc 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: 3e0c167aee5738996ba54d4e53e9b528db53d837b519b6784b5fba212674ec70
4
- data.tar.gz: a9c45d212c851a64c8bc195ad9d7d98f58a62284a9a57d05ce701589474bef81
3
+ metadata.gz: e799bd4fcdccd9eff861bfa1681dc1c3cffb5722bd6e4857911fa31ab135a75a
4
+ data.tar.gz: cd3cc2d1b72a10ed0d13095a65f6b2ccd585f68794c3a3a2e4498f6a17d0fc82
5
5
  SHA512:
6
- metadata.gz: c6c41f000b72a4ae126a7a2df77cf2d216c90f9378a9569b7a1b7e77c9970ae65b2c9b45fe54e32b4acf3695c66691b89a93a88bfd2a658b5b22407b79f58d97
7
- data.tar.gz: 643cd929a4c34d44676777005c04aa44e1034491f138e54300f53e710153cb26f28cd59da58d5d3b62c435164906e09ffe0bdd730e4e91d425fec9b738d509a3
6
+ metadata.gz: ae581db75d46459cba905dc4e22709f27d880130467ff9572cbd87d3bbc92a48d37c8a7c47c949e99e18496888068f82c16a5574caec1d0f1b3a4c8f5123d253
7
+ data.tar.gz: d26863aa5daef59cce7b2d6b1ae2993415805f99db62ce8f3c935155f5831e3ec494b9f4c079d338ce441f17bd997e06bdc48797924894d7820cc8f129a00db9
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/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rspec-core", "rspec")
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"/>