Revision 11776
Added by Aaron Marcuse-Kubitza about 11 years ago
inputs/CVS/import_order.txt | ||
---|---|---|
7 | 7 |
taxonObservation_ |
8 | 8 |
stemCount_ |
9 | 9 |
taxon_observation.** |
10 |
^taxon_observation.**.sample |
inputs/CVS/^taxon_observation.**.sample/create.sql | ||
---|---|---|
1 |
SELECT |
|
2 |
"sort_col" |
|
3 |
, "continent" |
|
4 |
, "country" |
|
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 |
, "eventID" |
|
22 |
, "authorEventCode" |
|
23 |
, "startDate" |
|
24 |
, "endDate" |
|
25 |
, "elevationInMeters" |
|
26 |
, "slopeAspect" |
|
27 |
, "minSlopeAspect" |
|
28 |
, "maxSlopeAspect" |
|
29 |
, "slopeGradient" |
|
30 |
, "minSlopeGradient" |
|
31 |
, "maxSlopeGradient" |
|
32 |
, "plotArea_m2" |
|
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 |
, "stratum__name" |
|
43 |
, "*STRATUM_ID" |
|
44 |
, "*STRATUMTYPE_ID" |
|
45 |
, "collectorNumber" |
|
46 |
, "dateCollected" |
|
47 |
--, "identifiedBy" |
|
48 |
, "dateIdentified" |
|
49 |
, "taxon_determination__is_current" |
|
50 |
, "taxon_determination__is_original" |
|
51 |
, "kingdom" |
|
52 |
, "*Subkingdom" |
|
53 |
, "*division" |
|
54 |
, "class" |
|
55 |
, "*Subclass" |
|
56 |
, "order" |
|
57 |
, "family" |
|
58 |
, "*tribe" |
|
59 |
, "genus" |
|
60 |
, "subgenus" |
|
61 |
, "*section" |
|
62 |
, "scientificName" |
|
63 |
, "occurrenceRemarks" |
|
64 |
, "observationGranularity" |
|
65 |
, "coverPercent" |
|
66 |
, "diameterBreastHeight_cm" |
|
67 |
, "height_m" |
|
68 |
, "taxonOccurrenceID" |
|
69 |
, "taxonOccurrenceID__overall_plot" |
|
70 |
, "identificationID" |
|
71 |
, "identificationType" |
|
72 |
, "identificationQualifier" |
|
73 |
, "identificationVerificationStatus" |
|
74 |
, "aggregateOrganismObservationID__taxon_presence" |
|
75 |
, "aggregateOrganismObservationID__individual_count" |
|
76 |
, "aggregateOrganismObservationID" |
|
77 |
, "individualCount" |
|
78 |
, "accessionNumber" |
|
79 |
FROM "taxon_observation.**" |
|
80 |
WHERE "locationName" IN ('005-02-0301', '041-09-0577', '088-08-1204', '114-01-0043', '001-04-0226', '067-ANGE-6', '052-02-080') |
|
81 |
-- see wiki.vegpath.org/Spot-checking#CVS |
|
82 |
; -- runtime: ~0 ("91.804 ms") @starscream |
inputs/CVS/^taxon_observation.**.sample/header.csv | ||
---|---|---|
1 |
sort_col,continent,country,stateProvince,county,landform,locality,decimalLatitude,decimalLongitude,coordinateUncertaintyInMeters,coordinateUncertaintyInMeters__from_coords,coordinateUncertaintyInMeters__from_fuzzing,accessRights,accessRights_verbatim,projectID,locationID,locationName,parentLocationID,footprintWKT,eventID,authorEventCode,startDate,endDate,elevationInMeters,slopeAspect,minSlopeAspect,maxSlopeAspect,slopeGradient,minSlopeGradient,maxSlopeGradient,plotArea_m2,samplingProtocol,organic_percent,texture,sand_percent,silt_percent,clay_percent,ph,cationExchangeCapacity_cmol_kg,baseSaturation_percent,stratum__name,*STRATUM_ID,*STRATUMTYPE_ID,collectorNumber,dateCollected,dateIdentified,taxon_determination__is_current,taxon_determination__is_original,kingdom,*Subkingdom,*division,class,*Subclass,order,family,*tribe,genus,subgenus,*section,scientificName,occurrenceRemarks,observationGranularity,coverPercent,diameterBreastHeight_cm,height_m,taxonOccurrenceID,taxonOccurrenceID__overall_plot,identificationID,identificationType,identificationQualifier,identificationVerificationStatus,aggregateOrganismObservationID__taxon_presence,aggregateOrganismObservationID__individual_count,aggregateOrganismObservationID,individualCount,accessionNumber |
inputs/CVS/^taxon_observation.**.sample/run | ||
---|---|---|
1 |
#!/bin/bash -e |
|
2 |
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run |
|
0 | 3 |
inputs/CVS/^taxon_observation.**.sample/map.csv | ||
---|---|---|
1 |
CVS,VegCore,Filter,Comments |
|
2 |
sort_col,*sort_col,, |
|
3 |
continent,continent,, |
|
4 |
country,country,, |
|
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 |
eventID,eventID,, |
|
22 |
authorEventCode,authorEventCode,, |
|
23 |
startDate,startDate,, |
|
24 |
endDate,endDate,, |
|
25 |
elevationInMeters,elevationInMeters,, |
|
26 |
slopeAspect,slopeAspect,, |
|
27 |
minSlopeAspect,minSlopeAspect,, |
|
28 |
maxSlopeAspect,maxSlopeAspect,, |
|
29 |
slopeGradient,slopeGradient,, |
|
30 |
minSlopeGradient,minSlopeGradient,, |
|
31 |
maxSlopeGradient,maxSlopeGradient,, |
|
32 |
plotArea_m2,plotArea_m2,, |
|
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 |
stratum__name,stratum__name,, |
|
43 |
*STRATUM_ID,**STRATUM_ID,, |
|
44 |
*STRATUMTYPE_ID,**STRATUMTYPE_ID,, |
|
45 |
collectorNumber,collectorNumber,, |
|
46 |
dateCollected,dateCollected,, |
|
47 |
dateIdentified,dateIdentified,, |
|
48 |
taxon_determination__is_current,taxon_determination__is_current,, |
|
49 |
taxon_determination__is_original,taxon_determination__is_original,, |
|
50 |
kingdom,kingdom,, |
|
51 |
*Subkingdom,**Subkingdom,, |
|
52 |
*division,**division,, |
|
53 |
class,class,, |
|
54 |
*Subclass,**Subclass,, |
|
55 |
order,order,, |
|
56 |
family,family,, |
|
57 |
*tribe,**tribe,, |
|
58 |
genus,genus,, |
|
59 |
subgenus,subgenus,, |
|
60 |
*section,**section,, |
|
61 |
scientificName,scientificName,, |
|
62 |
occurrenceRemarks,occurrenceRemarks,, |
|
63 |
observationGranularity,observationGranularity,, |
|
64 |
coverPercent,coverPercent,, |
|
65 |
diameterBreastHeight_cm,diameterBreastHeight_cm,, |
|
66 |
height_m,height_m,, |
|
67 |
taxonOccurrenceID,taxonOccurrenceID,, |
|
68 |
taxonOccurrenceID__overall_plot,*taxonOccurrenceID__overall_plot,, |
|
69 |
identificationID,identificationID,, |
|
70 |
identificationType,identificationType,, |
|
71 |
identificationQualifier,identificationQualifier,, |
|
72 |
identificationVerificationStatus,identificationVerificationStatus,, |
|
73 |
aggregateOrganismObservationID__taxon_presence,*aggregateOrganismObservationID__taxon_presence,, |
|
74 |
aggregateOrganismObservationID__individual_count,*aggregateOrganismObservationID__individual_count,, |
|
75 |
aggregateOrganismObservationID,aggregateOrganismObservationID,, |
|
76 |
individualCount,individualCount,, |
|
77 |
accessionNumber,accessionNumber,, |
inputs/CVS/^taxon_observation.**.sample/VegBIEN.csv | ||
---|---|---|
1 |
link ../../../mappings/VegCore-VegBIEN.csv |
|
0 | 2 |
inputs/CVS/^taxon_observation.**.sample/test.xml.ref | ||
---|---|---|
1 |
<!--put template--> |
|
2 |
<VegBIEN> |
|
3 |
<_setDefault id="-1"> |
|
4 |
<source_id><source><shortname>CVS.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 |
<specimenreplicate> |
|
34 |
<catalognumber_dwc>$accessionNumber</catalognumber_dwc> |
|
35 |
<collectionnumber>$collectorNumber</collectionnumber> |
|
36 |
</specimenreplicate> |
|
37 |
<stemobservation> |
|
38 |
<diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m> |
|
39 |
<height_m>$height_m</height_m> |
|
40 |
</stemobservation> |
|
41 |
</plantobservation> |
|
42 |
<sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode> |
|
43 |
</aggregateoccurrence> |
|
44 |
<authortaxoncode>$collectorNumber</authortaxoncode> |
|
45 |
<sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode> |
|
46 |
<taxondetermination> |
|
47 |
<taxonverbatim_id> |
|
48 |
<taxonverbatim> |
|
49 |
<taxonlabel_id> |
|
50 |
<taxonlabel> |
|
51 |
<parent_id> |
|
52 |
<taxonlabel> |
|
53 |
<parent_id> |
|
54 |
<taxonlabel> |
|
55 |
<rank>cultivar</rank> |
|
56 |
<parent_id> |
|
57 |
<taxonlabel> |
|
58 |
<rank>forma</rank> |
|
59 |
<parent_id> |
|
60 |
<taxonlabel> |
|
61 |
<rank>variety</rank> |
|
62 |
<parent_id> |
|
63 |
<taxonlabel> |
|
64 |
<rank>subspecies</rank> |
|
65 |
<parent_id> |
|
66 |
<taxonlabel> |
|
67 |
<rank>species</rank> |
|
68 |
<parent_id> |
|
69 |
<taxonlabel> |
|
70 |
<rank>genus</rank> |
|
71 |
<taxonepithet>$genus</taxonepithet> |
|
72 |
<parent_id> |
|
73 |
<taxonlabel> |
|
74 |
<rank>family</rank> |
|
75 |
<taxonepithet>$family</taxonepithet> |
|
76 |
<parent_id> |
|
77 |
<taxonlabel> |
|
78 |
<rank>order</rank> |
|
79 |
<taxonepithet>$order</taxonepithet> |
|
80 |
<parent_id> |
|
81 |
<taxonlabel> |
|
82 |
<rank>class</rank> |
|
83 |
<taxonepithet>$class</taxonepithet> |
|
84 |
<parent_id> |
|
85 |
<taxonlabel> |
|
86 |
<rank>phylum</rank> |
|
87 |
<parent_id> |
|
88 |
<taxonlabel> |
|
89 |
<rank>kingdom</rank> |
|
90 |
<taxonepithet>$kingdom</taxonepithet> |
|
91 |
</taxonlabel> |
|
92 |
</parent_id> |
|
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 |
<taxonomicname> |
|
116 |
<_merge_prefix> |
|
117 |
<prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix> |
|
118 |
<value> |
|
119 |
<_alt> |
|
120 |
<1>$scientificName</1> |
|
121 |
<2><_filter_genus><value>$genus</value></_filter_genus></2> |
|
122 |
</_alt> |
|
123 |
</value> |
|
124 |
</_merge_prefix> |
|
125 |
</taxonomicname> |
|
126 |
</taxonlabel> |
|
127 |
</taxonlabel_id> |
|
128 |
<family>$family</family> |
|
129 |
<genus>$genus</genus> |
|
130 |
<taxonomicname>$scientificName</taxonomicname> |
|
131 |
</taxonverbatim> |
|
132 |
</taxonverbatim_id> |
|
133 |
<determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate> |
|
134 |
<determinationtype>$identificationType</determinationtype> |
|
135 |
<iscurrent__verbatim>$taxon_determination__is_current</iscurrent__verbatim> |
|
136 |
<isoriginal>$taxon_determination__is_original</isoriginal> |
|
137 |
<taxonfit>$identificationQualifier</taxonfit> |
|
138 |
</taxondetermination> |
|
139 |
</taxonoccurrence> |
|
140 |
</locationevent> |
|
141 |
<obsenddate>$endDate</obsenddate> |
|
142 |
<obsstartdate>$startDate</obsstartdate> |
|
143 |
<soilsample> |
|
144 |
<basesaturation_fraction><_percent_to_fraction><value>$baseSaturation_percent</value></_percent_to_fraction></basesaturation_fraction> |
|
145 |
<cationexchangecapacity_cmol_kg>$cationExchangeCapacity_cmol_kg</cationexchangecapacity_cmol_kg> |
|
146 |
<clay_fraction><_percent_to_fraction><value>$clay_percent</value></_percent_to_fraction></clay_fraction> |
|
147 |
<organic_fraction><_percent_to_fraction><value>$organic_percent</value></_percent_to_fraction></organic_fraction> |
|
148 |
<ph>$ph</ph> |
|
149 |
<sand_fraction><_percent_to_fraction><value>$sand_percent</value></_percent_to_fraction></sand_fraction> |
|
150 |
<silt_fraction><_percent_to_fraction><value>$silt_percent</value></_percent_to_fraction></silt_fraction> |
|
151 |
<texture>$texture</texture> |
|
152 |
</soilsample> |
|
153 |
</locationevent> |
|
154 |
<locationnarrative>$locality</locationnarrative> |
|
155 |
<locationplace> |
|
156 |
<place_id> |
|
157 |
<place> |
|
158 |
<coordinates_id> |
|
159 |
<coordinates> |
|
160 |
<coordsaccuracy_m><_noCV><value>$coordinateUncertaintyInMeters</value></_noCV></coordsaccuracy_m> |
|
161 |
<footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc> |
|
162 |
<latitude_deg> |
|
163 |
<_nullIf> |
|
164 |
<null>0</null> |
|
165 |
<type>float</type> |
|
166 |
<value>$decimalLatitude</value> |
|
167 |
</_nullIf> |
|
168 |
</latitude_deg> |
|
169 |
<longitude_deg> |
|
170 |
<_nullIf> |
|
171 |
<null>0</null> |
|
172 |
<type>float</type> |
|
173 |
<value>$decimalLongitude</value> |
|
174 |
</_nullIf> |
|
175 |
</longitude_deg> |
|
176 |
</coordinates> |
|
177 |
</coordinates_id> |
|
178 |
<continent>$continent</continent> |
|
179 |
<country>$country</country> |
|
180 |
<county>$county</county> |
|
181 |
<matched_place_id> |
|
182 |
<place> |
|
183 |
<source_id><source><shortname>geoscrub</shortname></source></source_id> |
|
184 |
<coordinates_id> |
|
185 |
<coordinates> |
|
186 |
<source_id><source><shortname>geoscrub</shortname></source></source_id> |
|
187 |
<latitude_deg> |
|
188 |
<_nullIf> |
|
189 |
<null>0</null> |
|
190 |
<type>float</type> |
|
191 |
<value>$decimalLatitude</value> |
|
192 |
</_nullIf> |
|
193 |
</latitude_deg> |
|
194 |
<longitude_deg> |
|
195 |
<_nullIf> |
|
196 |
<null>0</null> |
|
197 |
<type>float</type> |
|
198 |
<value>$decimalLongitude</value> |
|
199 |
</_nullIf> |
|
200 |
</longitude_deg> |
|
201 |
</coordinates> |
|
202 |
</coordinates_id> |
|
203 |
<country>$country</country> |
|
204 |
<county>$county</county> |
|
205 |
<stateprovince>$stateProvince</stateprovince> |
|
206 |
</place> |
|
207 |
</matched_place_id> |
|
208 |
<stateprovince>$stateProvince</stateprovince> |
|
209 |
</place> |
|
210 |
</place_id> |
|
211 |
</locationplace> |
|
212 |
<parent_id><location><sourceaccessioncode>$parentLocationID</sourceaccessioncode></location></parent_id> |
|
213 |
<slopeaspect_deg> |
|
214 |
<_alt> |
|
215 |
<1><_compass><value>$slopeAspect</value></_compass></1> |
|
216 |
<2> |
|
217 |
<_avg> |
|
218 |
<1>$minSlopeAspect</1> |
|
219 |
<2>$maxSlopeAspect</2> |
|
220 |
</_avg> |
|
221 |
</2> |
|
222 |
</_alt> |
|
223 |
</slopeaspect_deg> |
|
224 |
<slopegradient_fraction> |
|
225 |
<_alt> |
|
226 |
<1>$slopeGradient</1> |
|
227 |
<2> |
|
228 |
<_avg> |
|
229 |
<1>$minSlopeGradient</1> |
|
230 |
<2>$maxSlopeGradient</2> |
|
231 |
</_avg> |
|
232 |
</2> |
|
233 |
</_alt> |
|
234 |
</slopegradient_fraction> |
|
235 |
</location> |
|
236 |
</path> |
|
237 |
</_simplifyPath> |
|
238 |
</path> |
|
239 |
</_setDefault> |
|
240 |
</VegBIEN> |
|
241 |
Inserted 33 new rows into database |
inputs/CVS/^taxon_observation.**.sample/unmapped_terms.csv | ||
---|---|---|
1 |
*sort_col |
|
2 |
*coordinateUncertaintyInMeters__from_coords |
|
3 |
*coordinateUncertaintyInMeters__from_fuzzing |
|
4 |
*accessRights_verbatim |
|
5 |
**STRATUM_ID |
|
6 |
**STRATUMTYPE_ID |
|
7 |
**Subkingdom |
|
8 |
**division |
|
9 |
**Subclass |
|
10 |
**tribe |
|
11 |
subgenus |
|
12 |
**section |
|
13 |
*taxonOccurrenceID__overall_plot |
|
14 |
identificationID |
|
15 |
identificationVerificationStatus |
|
16 |
*aggregateOrganismObservationID__taxon_presence |
|
17 |
*aggregateOrganismObservationID__individual_count |
Also available in: Unified diff
added inputs/CVS/^taxon_observation.**.sample/, used for the extract. note that the column list is slightly different than for VegBank.