Project

General

Profile

« Previous | Next » 

Revision 11256

bugfix: inputs/VegBank/+taxon_observation.**.sample/: renamed to ^taxon_observation.**.sample because a leading + has a special meaning to bash (it indicates a shell option, and you will get an error "invalid option name"), as well as to make (it indicates that a recipe command invokes make recursively)

View differences:

inputs/VegBank/+taxon_observation.**.sample/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
3 0

  
inputs/VegBank/+taxon_observation.**.sample/map.csv
1
VegBank,VegCore,Filter,Comments
2
sort_col,sort_col,,
3
country,country,,
4
continent,continent,,
5
stateProvince,stateProvince,,
6
county,county,,
7
landform,landform,,
8
locality,locality,,
9
decimalLatitude,decimalLatitude,,
10
decimalLongitude,decimalLongitude,,
11
coordinateUncertaintyInMeters,coordinateUncertaintyInMeters,,
12
coordinateUncertaintyInMeters__from_coords,coordinateUncertaintyInMeters__from_coords,,
13
coordinateUncertaintyInMeters__from_fuzzing,coordinateUncertaintyInMeters__from_fuzzing,,
14
accessRights,accessRights,,
15
accessRights_verbatim,accessRights_verbatim,,
16
projectID,projectID,,
17
locationID,locationID,,
18
locationName,locationName,,
19
parentLocationID,parentLocationID,,
20
footprintWKT,footprintWKT,,
21
elevationInMeters,elevationInMeters,,
22
slopeAspect,slopeAspect,,
23
minSlopeAspect,minSlopeAspect,,
24
maxSlopeAspect,maxSlopeAspect,,
25
slopeGradient,slopeGradient,,
26
minSlopeGradient,minSlopeGradient,,
27
maxSlopeGradient,maxSlopeGradient,,
28
plotArea_m2,plotArea_m2,,
29
eventID,eventID,,
30
authorEventCode,authorEventCode,,
31
startDate,startDate,,
32
endDate,endDate,,
33
samplingProtocol,samplingProtocol,,
34
organic_percent,organic_percent,,
35
texture,texture,,
36
sand_percent,sand_percent,,
37
silt_percent,silt_percent,,
38
clay_percent,clay_percent,,
39
ph,ph,,
40
cationExchangeCapacity_cmol_kg,cationExchangeCapacity_cmol_kg,,
41
baseSaturation_percent,baseSaturation_percent,,
42
emb_soilobs,emb_soilobs,,
43
stratum__name,stratum__name,,
44
*stratum_id,*stratum_id,,
45
*stratumtype_id,*stratumtype_id,,
46
collectorNumber,collectorNumber,,
47
dateCollected,dateCollected,,
48
originalScientificName,originalScientificName,,
49
originalTaxonName,originalTaxonName,,
50
originalVernacularName,originalVernacularName,,
51
scientificName_verbatim,scientificName_verbatim,,
52
dateIdentified,dateIdentified,,
53
kingdom,kingdom,,
54
*Subkingdom,*Subkingdom,,
55
*Superdivision,*Superdivision,,
56
*Division,*Division,,
57
*Subdivision,*Subdivision,,
58
class,class,,
59
*Subclass,*Subclass,,
60
order,order,,
61
family,family,,
62
genus,genus,,
63
taxonName,taxonName,,
64
scientificName,scientificName,,
65
scientificName__for_nearest_taxon_concept,scientificName__for_nearest_taxon_concept,,
66
vernacularName,vernacularName,,
67
occurrenceRemarks,occurrenceRemarks,,
68
observationGranularity,observationGranularity,,
69
coverPercent,coverPercent,,
70
diameterBreastHeight_cm,diameterBreastHeight_cm,,
71
height_m,height_m,,
72
individualCount,individualCount,,
73
taxonOccurrenceID,taxonOccurrenceID,,
74
taxonOccurrenceID__overall_plot,taxonOccurrenceID__overall_plot,,
75
identificationID,identificationID,,
76
identificationType,identificationType,,
77
identificationQualifier,identificationQualifier,,
78
identificationVerificationStatus,identificationVerificationStatus,,
79
aggregateOrganismObservationID__taxon_presence,aggregateOrganismObservationID__taxon_presence,,
80
aggregateOrganismObservationID__individual_count,aggregateOrganismObservationID__individual_count,,
81
aggregateOrganismObservationID,aggregateOrganismObservationID,,
82
individualID,individualID,,
83
stemID,stemID,,
84
accessionNumber,accessionNumber,,
inputs/VegBank/+taxon_observation.**.sample/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>VegBank.new</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <authorlocationcode>$locationName</authorlocationcode>
11
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
12
                        <accesslevel>$accessRights</accesslevel>
13
                        <area_m2>$plotArea_m2</area_m2>
14
                        <elevation_m>$elevationInMeters</elevation_m>
15
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
16
                        <landform>$landform</landform>
17
                        <locationevent>
18
                            <method_id><method><name>$samplingProtocol</name></method></method_id>
19
                            <project_id><project><sourceaccessioncode>$projectID</sourceaccessioncode></project></project_id>
20
                            <authoreventcode>$authorEventCode</authoreventcode>
21
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
22
                            <locationevent fkey="parent_id">
23
                                <stratum_id><stratum><stratumname>$stratum__name</stratumname></stratum></stratum_id>
