dwca_hunter 0.5.4 → 0.5.5

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: 6c7057b88df4f16a74e5818f1f9966183968844624143c68d43715c8569adb4c
4
- data.tar.gz: 47b5a3b28b22a18fb8dff65a095775e7535f098d7cebcc60a199b82d02f8b9dc
3
+ metadata.gz: 200857d1971d198dfe5a7f048a1eab71cfb295f96cff9e3164d5d62486e26431
4
+ data.tar.gz: 87a07aa3c9006857c1876fa017436921621889ff833e2eb8d499d853dbe243d1
5
5
  SHA512:
6
- metadata.gz: b780161f3c024dfe6155028fc71c8762e83a95f8dd0f9158d5d387f0cbb77cd6525d5abb5137d8d73ed42093ccae897e38da8e8d2a13bf5b10bec1fae9f68424
7
- data.tar.gz: 3c8cfa6603b2cc8bac0766568168ed6016e3d509e62e88b47704c4b0e2662f332de230da4cbe1c8ef0cb1467ce5b6e987260875e9b160efde1e2cff169cae263
6
+ metadata.gz: 5aeef02ffb2e3f366aef826c7492c5acb23a7aa4fd57ec3dd8fec513176d919c306e289aaa3e678a8b629a81630da2dcd3c3b42b6259fba3aa04b971b0b6e489
7
+ data.tar.gz: c20a2dd504367154582297754fcb594a372484aa67944c8cff25bf56f1df571069fd634169d9f9ef7a3c4a708bca276dbcd413786b1de663ea0fbfc36078c7b0
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.4
1
+ 2.6.5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dwca_hunter (0.5.4)
4
+ dwca_hunter (0.5.5)
5
5
  biodiversity (~> 3.5)
6
6
  dwc-archive (~> 1.0)
7
7
  gn_uuid (~> 0.5)
@@ -39,9 +39,9 @@ module DwcaHunter
39
39
 
40
40
  def get_names
41
41
  Dir.chdir(@download_dir)
42
- collect_names
43
42
  collect_synonyms
44
43
  collect_vernaculars
44
+ collect_names
45
45
  end
46
46
 
47
47
  def collect_vernaculars
@@ -69,10 +69,10 @@ module DwcaHunter
69
69
  canonical = row['scientific_name']
70
70
  if @synonyms_hash.has_key?(canonical)
71
71
  @synonyms_hash[canonical] <<
72
- { synonym: row['related_name'], status: row['TAXON_RELATIONSHIP']}
72
+ { name_string: row['related_name'], status: row['TAXON_RELATIONSHIP']}
73
73
  else
74
74
  @synonyms_hash[canonical] = [
75
- { synonym: row['related_name'], status: row['TAXON_RELATIONSHIP']}
75
+ { name_string: row['related_name'], status: row['TAXON_RELATIONSHIP']}
76
76
  ]
77
77
  end
78
78
  puts "Processed %s synonyms" % i if i % 10000 == 0
@@ -103,7 +103,7 @@ module DwcaHunter
103
103
  subspecies = row['subspecies']
104
104
  code = row['nomenclatural_code']
105
105
 
106
- taxon_id = "ARCT_#{i}"
106
+ taxon_id = "ARCT_#{i+1}"
107
107
  @names << { taxon_id: taxon_id,
108
108
  name_string: name_string,
109
109
  kingdom: kingdom,
@@ -124,14 +124,15 @@ module DwcaHunter
124
124
  def update_vernacular(taxon_id, canonical)
125
125
  return unless @vernaculars_hash.has_key?(canonical)
126
126
  @vernaculars_hash[canonical].each do |vern|
127
- @vernaculars << [taxon_id, vern, 'en']
127
+ @vernaculars << { taxon_id: taxon_id, vern: vern }
128
128
  end
129
129
  end
130
130
 
131
131
  def update_synonym(taxon_id, canonical)
132
132
  return unless @synonyms_hash.has_key?(canonical)
133
133
  @synonyms_hash[canonical].each do |syn|
134
- @synonyms << [taxon_id, syn[:synonym], syn[:status]]
134
+ @synonyms << { taxon_id: taxon_id, name_string: syn[:name_string],
135
+ status: syn[:status] }
135
136
  end
136
137
  end
137
138
 
@@ -139,7 +140,6 @@ module DwcaHunter
139
140
  DwcaHunter::logger_write(self.object_id,
140
141
  'Creating DarwinCore Archive file')
141
142
  @core = [['http://rs.tdwg.org/dwc/terms/taxonID',
142
- 'http://globalnames.org/terms/localID',
143
143
  'http://rs.tdwg.org/dwc/terms/scientificName',
144
144
  'http://rs.tdwg.org/dwc/terms/kingdom',
145
145
  'http://rs.tdwg.org/dwc/terms/phylum',
@@ -150,7 +150,7 @@ module DwcaHunter
150
150
  'http://rs.tdwg.org/dwc/terms/nomenclaturalCode',
151
151
  ]]
152
152
  @names.each do |n|
153
- @core << [n[:taxon_id], n[:taxon_id], n[:name_string],
153
+ @core << [n[:taxon_id], n[:name_string],
154
154
  n[:kingdom], n[:phylum], n[:klass], n[:order], n[:family],
155
155
  n[:genus], n[:code]]
156
156
  end
@@ -162,23 +162,19 @@ module DwcaHunter
162
162
  row_type: 'http://rs.gbif.org/terms/1.0/VernacularName' }
163
163
 
164
164
  @vernaculars.each do |v|
165
- @extensions[-1][:data] << [v[:taxon_id], v[:vernacular_name_string]]
165
+ @extensions[-1][:data] << [v[:taxon_id], v[:vern]]
166
166
  end
167
167
 
168
168
  @extensions << {
169
169
  data: [[
170
170
  'http://rs.tdwg.org/dwc/terms/taxonID',
171
- 'http://globalnames.org/terms/localID',
172
171
  'http://rs.tdwg.org/dwc/terms/scientificName',
173
172
  'http://rs.tdwg.org/dwc/terms/taxonomicStatus',
174
173
  ]],
175
174
  file_name: 'synonyms.txt',
176
175
  }
177
-
178
176
  @synonyms.each do |s|
179
- @extensions[-1][:data] << [
180
- s[:taxon_id], s[:local_id],
181
- s[:name_string], s[:taxonomic_status]]
177
+ @extensions[-1][:data] << [s[:taxon_id], s[:name_string], s[:status]]
182
178
  end
183
179
  @eml = {
184
180
  id: @uuid,
@@ -1,5 +1,5 @@
1
1
  module DwcaHunter
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwca_hunter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin