relaton-3gpp 1.9.3 → 1.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_3gpp/data_fetcher.rb +8 -4
- data/lib/relaton_3gpp/parser.rb +33 -25
- data/lib/relaton_3gpp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac55b70bfe3aeba203ee14ae5741da783295480690d95cbcde5633464d7e2c6f
|
4
|
+
data.tar.gz: a1e1b8cdef4a740ef07311f180e2be6ee31419696acf14031b53418364ef9325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5c76b9d2ea3aeb99cac24f01ebb5759e66c9f094d81fe8d776db9c37250535b20b54abf754da38ab865571019fafc4b6f2d9a5a223a2763d4ce8ec680509233
|
7
|
+
data.tar.gz: d66f5472441b417a1491211b9ebb00112f0b3408ba3edd6c1d7fdc1fe9d20305b6d17e8b5e89990c5953994856889b14f9fbea85b4bf4897ba809c9243a1fe5a
|
@@ -52,8 +52,9 @@ module Relaton3gpp
|
|
52
52
|
specs = dbs["Specs_GSM+3G"]
|
53
53
|
specrels = dbs["Specs_GSM+3G_release-info"]
|
54
54
|
releases = dbs["Releases"]
|
55
|
+
tstatus = dbs["temp-status"]
|
55
56
|
dbs["2001-04-25_schedule"].each do |row|
|
56
|
-
fetch_doc row, specs, specrels, releases
|
57
|
+
fetch_doc row, specs, specrels, releases, tstatus
|
57
58
|
end
|
58
59
|
File.write CURRENT, @current.to_yaml, encoding: "UTF-8"
|
59
60
|
end
|
@@ -91,12 +92,15 @@ module Relaton3gpp
|
|
91
92
|
# Fetch document
|
92
93
|
#
|
93
94
|
# @param [Hash] row row from mdb
|
94
|
-
# @param [
|
95
|
+
# @param [Array<Hash>] specs specs
|
96
|
+
# @param [Array<Hash>] specrels specrels
|
97
|
+
# @param [Array<Hash>] releases releases
|
98
|
+
# @param [Array<Hash>] tstatus tstatus
|
95
99
|
#
|
96
100
|
# @return [Relaton3gpp::BibliographicItem, nil] bibliographic item
|
97
101
|
#
|
98
|
-
def fetch_doc(row, specs, specrels, releases)
|
99
|
-
doc = Parser.parse row, specs, specrels, releases
|
102
|
+
def fetch_doc(row, specs, specrels, releases, tstatus)
|
103
|
+
doc = Parser.parse row, specs, specrels, releases, tstatus
|
100
104
|
save_doc doc
|
101
105
|
rescue StandardError => e
|
102
106
|
warn "Error: #{e.message}"
|
data/lib/relaton_3gpp/parser.rb
CHANGED
@@ -7,8 +7,9 @@ module Relaton3gpp
|
|
7
7
|
# @param [Array<Hash>] specrels Spec + Release table
|
8
8
|
# @param [Array<Hash>] relaeases Releases table
|
9
9
|
# @param [Array<Hash>] specs Specs table
|
10
|
+
# @param [Array<Hash>] tstatus temp status-table
|
10
11
|
#
|
11
|
-
def initialize(row, specs, specrels, releases) # rubocop:disable Metrics/AbcSize
|
12
|
+
def initialize(row, specs, specrels, releases, tstatus) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
12
13
|
@row = row
|
13
14
|
@spec = specs.detect { |s| s[:Number] == row[:spec] }
|
14
15
|
if @spec
|
@@ -17,6 +18,7 @@ module Relaton3gpp
|
|
17
18
|
end
|
18
19
|
@rel = releases.detect { |r| r[:Release_code] == row[:release] }
|
19
20
|
end
|
21
|
+
@tstatus = tstatus.detect { |t| t[:Number] == row[:spec] }
|
20
22
|
end
|
21
23
|
|
22
24
|
#
|
@@ -26,11 +28,12 @@ module Relaton3gpp
|
|
26
28
|
# @param [Array<Hash>] specrels Spec + Release table
|
27
29
|
# @param [Array<Hash>] relaeases Releases table
|
28
30
|
# @param [Array<Hash>] specs Specs table
|
31
|
+
# @param [Array<Hash>] tstatus temp status-table
|
29
32
|
#
|
30
33
|
# @return [RelatonBib:BibliographicItem, nil] bibliographic item
|
31
34
|
#
|
32
|
-
def self.parse(row, specs, specrels, relaeases)
|
33
|
-
new(row, specs, specrels, relaeases).parse
|
35
|
+
def self.parse(row, specs, specrels, relaeases, tstatus)
|
36
|
+
new(row, specs, specrels, relaeases, tstatus).parse
|
34
37
|
end
|
35
38
|
|
36
39
|
#
|
@@ -60,7 +63,7 @@ module Relaton3gpp
|
|
60
63
|
common_ims_spec: @spec[:ComIMS] == "1",
|
61
64
|
# internal: @spec[:"For publication"] == "0",
|
62
65
|
release: parse_release,
|
63
|
-
|
66
|
+
contributor: parse_contributor,
|
64
67
|
)
|
65
68
|
end
|
66
69
|
|
@@ -103,11 +106,7 @@ module Relaton3gpp
|
|
103
106
|
# @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
|
104
107
|
#
|
105
108
|
def parse_docid
|
106
|
-
[
|
107
|
-
RelatonBib::DocumentIdentifier.new(type: "3GPP", id: "3GPP #{number}"),
|
108
|
-
RelatonBib::DocumentIdentifier.new(type: "rapporteurId",
|
109
|
-
id: @spec[:"rapporteur id"]),
|
110
|
-
]
|
109
|
+
[RelatonBib::DocumentIdentifier.new(type: "3GPP", id: "3GPP #{number}")]
|
111
110
|
end
|
112
111
|
|
113
112
|
#
|
@@ -152,19 +151,21 @@ module Relaton3gpp
|
|
152
151
|
# @return [RelatonBib::EditorialGroup] editorialgroups
|
153
152
|
#
|
154
153
|
def parse_editorialgroup # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
155
|
-
|
156
|
-
eg = [RelatonBib::TechnicalCommittee.new(wgp)]
|
154
|
+
eg = [create_workgroup(@spec[:"WG prime"], "prime")]
|
157
155
|
if @spec[:"WG other"] && @spec[:"WG other"] != "-"
|
158
|
-
|
159
|
-
eg << RelatonBib::TechnicalCommittee.new(wgo)
|
156
|
+
eg << create_workgroup(@spec[:"WG other"], "other")
|
160
157
|
end
|
161
158
|
if @spec[:"former WG"]
|
162
|
-
|
163
|
-
eg << RelatonBib::TechnicalCommittee.new(wgf)
|
159
|
+
eg << create_workgroup(@spec[:"former WG"], "former")
|
164
160
|
end
|
165
161
|
RelatonBib::EditorialGroup.new eg
|
166
162
|
end
|
167
163
|
|
164
|
+
def create_workgroup(name, type)
|
165
|
+
wgf = RelatonBib::WorkGroup.new(name: name, type: type)
|
166
|
+
RelatonBib::TechnicalCommittee.new(wgf)
|
167
|
+
end
|
168
|
+
|
168
169
|
#
|
169
170
|
# Parse note
|
170
171
|
#
|
@@ -172,10 +173,10 @@ module Relaton3gpp
|
|
172
173
|
#
|
173
174
|
def parse_note
|
174
175
|
n = []
|
175
|
-
if @specrel && @specrel[:remarks]
|
176
|
+
if @specrel && @specrel[:remarks] && @specrel[:remarks] != "."
|
176
177
|
n << RelatonBib::BiblioNote.new(type: "remark", content: @specrel[:remarks])
|
177
178
|
end
|
178
|
-
if @row[:comment]
|
179
|
+
if @row[:comment] && @row[:comment] != "."
|
179
180
|
n << RelatonBib::BiblioNote.new(type: "comment", content: @row[:comment])
|
180
181
|
end
|
181
182
|
RelatonBib::BiblioNoteCollection.new n
|
@@ -236,14 +237,21 @@ module Relaton3gpp
|
|
236
237
|
#
|
237
238
|
# Create contributor
|
238
239
|
#
|
239
|
-
# @return [Array<RelatonBib::
|
240
|
+
# @return [Array<RelatonBib::ContributionInfo>] contributor
|
240
241
|
#
|
241
|
-
#
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
242
|
+
def parse_contributor # rubocop:disable Metrics/MethodLength
|
243
|
+
return [] unless @tstatus && @tstatus[:rapporteur]
|
244
|
+
|
245
|
+
aff = []
|
246
|
+
if @tstatus[:"rapp org"]
|
247
|
+
org = RelatonBib::Organization.new(name: @tstatus[:"rapp org"])
|
248
|
+
cn = RelatonBib::LocalizedString.new @tstatus[:rapporteur], "en", "Latn"
|
249
|
+
name = RelatonBib::FullName.new(completename: cn)
|
250
|
+
aff << RelatonBib::Affiliation.new(organization: org)
|
251
|
+
end
|
252
|
+
person = RelatonBib::Person.new(name: name, affiliation: aff)
|
253
|
+
role = { type: "author" }
|
254
|
+
[RelatonBib::ContributionInfo.new(entity: person, role: [role])]
|
255
|
+
end
|
248
256
|
end
|
249
257
|
end
|
data/lib/relaton_3gpp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-3gpp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.4
|
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-12-
|
11
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|