24
                                <sourceaccessioncode>$eventID</sourceaccessioncode>
25
                                <taxonoccurrence>
26
                                    <aggregateoccurrence>
27
                                        <collectiondate>$dateCollected</collectiondate>
28
                                        <count>$individualCount</count>
29
                                        <cover_fraction><_percent_to_fraction><value>$coverPercent</value></_percent_to_fraction></cover_fraction>
30
                                        <notes>$occurrenceRemarks</notes>
31
                                        <plantobservation>
32
                                            <authorplantcode>$collectorNumber</authorplantcode>
33
                                            <sourceaccessioncode>$individualID</sourceaccessioncode>
34
                                            <specimenreplicate>
35
                                                <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
36
                                                <collectionnumber>$collectorNumber</collectionnumber>
37
                                            </specimenreplicate>
38
                                            <stemobservation>
39
                                                <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
40
                                                <height_m>$height_m</height_m>
41
                                                <sourceaccessioncode>$stemID</sourceaccessioncode>
42
                                            </stemobservation>
43
                                        </plantobservation>
44
                                        <sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode>
45
                                    </aggregateoccurrence>
46
                                    <authortaxoncode>$collectorNumber</authortaxoncode>
47
                                    <sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode>
48
                                    <taxondetermination>
49
                                        <taxonverbatim_id>
50
                                            <taxonverbatim>
51
                                                <taxonlabel_id>
52
                                                    <taxonlabel>
53
                                                        <parent_id>
54
                                                            <taxonlabel>
55
                                                                <parent_id>
56
                                                                    <taxonlabel>
57
                                                                        <rank>cultivar</rank>
58
                                                                        <parent_id>
59
                                                                            <taxonlabel>
60
                                                                                <rank>forma</rank>
61
                                                                                <parent_id>
62
                                                                                    <taxonlabel>
63
                                                                                        <rank>variety</rank>
64
                                                                                        <parent_id>
65
                                                                                            <taxonlabel>
66
                                                                                                <rank>subspecies</rank>
67
                                                                                                <parent_id>
68
                                                                                                    <taxonlabel>
69
                                                                                                        <rank>species</rank>
70
                                                                                                        <parent_id>
71
                                                                                                            <taxonlabel>
72
                                                                                                                <rank>genus</rank>
73
                                                                                                                <taxonepithet>$genus</taxonepithet>
74
                                                                                                                <parent_id>
75
                                                                                                                    <taxonlabel>
76
                                                                                                                        <rank>family</rank>
77
                                                                                                                        <taxonepithet>$family</taxonepithet>
78
                                                                                                                        <parent_id>
79
                                                                                                                            <taxonlabel>
80
                                                                                                                                <rank>order</rank>
81
                                                                                                                                <taxonepithet>$order</taxonepithet>
82
                                                                                                                                <parent_id>
83
                                                                                                                                    <taxonlabel>
84
                                                                                                                                        <rank>class</rank>
85
                                                                                                                                        <taxonepithet>$class</taxonepithet>
86
                                                                                                                                        <parent_id>
87
                                                                                                                                            <taxonlabel>
88
                                                                                                                                                <rank>phylum</rank>
89
                                                                                                                                                <parent_id>
90
                                                                                                                                                    <taxonlabel>
91
                                                                                                                                                        <rank>kingdom</rank>
92
                                                                                                                                                        <taxonepithet>$kingdom</taxonepithet>
93
                                                                                                                                                    </taxonlabel>
94
                                                                                                                                                </parent_id>
95
                                                                                                                                            </taxonlabel>
96
                                                                                                                                        </parent_id>
97
                                                                                                                                    </taxonlabel>
98
                                                                                                                                </parent_id>
99
                                                                                                                            </taxonlabel>
100
                                                                                                                        </parent_id>
101
                                                                                                                    </taxonlabel>
102
                                                                                                                </parent_id>
103
                                                                                                            </taxonlabel>
104
                                                                                                        </parent_id>
105
                                                                                                    </taxonlabel>
106
                                                                                                </parent_id>
107
                                                                                            </taxonlabel>
108
                                                                                        </parent_id>
109
                                                                                    </taxonlabel>
110
                                                                                </parent_id>
111
                                                                            </taxonlabel>
112
                                                                        </parent_id>
113
                                                                    </taxonlabel>
114
                                                                </parent_id>
115
                                                            </taxonlabel>
116
                                                        </parent_id>
117
                                                        <taxonomicname>
118
                                                            <_merge_prefix>
119
                                                                <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
120
                                                                <value>
121
                                                                    <_alt>
122
                                                                        <1>$scientificName</1>
123
                                                                        <2>
124
                                                                            <_alt>
125
                                                                                <1>$taxonName</1>
126
                                                                                <2><_filter_genus><value>$genus</value></_filter_genus></2>
127
                                                                            </_alt>
128
                                                                        </2>
129
                                                                    </_alt>
130
                                                                </value>
131
                                                            </_merge_prefix>
132
                                                        </taxonomicname>
133
                                                    </taxonlabel>
134
                                                </taxonlabel_id>
135
                                                <family>$family</family>
136
                                                <genus>$genus</genus>
137
                                                <taxonname>$taxonName</taxonname>
138
                                                <taxonomicname>$scientificName</taxonomicname>
