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 +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +1 -1
- data/lib/dwca_hunter/resources/arctos.rb +10 -14
- data/lib/dwca_hunter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 200857d1971d198dfe5a7f048a1eab71cfb295f96cff9e3164d5d62486e26431
|
4
|
+
data.tar.gz: 87a07aa3c9006857c1876fa017436921621889ff833e2eb8d499d853dbe243d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aeef02ffb2e3f366aef826c7492c5acb23a7aa4fd57ec3dd8fec513176d919c306e289aaa3e678a8b629a81630da2dcd3c3b42b6259fba3aa04b971b0b6e489
|
7
|
+
data.tar.gz: c20a2dd504367154582297754fcb594a372484aa67944c8cff25bf56f1df571069fd634169d9f9ef7a3c4a708bca276dbcd413786b1de663ea0fbfc36078c7b0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.5
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
{
|
72
|
+
{ name_string: row['related_name'], status: row['TAXON_RELATIONSHIP']}
|
73
73
|
else
|
74
74
|
@synonyms_hash[canonical] = [
|
75
|
-
{
|
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 <<
|
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 <<
|
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[:
|
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[:
|
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,
|
data/lib/dwca_hunter/version.rb
CHANGED