relaton-ogc 1.7.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -11
- data/.rubocop.yml +1 -1
- data/README.adoc +1 -5
- data/grammars/basicdoc.rng +165 -20
- data/grammars/biblio.rng +5 -6
- data/grammars/isodoc.rng +532 -16
- data/grammars/ogc.rng +33 -13
- data/grammars/reqt.rng +31 -2
- data/lib/relaton_ogc/editorial_group.rb +1 -1
- data/lib/relaton_ogc/ogc_bibliographic_item.rb +7 -0
- data/lib/relaton_ogc/processor.rb +1 -2
- data/lib/relaton_ogc/scrapper.rb +1 -1
- data/lib/relaton_ogc/version.rb +1 -1
- data/lib/relaton_ogc/xml_parser.rb +2 -2
- data/relaton_ogc.gemspec +3 -4
- metadata +8 -8
data/grammars/ogc.rng
CHANGED
@@ -63,21 +63,35 @@
|
|
63
63
|
</element>
|
64
64
|
</define>
|
65
65
|
</include>
|
66
|
-
<define name="
|
67
|
-
<
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
66
|
+
<define name="TextElement" combine="choice">
|
67
|
+
<ref name="hi"/>
|
68
|
+
</define>
|
69
|
+
<define name="PureTextElement" combine="choice">
|
70
|
+
<ref name="hi"/>
|
71
|
+
</define>
|
72
|
+
<define name="hi">
|
73
|
+
<element name="hi">
|
74
|
+
<zeroOrMore>
|
75
|
+
<choice>
|
76
|
+
<ref name="PureTextElement"/>
|
77
|
+
<ref name="stem"/>
|
78
|
+
</choice>
|
79
|
+
</zeroOrMore>
|
79
80
|
</element>
|
80
81
|
</define>
|
82
|
+
<define name="DocumentSubtype">
|
83
|
+
<choice>
|
84
|
+
<value>conceptual-model</value>
|
85
|
+
<value>conceptual-model-and-encoding</value>
|
86
|
+
<value>conceptual-model-and-implementation</value>
|
87
|
+
<value>encoding</value>
|
88
|
+
<value>extension</value>
|
89
|
+
<value>implementation</value>
|
90
|
+
<value>profile</value>
|
91
|
+
<value>profile-with-extension</value>
|
92
|
+
<value>general</value>
|
93
|
+
</choice>
|
94
|
+
</define>
|
81
95
|
<define name="submitters">
|
82
96
|
<element name="submitters">
|
83
97
|
<ref name="Basic-Section"/>
|
@@ -115,6 +129,9 @@
|
|
115
129
|
<zeroOrMore>
|
116
130
|
<ref name="termdocsource"/>
|
117
131
|
</zeroOrMore>
|
132
|
+
<optional>
|
133
|
+
<ref name="misccontainer"/>
|
134
|
+
</optional>
|
118
135
|
<optional>
|
119
136
|
<ref name="boilerplate"/>
|
120
137
|
</optional>
|
@@ -126,6 +143,9 @@
|
|
126
143
|
<ref name="annex"/>
|
127
144
|
</zeroOrMore>
|
128
145
|
<ref name="bibliography"/>
|
146
|
+
<zeroOrMore>
|
147
|
+
<ref name="indexsect"/>
|
148
|
+
</zeroOrMore>
|
129
149
|
</element>
|
130
150
|
</define>
|
131
151
|
</grammar>
|
data/grammars/reqt.rng
CHANGED
@@ -30,15 +30,34 @@
|
|
30
30
|
<data type="boolean"/>
|
31
31
|
</attribute>
|
32
32
|
</optional>
|
33
|
+
<optional>
|
34
|
+
<attribute name="number"/>
|
35
|
+
</optional>
|
33
36
|
<optional>
|
34
37
|
<attribute name="subsequence"/>
|
35
38
|
</optional>
|
39
|
+
<optional>
|
40
|
+
<attribute name="keep-with-next">
|
41
|
+
<data type="boolean"/>
|
42
|
+
</attribute>
|
43
|
+
</optional>
|
44
|
+
<optional>
|
45
|
+
<attribute name="keep-lines-together">
|
46
|
+
<data type="boolean"/>
|
47
|
+
</attribute>
|
48
|
+
</optional>
|
36
49
|
<attribute name="id">
|
37
50
|
<data type="ID"/>
|
38
51
|
</attribute>
|
39
52
|
<optional>
|
40
53
|
<attribute name="filename"/>
|
41
54
|
</optional>
|
55
|
+
<optional>
|
56
|
+
<attribute name="model"/>
|
57
|
+
</optional>
|
58
|
+
<optional>
|
59
|
+
<attribute name="type"/>
|
60
|
+
</optional>
|
42
61
|
<optional>
|
43
62
|
<ref name="reqtitle"/>
|
44
63
|
</optional>
|
@@ -48,9 +67,9 @@
|
|
48
67
|
<optional>
|
49
68
|
<ref name="subject"/>
|
50
69
|
</optional>
|
51
|
-
<
|
70
|
+
<zeroOrMore>
|
52
71
|
<ref name="reqinherit"/>
|
53
|
-
</
|
72
|
+
</zeroOrMore>
|
54
73
|
<zeroOrMore>
|
55
74
|
<ref name="classification"/>
|
56
75
|
</zeroOrMore>
|
@@ -135,6 +154,16 @@
|
|
135
154
|
<data type="boolean"/>
|
136
155
|
</attribute>
|
137
156
|
</optional>
|
157
|
+
<optional>
|
158
|
+
<attribute name="keep-with-next">
|
159
|
+
<data type="boolean"/>
|
160
|
+
</attribute>
|
161
|
+
</optional>
|
162
|
+
<optional>
|
163
|
+
<attribute name="keep-lines-together">
|
164
|
+
<data type="boolean"/>
|
165
|
+
</attribute>
|
166
|
+
</optional>
|
138
167
|
<oneOrMore>
|
139
168
|
<ref name="BasicBlock"/>
|
140
169
|
</oneOrMore>
|
@@ -29,6 +29,13 @@ module RelatonOgc
|
|
29
29
|
super
|
30
30
|
end
|
31
31
|
|
32
|
+
# @param hash [Hash]
|
33
|
+
# @return [RelatonOgc::OgcBibliographicItem]
|
34
|
+
def self.from_hash(hash)
|
35
|
+
item_hash = ::RelatonOgc::HashConverter.hash_to_bib(hash)
|
36
|
+
new **item_hash
|
37
|
+
end
|
38
|
+
|
32
39
|
# @return [Hash]
|
33
40
|
def to_hash
|
34
41
|
hash = super
|
@@ -26,8 +26,7 @@ module RelatonOgc
|
|
26
26
|
# @param hash [Hash]
|
27
27
|
# @return [RelatonOgc::OgcBibliographicItem]
|
28
28
|
def hash_to_bib(hash)
|
29
|
-
|
30
|
-
::RelatonOgc::OgcBibliographicItem.new item_hash
|
29
|
+
::RelatonOgc::OgcBibliographicItem.from_hash hash
|
31
30
|
end
|
32
31
|
|
33
32
|
# Returns hash of XML grammar
|
data/lib/relaton_ogc/scrapper.rb
CHANGED
@@ -34,7 +34,7 @@ module RelatonOgc
|
|
34
34
|
class << self
|
35
35
|
# papam hit [Hash]
|
36
36
|
# @return [RelatonOgc::OrcBibliographicItem]
|
37
|
-
def parse_page(hit)
|
37
|
+
def parse_page(hit) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
38
38
|
type = fetch_type(hit["type"])
|
39
39
|
OgcBibliographicItem.new(
|
40
40
|
fetched: Date.today.to_s,
|
data/lib/relaton_ogc/version.rb
CHANGED
@@ -9,7 +9,7 @@ module RelatonOgc
|
|
9
9
|
# @param item_hash [Hash]
|
10
10
|
# @return [RelatonOgc::OgcBibliographicItem]
|
11
11
|
def bib_item(item_hash)
|
12
|
-
OgcBibliographicItem.new
|
12
|
+
OgcBibliographicItem.new(**item_hash)
|
13
13
|
end
|
14
14
|
|
15
15
|
# Override RelatonIsoBib::XMLParser.item_data method.
|
@@ -35,7 +35,7 @@ module RelatonOgc
|
|
35
35
|
sc = iso_subgroup eg&.at("subcommittee")
|
36
36
|
wg = iso_subgroup eg&.at("workgroup")
|
37
37
|
EditorialGroup.new(
|
38
|
-
committee: committe, subcommittee: sc, workgroup: wg
|
38
|
+
committee: committe, subcommittee: sc, workgroup: wg,
|
39
39
|
)
|
40
40
|
end
|
41
41
|
end
|
data/relaton_ogc.gemspec
CHANGED
@@ -23,18 +23,17 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.bindir = "exe"
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
26
27
|
|
27
|
-
# spec.add_development_dependency "debase"
|
28
28
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
29
29
|
spec.add_development_dependency "pry-byebug"
|
30
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
32
|
-
# spec.add_development_dependency "ruby-debug-ide"
|
33
32
|
spec.add_development_dependency "ruby-jing"
|
34
33
|
spec.add_development_dependency "simplecov"
|
35
34
|
spec.add_development_dependency "vcr"
|
36
35
|
spec.add_development_dependency "webmock"
|
37
36
|
|
38
|
-
spec.add_dependency "faraday", "~> 1.
|
39
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
37
|
+
spec.add_dependency "faraday", "~> 1.1"
|
38
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.9.0"
|
40
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ogc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: '1.1'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: '1.1'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: relaton-iso-bib
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.9.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.9.0
|
153
153
|
description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
|
154
154
|
model'
|
155
155
|
email:
|
@@ -197,14 +197,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
197
|
requirements:
|
198
198
|
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version:
|
200
|
+
version: 2.5.0
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
203
|
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.
|
207
|
+
rubygems_version: 3.2.3
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
|