139
                                            </taxonverbatim>
140
                                        </taxonverbatim_id>
141
                                        <determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate>
142
                                        <determinationtype>$identificationType</determinationtype>
143
                                        <taxonfit>$identificationQualifier</taxonfit>
144
                                    </taxondetermination>
145
                                    <taxondetermination>
146
                                        <isoriginal>true</isoriginal>
147
                                        <taxonverbatim_id>
148
                                            <taxonverbatim>
149
                                                <taxonname>$originalTaxonName</taxonname>
150
                                                <taxonomicname>$originalScientificName</taxonomicname>
151
                                            </taxonverbatim>
152
                                        </taxonverbatim_id>
153
                                    </taxondetermination>
154
                                </taxonoccurrence>
155
                            </locationevent>
156
                            <obsenddate>$endDate</obsenddate>
157
                            <obsstartdate>$startDate</obsstartdate>
158
                            <soilsample>
159
                                <basesaturation_fraction><_percent_to_fraction><value>$baseSaturation_percent</value></_percent_to_fraction></basesaturation_fraction>
160
                                <cationexchangecapacity_cmol_kg>$cationExchangeCapacity_cmol_kg</cationexchangecapacity_cmol_kg>
161
                                <clay_fraction><_percent_to_fraction><value>$clay_percent</value></_percent_to_fraction></clay_fraction>
162
                                <organic_fraction><_percent_to_fraction><value>$organic_percent</value></_percent_to_fraction></organic_fraction>
163
                                <ph>$ph</ph>
164
                                <sand_fraction><_percent_to_fraction><value>$sand_percent</value></_percent_to_fraction></sand_fraction>
165
                                <silt_fraction><_percent_to_fraction><value>$silt_percent</value></_percent_to_fraction></silt_fraction>
166
                                <texture>$texture</texture>
167
                            </soilsample>
168
                        </locationevent>
169
                        <locationnarrative>$locality</locationnarrative>
170
                        <locationplace>
171
                            <place_id>
172
                                <place>
173
                                    <coordinates_id>
174
                                        <coordinates>
175
                                            <coordsaccuracy_m><_noCV><value>$coordinateUncertaintyInMeters</value></_noCV></coordsaccuracy_m>
176
                                            <footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc>
177
                                            <latitude_deg>
178
                                                <_nullIf>
179
                                                    <null>0</null>
180
                                                    <type>float</type>
181
                                                    <value>$decimalLatitude</value>
182
                                                </_nullIf>
183
                                            </latitude_deg>
184
                                            <longitude_deg>
185
                                                <_nullIf>
186
                                                    <null>0</null>
187
                                                    <type>float</type>
188
                                                    <value>$decimalLongitude</value>
189
                                                </_nullIf>
190
                                            </longitude_deg>
191
                                        </coordinates>
192
                                    </coordinates_id>
193
                                    <continent>$continent</continent>
194
                                    <country>$country</country>
195
                                    <county>$county</county>
196
                                    <matched_place_id>
197
                                        <place>
198
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
199
                                            <coordinates_id>
200
                                                <coordinates>
201
                                                    <source_id><source><shortname>geoscrub</shortname></source></source_id>
202
                                                    <latitude_deg>
203
                                                        <_nullIf>
204
                                                            <null>0</null>
205
                                                            <type>float</type>
206
                                                            <value>$decimalLatitude</value>
207
                                                        </_nullIf>
208
                                                    </latitude_deg>
209
                                                    <longitude_deg>
210
                                                        <_nullIf>
211
                                                            <null>0</null>
212
                                                            <type>float</type>
213
                                                            <value>$decimalLongitude</value>
214
                                                        </_nullIf>
215
                                                    </longitude_deg>
216
                                                </coordinates>
217
                                            </coordinates_id>
218
                                            <country>$country</country>
219
                                            <county>$county</county>
220
                                            <stateprovince>$stateProvince</stateprovince>
221
                                        </place>
222
                                    </matched_place_id>
223
                                    <stateprovince>$stateProvince</stateprovince>
224
                                </place>
225
                            </place_id>
226
                        </locationplace>
227
                        <parent_id><location><sourceaccessioncode>$parentLocationID</sourceaccessioncode></location></parent_id>
228
                        <slopeaspect_deg>
229
                            <_alt>
230
                                <1><_compass><value>$slopeAspect</value></_compass></1>
231
                                <2>
232
                                    <_avg>
233
                                        <1>$minSlopeAspect</1>
234
                                        <2>$maxSlopeAspect</2>
235
                                    </_avg>
236
                                </2>
237
                            </_alt>
238
                        </slopeaspect_deg>
239
                        <slopegradient_fraction>
240
                            <_alt>
241
                                <1>$slopeGradient</1>
242
                                <2>
243
                                    <_avg>
244
                                        <1>$minSlopeGradient</1>
245
                                        <2>$maxSlopeGradient</2>
246
                                    </_avg>
247
                                </2>
248
                            </_alt>
249
                        </slopegradient_fraction>
250
                    </location>
251
                </path>
252
            </_simplifyPath>
253
        </path>
254
    </_setDefault>
255
</VegBIEN>
256
Inserted 30 new rows into database
inputs/VegBank/+taxon_observation.**.sample/VegBIEN.csv
1
link ../../../mappings/VegCore-VegBIEN.csv
2 0

  
inputs/VegBank/+taxon_observation.**.sample/unmapped_terms.csv
1
sort_col
2
coordinateUncertaintyInMeters__from_coords
3
coordinateUncertaintyInMeters__from_fuzzing
4
accessRights_verbatim
5
emb_soilobs
6
*stratum_id
7
*stratumtype_id
8
originalVernacularName
9
scientificName_verbatim
10
*Subkingdom
11
*Superdivision
12
*Division
13
*Subdivision
14
*Subclass
15
scientificName__for_nearest_taxon_concept
16
vernacularName
17
taxonOccurrenceID__overall_plot
18
identificationID
19
identificationVerificationStatus
20
aggregateOrganismObservationID__taxon_presence
21
aggregateOrganismObservationID__individual_count
inputs/VegBank/+taxon_observation.**.sample/create.sql
1
SELECT
2
  "sort_col"
3
, "country"
4
, "continent"
5
, "stateProvince"
6
, "county"
7
, "landform"
8
, "locality"
9
, "decimalLatitude"
10
, "decimalLongitude"
11
, "coordinateUncertaintyInMeters"
12
, "coordinateUncertaintyInMeters__from_coords"
13
, "coordinateUncertaintyInMeters__from_fuzzing"
14
, "accessRights"
15
, "accessRights_verbatim"
16
, "projectID"
17
, "locationID"
18
, "locationName"
19
, "parentLocationID"
20
, "footprintWKT"
21
, "elevationInMeters"
22
, "slopeAspect"
23
, "minSlopeAspect"
24
, "maxSlopeAspect"
25
, "slopeGradient"
26
, "minSlopeGradient"
27
, "maxSlopeGradient"
28
, "plotArea_m2"
29
, "eventID"
30
, "authorEventCode"
31
, "startDate"
32
, "endDate"
33
, "samplingProtocol"
34
, "organic_percent"
35
, "texture"
36
, "sand_percent"
37
, "silt_percent"
38
, "clay_percent"
39
, "ph"
40
, "cationExchangeCapacity_cmol_kg"
41
, "baseSaturation_percent"
42
, "emb_soilobs"
43
, "stratum__name"
44
, "*stratum_id"
45
, "*stratumtype_id"
46
, "collectorNumber"
47
, "dateCollected"
48
, "originalScientificName"
49
, "originalTaxonName"
50
, "originalVernacularName"
51
, "scientificName_verbatim"
52
, "dateIdentified"
53
, "kingdom"
54
, "*Subkingdom"
55
, "*Superdivision"
56
, "*Division"
57
, "*Subdivision"
58
, "class"
59
, "*Subclass"
60
, "order"
61
, "family"
62
, "genus"
63
, "taxonName"
64
, "scientificName"
65
, "scientificName__for_nearest_taxon_concept"
66
, "vernacularName"
67
, "occurrenceRemarks"
68
, "observationGranularity"
69
, "coverPercent"
70
, "diameterBreastHeight_cm"
71
, "height_m"
72
, "individualCount"
73
, "taxonOccurrenceID"
74
, "taxonOccurrenceID__overall_plot"
75
, "identificationID"
76
, "identificationType"
77
, "identificationQualifier"
78
, "identificationVerificationStatus"
79
, "aggregateOrganismObservationID__taxon_presence"
80
, "aggregateOrganismObservationID__individual_count"
81
, "aggregateOrganismObservationID"
82
, "individualID"
83
, "stemID"
84
, "accessionNumber"
85
FROM "taxon_observation.**"
86
WHERE "locationID" IN (/*Heritage*/27581, /*CVS*/80476, /*NPS*/25572, /*GAP*/46073, /*Jennings*/11862, /*soil*/27234)
87
	-- see wiki.vegpath.org/Spot-checking#VegBank
88
; -- runtime: 1 s ("1289.136 ms") @starscream
inputs/VegBank/+taxon_observation.**.sample/header.csv
1
sort_col,country,continent,stateProvince,county,landform,locality,decimalLatitude,decimalLongitude,coordinateUncertaintyInMeters,coordinateUncertaintyInMeters__from_coords,coordinateUncertaintyInMeters__from_fuzzing,accessRights,accessRights_verbatim,projectID,locationID,locationName,parentLocationID,footprintWKT,elevationInMeters,slopeAspect,minSlopeAspect,maxSlopeAspect,slopeGradient,minSlopeGradient,maxSlopeGradient,plotArea_m2,eventID,authorEventCode,startDate,endDate,samplingProtocol,organic_percent,texture,sand_percent,silt_percent,clay_percent,ph,cationExchangeCapacity_cmol_kg,baseSaturation_percent,emb_soilobs,stratum__name,*stratum_id,*stratumtype_id,collectorNumber,dateCollected,originalScientificName,originalTaxonName,originalVernacularName,scientificName_verbatim,dateIdentified,kingdom,*Subkingdom,*Superdivision,*Division,*Subdivision,class,*Subclass,order,family,genus,taxonName,scientificName,scientificName__for_nearest_taxon_concept,vernacularName,occurrenceRemarks,observationGranularity,coverPercent,diameterBreastHeight_cm,height_m,individualCount,taxonOccurrenceID,taxonOccurrenceID__overall_plot,identificationID,identificationType,identificationQualifier,identificationVerificationStatus,aggregateOrganismObservationID__taxon_presence,aggregateOrganismObservationID__individual_count,aggregateOrganismObservationID,individualID,stemID,accessionNumber
inputs/VegBank/^taxon_observation.**.sample/create.sql
1
SELECT
2
  "sort_col"
3
, "country"
4
, "continent"
5
, "stateProvince"
6
, "county"
7
, "landform"
8
, "locality"
9
, "decimalLatitude"
10
, "decimalLongitude"
11
, "coordinateUncertaintyInMeters"
12
, "coordinateUncertaintyInMeters__from_coords"
13
, "coordinateUncertaintyInMeters__from_fuzzing"
14
, "accessRights"
15
, "accessRights_verbatim"
16
, "projectID"
17
, "locationID"
18
, "locationName"
19
, "parentLocationID"
20
, "footprintWKT"
21
, "elevationInMeters"
22
, "slopeAspect"
23
, "minSlopeAspect"
24
, "maxSlopeAspect"
25
, "slopeGradient"
26
, "minSlopeGradient"
27
, "maxSlopeGradient"
28
, "plotArea_m2"
29
, "eventID"
30
, "authorEventCode"
31
, "startDate"
32
, "endDate"
33
, "samplingProtocol"
34
, "organic_percent"
35
, "texture"
36
, "sand_percent"
37
, "silt_percent"
38
, "clay_percent"
39
, "ph"
40
, "cationExchangeCapacity_cmol_kg"
41
, "baseSaturation_percent"
42
, "emb_soilobs"
43
, "stratum__name"
44
, "*stratum_id"
45
, "*stratumtype_id"
46
, "collectorNumber"
47
, "dateCollected"
48
, "originalScientificName"
49
, "originalTaxonName"
50
, "originalVernacularName"
51
, "scientificName_verbatim"
52
, "dateIdentified"
53
, "kingdom"
54
, "*Subkingdom"
55
, "*Superdivision"
56
, "*Division"
57
, "*Subdivision"
58
, "class"
59
, "*Subclass"
60
, "order"
61
, "family"
62
, "genus"
63
, "taxonName"
64
, "scientificName"
65
, "scientificName__for_nearest_taxon_concept"
66
, "vernacularName"
67
, "occurrenceRemarks"
68
, "observationGranularity"
69
, "coverPercent"
70
, "diameterBreastHeight_cm"
71
, "height_m"
72
, "individualCount"
73
, "taxonOccurrenceID"
74
, "taxonOccurrenceID__overall_plot"
75
, "identificationID"
76
, "identificationType"
77
, "identificationQualifier"
78
, "identificationVerificationStatus"
79
, "aggregateOrganismObservationID__taxon_presence"
80
, "aggregateOrganismObservationID__individual_count"
81
, "aggregateOrganismObservationID"
82
, "individualID"
83
, "stemID"
84
, "accessionNumber"
85
FROM "taxon_observation.**"
86
WHERE "locationID" IN (/*Heritage*/27581, /*CVS*/80476, /*NPS*/25572, /*GAP*/46073, /*Jennings*/11862, /*soil*/27234)
87
	-- see wiki.vegpath.org/Spot-checking#VegBank
88
; -- runtime: 1 s ("1289.136 ms") @starscream
inputs/VegBank/^taxon_observation.**.sample/header.csv
1
sort_col,country,continent,stateProvince,county,landform,locality,decimalLatitude,decimalLongitude,coordinateUncertaintyInMeters,coordinateUncertaintyInMeters__from_coords,coordinateUncertaintyInMeters__from_fuzzing,accessRights,accessRights_verbatim,projectID,locationID,locationName,parentLocationID,footprintWKT,elevationInMeters,slopeAspect,minSlopeAspect,maxSlopeAspect,slopeGradient,minSlopeGradient,maxSlopeGradient,plotArea_m2,eventID,authorEventCode,startDate,endDate,samplingProtocol,organic_percent,texture,sand_percent,silt_percent,clay_percent,ph,cationExchangeCapacity_cmol_kg,baseSaturation_percent,emb_soilobs,stratum__name,*stratum_id,*stratumtype_id,collectorNumber,dateCollected,originalScientificName,originalTaxonName,originalVernacularName,scientificName_verbatim,dateIdentified,kingdom,*Subkingdom,*Superdivision,*Division,*Subdivision,class,*Subclass,order,family,genus,taxonName,scientificName,scientificName__for_nearest_taxon_concept,vernacularName,occurrenceRemarks,observationGranularity,coverPercent,diameterBreastHeight_cm,height_m,individualCount,taxonOccurrenceID,taxonOccurrenceID__overall_plot,identificationID,identificationType,identificationQualifier,identificationVerificationStatus,aggregateOrganismObservationID__taxon_presence,aggregateOrganismObservationID__individual_count,aggregateOrganismObservationID,individualID,stemID,accessionNumber
inputs/VegBank/^taxon_observation.**.sample/map.csv
1
VegBank,VegCore,Filter,Comments
2
sort_col,sort_col,,
3
country,country,,
4
continent,continent,,
5
stateProvince,stateProvince,,
6
county,county,,
7
landform,landform,,
8
locality,locality,,
9
decimalLatitude,decimalLatitude,,
10
decimalLongitude,decimalLongitude,,
11
coordinateUncertaintyInMeters,coordinateUncertaintyInMeters,,
12
coordinateUncertaintyInMeters__from_coords,coordinateUncertaintyInMeters__from_coords,,
13
coordinateUncertaintyInMeters__from_fuzzing,coordinateUncertaintyInMeters__from_fuzzing,,
14
accessRights,accessRights,,
15
accessRights_verbatim,accessRights_verbatim,,
16
projectID,projectID,,
17
locationID,locationID,,
18
locationName,locationName,,
19
parentLocationID,parentLocationID,,
20
footprintWKT,footprintWKT,,
21
elevationInMeters,elevationInMeters,,
22
slopeAspect,slopeAspect,,
23
minSlopeAspect,minSlopeAspect,,
24
maxSlopeAspect,maxSlopeAspect,,
25
slopeGradient,slopeGradient,,
26
minSlopeGradient,minSlopeGradient,,
27
maxSlopeGradient,maxSlopeGradient,,
28
plotArea_m2,plotArea_m2,,
29
eventID,eventID,,
30
authorEventCode,authorEventCode,,
31
startDate,startDate,,
32
endDate,endDate,,
33
samplingProtocol,samplingProtocol,,
34
organic_percent,organic_percent,,
35
texture,texture,,
36
sand_percent,sand_percent,,
37
silt_percent,silt_percent,,
38
clay_percent,clay_percent,,
39
ph,ph,,
40
cationExchangeCapacity_cmol_kg,cationExchangeCapacity_cmol_kg,,
41
baseSaturation_percent,baseSaturation_percent,,
42
emb_soilobs,emb_soilobs,,
43
stratum__name,stratum__name,,
44
*stratum_id,*stratum_id,,
45
*stratumtype_id,*stratumtype_id,,
46
collectorNumber,collectorNumber,,
47
dateCollected,dateCollected,,
48
originalScientificName,originalScientificName,,
49
originalTaxonName,originalTaxonName,,
50
originalVernacularName,originalVernacularName,,
51
scientificName_verbatim,scientificName_verbatim,,
52
dateIdentified,dateIdentified,,
53
kingdom,kingdom,,
54
*Subkingdom,*Subkingdom,,
55
*Superdivision,*Superdivision,,
56
*Division,*Division,,
57
*Subdivision,*Subdivision,,
58
class,class,,
59
*Subclass,*Subclass,,
60
order,order,,
61
family,family,,
62
genus,genus,,
63
taxonName,taxonName,,
64
scientificName,scientificName,,
65
scientificName__for_nearest_taxon_concept,scientificName__for_nearest_taxon_concept,,
66
vernacularName,vernacularName,,
67
occurrenceRemarks,occurrenceRemarks,,
68
observationGranularity,observationGranularity,,
69
coverPercent,coverPercent,,
70
diameterBreastHeight_cm,diameterBreastHeight_cm,,
71
height_m,height_m,,
72
individualCount,individualCount,,
73
taxonOccurrenceID,taxonOccurrenceID,,
74
taxonOccurrenceID__overall_plot,taxonOccurrenceID__overall_plot,,
75
identificationID,identificationID,,
76
identificationType,identificationType,,
77
identificationQualifier,identificationQualifier,,
78
identificationVerificationStatus,identificationVerificationStatus,,
79
aggregateOrganismObservationID__taxon_presence,aggregateOrganismObservationID__taxon_presence,,
80
aggregateOrganismObservationID__individual_count,aggregateOrganismObservationID__individual_count,,
81
aggregateOrganismObservationID,aggregateOrganismObservationID,,
82
individualID,individualID,,
83
stemID,stemID,,
84
accessionNumber,accessionNumber,,
inputs/VegBank/^taxon_observation.**.sample/unmapped_terms.csv
1
sort_col
2
coordinateUncertaintyInMeters__from_coords
3
coordinateUncertaintyInMeters__from_fuzzing
4
accessRights_verbatim
5
emb_soilobs
6
*stratum_id
7
*stratumtype_id
8
originalVernacularName
9
scientificName_verbatim
10
*Subkingdom
11
*Superdivision
12
*Division
13
*Subdivision
14
*Subclass
15
scientificName__for_nearest_taxon_concept
16
vernacularName
17
taxonOccurrenceID__overall_plot
18
identificationID
19
identificationVerificationStatus
20
aggregateOrganismObservationID__taxon_presence
21
aggregateOrganismObservationID__individual_count
inputs/VegBank/^taxon_observation.**.sample/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>VegBank.new</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <authorlocationcode>$locationName</authorlocationcode>
11
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
12
                        <accesslevel>$accessRights</accesslevel>
13
                        <area_m2>$plotArea_m2</area_m2>
14
                        <elevation_m>$elevationInMeters</elevation_m>
15
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
16
                        <landform>$landform</landform>
17
                        <locationevent>
18
                            <method_id><method><name>$samplingProtocol</name></method></method_id>
19
                            <project_id><project><sourceaccessioncode>$projectID</sourceaccessioncode></project></project_id>
20
                            <authoreventcode>$authorEventCode</authoreventcode>
21
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
22
                            <locationevent fkey="parent_id">
23
                                <stratum_id><stratum><stratumname>$stratum__name</stratumname></stratum></stratum_id>
24
                                <sourceaccessioncode>$eventID</sourceaccessioncode>
25
                                <taxonoccurrence>
26
                                    <aggregateoccurrence>
27
                                        <collectiondate>$dateCollected</collectiondate>
28
                                        <count>$individualCount</count>
29
                                        <cover_fraction><_percent_to_fraction><value>$coverPercent</value></_percent_to_fraction></cover_fraction>
30
                                        <notes>$occurrenceRemarks</notes>
31
                                        <plantobservation>
32
                                            <authorplantcode>$collectorNumber</authorplantcode>
33
                                            <sourceaccessioncode>$individualID</sourceaccessioncode>
34
                                            <specimenreplicate>
35
                                                <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
36
                                                <collectionnumber>$collectorNumber</collectionnumber>
37
                                            </specimenreplicate>
38
                                            <stemobservation>
39
                                                <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
40
                                                <height_m>$height_m</height_m>
41
                                                <sourceaccessioncode>$stemID</sourceaccessioncode>
42
                                            </stemobservation>
43
                                        </plantobservation>
44
                                        <sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode>
45
                                    </aggregateoccurrence>
46
                                    <authortaxoncode>$collectorNumber</authortaxoncode>
47
                                    <sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode>
48
                                    <taxondetermination>
49
                                        <taxonverbatim_id>
50
                                            <taxonverbatim>
51
                                                <taxonlabel_id>
52
                                                    <taxonlabel>
53
                                                        <parent_id>
54
                                                            <taxonlabel>
55
                                                                <parent_id>
56
                                                                    <taxonlabel>
57
                                                                        <rank>cultivar</rank>
58
                                                                        <parent_id>
59
                                                                            <taxonlabel>
60
                                                                                <rank>forma</rank>
61
                                                                                <parent_id>
62
                                                                                    <taxonlabel>
63
                                                                                        <rank>variety</rank>
64
                                                                                        <parent_id>
65
                                                                                            <taxonlabel>
66
                                                                                                <rank>subspecies</rank>
67
                                                                                                <parent_id>
68
                                                                                                    <taxonlabel>
69
                                                                                                        <rank>species</rank>
70
                                                                                                        <parent_id>
71
                                                                                                            <taxonlabel>
72
                                                                                                                <rank>genus</rank>
73
                                                                                                                <taxonepithet>$genus</taxonepithet>
74
                                                                                                                <parent_id>
75
                                                                                                                    <taxonlabel>
76
                                                                                                                        <rank>family</rank>
77
                                                                                                                        <taxonepithet>$family</taxonepithet>
78
                                                                                                                        <parent_id>
79
                                                                                                                            <taxonlabel>
80
                                                                                                                                <rank>order</rank>
81
                                                                                                                                <taxonepithet>$order</taxonepithet>
82
                                                                                                                                <parent_id>
83
                                                                                                                                    <taxonlabel>
84
                                                                                                                                        <rank>class</rank>
85
                                                                                                                                        <taxonepithet>$class</taxonepithet>
86
                                                                                                                                        <parent_id>
87
                                                                                                                                            <taxonlabel>
88
                                                                                                                                                <rank>phylum</rank>
89
                                                                                                                                                <parent_id>
90
                                                                                                                                                    <taxonlabel>
91
                                                                                                                                                        <rank>kingdom</rank>
92
                                                                                                                                                        <taxonepithet>$kingdom</taxonepithet>
93
                                                                                                                                                    </taxonlabel>
94
                                                                                                                                                </parent_id>
95
                                                                                                                                            </taxonlabel>
96
                                                                                                                                        </parent_id>
97
                                                                                                                                    </taxonlabel>
98
                                                                                                                                </parent_id>
99
                                                                                                                            </taxonlabel>
100
                                                                                                                        </parent_id>
101
                                                                                                                    </taxonlabel>
102
                                                                                                                </parent_id>
103
                                                                                                            </taxonlabel>
104
                                                                                                        </parent_id>
105
                                                                                                    </taxonlabel>
106
                                                                                                </parent_id>
107
                                                                                            </taxonlabel>
108
                                                                                        </parent_id>
109
                                                                                    </taxonlabel>
110
                                                                                </parent_id>
111
                                                                            </taxonlabel>
112
                                                                        </parent_id>
113
                                                                    </taxonlabel>
114
                                                                </parent_id>
115
                                                            </taxonlabel>
116
                                                        </parent_id>
117
                                                        <taxonomicname>
118
                                                            <_merge_prefix>
119
                                                                <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
120
                                                                <value>
121
                                                                    <_alt>
122
                                                                        <1>$scientificName</1>
123
                                                                        <2>
124
                                                                            <_alt>
125
                                                                                <1>$taxonName</1>
126
                                                                                <2><_filter_genus><value>$genus</value></_filter_genus></2>
127
                                                                            </_alt>
128
                                                                        </2>
129
                                                                    </_alt>
130
                                                                </value>
131
                                                            </_merge_prefix>
132
                                                        </taxonomicname>
133
                                                    </taxonlabel>
134
                                                </taxonlabel_id>
135
                                                <family>$family</family>
136
                                                <genus>$genus</genus>
137
                                                <taxonname>$taxonName</taxonname>
138
                                                <taxonomicname>$scientificName</taxonomicname>
139
                                            </taxonverbatim>
140
                                        </taxonverbatim_id>
141
                                        <determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate>
142
                                        <determinationtype>$identificationType</determinationtype>
143
                                        <taxonfit>$identificationQualifier</taxonfit>
144
                                    </taxondetermination>
145
                                    <taxondetermination>
146
                                        <isoriginal>true</isoriginal>
147
                                        <taxonverbatim_id>
148
                                            <taxonverbatim>
149
                                                <taxonname>$originalTaxonName</taxonname>
150
                                                <taxonomicname>$originalScientificName</taxonomicname>
151
                                            </taxonverbatim>
152
                                        </taxonverbatim_id>
153
                                    </taxondetermination>
154
                                </taxonoccurrence>
155
                            </locationevent>
156
                            <obsenddate>$endDate</obsenddate>
157
                            <obsstartdate>$startDate</obsstartdate>
158
                            <soilsample>
159
                                <basesaturation_fraction><_percent_to_fraction><value>$baseSaturation_percent</value></_percent_to_fraction></basesaturation_fraction>
160
                                <cationexchangecapacity_cmol_kg>$cationExchangeCapacity_cmol_kg</cationexchangecapacity_cmol_kg>
161
                                <clay_fraction><_percent_to_fraction><value>$clay_percent</value></_percent_to_fraction></clay_fraction>
162
                                <organic_fraction><_percent_to_fraction><value>$organic_percent</value></_percent_to_fraction></organic_fraction>
163
                                <ph>$ph</ph>
164
                                <sand_fraction><_percent_to_fraction><value>$sand_percent</value></_percent_to_fraction></sand_fraction>
165
                                <silt_fraction><_percent_to_fraction><value>$silt_percent</value></_percent_to_fraction></silt_fraction>
166
                                <texture>$texture</texture>
167
                            </soilsample>
168
                        </locationevent>
169
                        <locationnarrative>$locality</locationnarrative>
170
                        <locationplace>
171
                            <place_id>
172
                                <place>
173
                                    <coordinates_id>
174
                                        <coordinates>
175
                                            <coordsaccuracy_m><_noCV><value>$coordinateUncertaintyInMeters</value></_noCV></coordsaccuracy_m>
176
                                            <footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc>
177
                                            <latitude_deg>
178
                                                <_nullIf>
179
                                                    <null>0</null>
180
                                                    <type>float</type>
181
                                                    <value>$decimalLatitude</value>
182
                                                </_nullIf>
183
                                            </latitude_deg>
184
                                            <longitude_deg>
185
                                                <_nullIf>
186
                                                    <null>0</null>
187
                                                    <type>float</type>
188
                                                    <value>$decimalLongitude</value>
189
                                                </_nullIf>
190
                                            </longitude_deg>
191
                                        </coordinates>
192
                                    </coordinates_id>
193
                                    <continent>$continent</continent>
194
                                    <country>$country</country>
195
                                    <county>$county</county>
196
                                    <matched_place_id>
197
                                        <place>
198
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
199
                                            <coordinates_id>
200
                                                <coordinates>
201
                                                    <source_id><source><shortname>geoscrub</shortname></source></source_id>
202
                                                    <latitude_deg>
203
                                                        <_nullIf>
204
                                                            <null>0</null>
205
                                                            <type>float</type>
206
                                                            <value>$decimalLatitude</value>
207
                                                        </_nullIf>
208
                                                    </latitude_deg>
209
                                                    <longitude_deg>
210
                                                        <_nullIf>
211
                                                            <null>0</null>
212
                                                            <type>float</type>
213
                                                            <value>$decimalLongitude</value>
214
                                                        </_nullIf>
215
                                                    </longitude_deg>
216
                                                </coordinates>
217
                                            </coordinates_id>
218
                                            <country>$country</country>
219
                                            <county>$county</county>
220
                                            <stateprovince>$stateProvince</stateprovince>
221
                                        </place>
222
                                    </matched_place_id>
223
                                    <stateprovince>$stateProvince</stateprovince>
224
                                </place>
225
                            </place_id>
226
                        </locationplace>
227
                        <parent_id><location><sourceaccessioncode>$parentLocationID</sourceaccessioncode></location></parent_id>
228
                        <slopeaspect_deg>
229
                            <_alt>
230
                                <1><_compass><value>$slopeAspect</value></_compass></1>
231
                                <2>
232
                                    <_avg>
233
                                        <1>$minSlopeAspect</1>
234
                                        <2>$maxSlopeAspect</2>
235
                                    </_avg>
236
                                </2>
237
                            </_alt>
238
                        </slopeaspect_deg>
239
                        <slopegradient_fraction>
240
                            <_alt>
241
                                <1>$slopeGradient</1>
242
                                <2>
243
                                    <_avg>
244
                                        <1>$minSlopeGradient</1>
245
                                        <2>$maxSlopeGradient</2>
246
                                    </_avg>
247
                                </2>
248
                            </_alt>
249
                        </slopegradient_fraction>
250
                    </location>
251
                </path>
252
            </_simplifyPath>
253
        </path>
254
    </_setDefault>
255
</VegBIEN>
256
Inserted 30 new rows into database
inputs/VegBank/^taxon_observation.**.sample/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/^taxon_observation.**.sample/VegBIEN.csv
1
link ../../../mappings/VegCore-VegBIEN.csv
0 2

  

Also available in: Unified diff