Project

General

Profile

« Previous | Next » 

Revision 8073

inputs/MO/: Removed old import in Specimen/

View differences:

inputs/MO/Specimen/new_terms.csv
1
convertednotes,occurrenceRemarks,,
inputs/MO/Specimen/unmapped_terms.csv
1
modified
2
basisOfRecord
3
typeStatus
inputs/MO/Specimen/postprocess.sql
1
-- Remove frameshifted rows by detecting InstitutionCodes without any letters
2
DELETE FROM :table
3
WHERE NOT COALESCE("InstitutionCode" ~ '[[:alpha:]]', false)
4
;
inputs/MO/Specimen/map.csv
1
MO,VegCore,Filter,Comments
2
CatalogNumber,accessionNumber,,
3
DateLastModified,modified,,
4
InstitutionCode,specimenHolderInstitutions,,
5
CollectionCode,collection,,
6
ScientificName,taxonName,,
7
BasisOfRecord,basisOfRecord,,
8
Kingdom,kingdom,,
9
family,family,,
10
genus,genus,,
11
species,specificEpithet,,
12
Subspecies,subspecies,,
13
ScientificNameAuthor,scientificNameAuthorship,,
14
IdentifiedBy,identifiedBy,,
15
TypeStatus,typeStatus,,
16
CollectorNumber,collectorNumber,,
17
Collector,recordedBy,,
18
DayCollected,dayCollected,,
19
MonthCollected,monthCollected,,
20
YearCollected,yearCollected,,
21
ContinentOcean,continent,,
22
Country,country,,
23
StateProvince,stateProvince,,
24
County,county,,
25
Locality,locality,,
26
longitude,decimalLongitude,,
27
latitude,decimalLatitude,,
28
MinimumElevation,minimumElevationInMeters,,
29
MaximumElevation,maximumElevationInMeters,,
30
IndividualCount,individualCount,,
31
notes,occurrenceRemarks,,
32
convertednotes,occurrenceRemarks,,
inputs/MO/Specimen/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>MO</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <authorlocationcode>
11
                            <_join>
12
                                <1>$InstitutionCode</1>
13
                                <2>$CollectionCode</2>
14
                                <3>$CatalogNumber</3>
15
                            </_join>
16
                        </authorlocationcode>
17
                        <elevation_m>
18
                            <_avg>
19
                                <1>$MinimumElevation</1>
20
                                <2>$MaximumElevation</2>
21
                            </_avg>
22
                        </elevation_m>
23
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$Locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
24
                        <locationevent>
25
                            <taxonoccurrence>
26
                                <aggregateoccurrence>
27
                                    <collectiondate>
28
                                        <_date>
29
                                            <day>
30
                                                <_nullIf>
31
                                                    <null>0</null>
32
                                                    <type>float</type>
33
                                                    <value>$DayCollected</value>
34
                                                </_nullIf>
35
                                            </day>
36
                                            <month>
37
                                                <_nullIf>
38
                                                    <null>0</null>
39
                                                    <type>float</type>
40
                                                    <value>$MonthCollected</value>
41
                                                </_nullIf>
42
                                            </month>
43
                                            <year>
44
                                                <_nullIf>
45
                                                    <null>0</null>
46
                                                    <type>float</type>
47
                                                    <value>$YearCollected</value>
48
                                                </_nullIf>
49
                                            </year>
50
                                        </_date>
51
                                    </collectiondate>
52
                                    <count>$IndividualCount</count>
53
                                    <notes>
54
                                        <_alt>
55
                                            <0>$convertednotes</0>
56
                                            <1>$notes</1>
57
                                        </_alt>
58
                                    </notes>
59
                                    <plantobservation>
60
                                        <authorplantcode>$CollectorNumber</authorplantcode>
61
                                        <specimenreplicate>
62
                                            <catalognumber_dwc>$CatalogNumber</catalognumber_dwc>
63
                                            <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
64
                                            <collectionnumber>$CollectorNumber</collectionnumber>
65
                                            <institution_id>
66
                                                <sourcelist>
67
                                                    <name>$InstitutionCode</name>
68
                                                    <sourcename>
69
                                                        <name>
70
                                                            <_split>
71
                                                                <separator>[,;] *</separator>
72
                                                                <value>$InstitutionCode</value>
73
                                                            </_split>
74
                                                        </name>
75
                                                    </sourcename>
76
                                                </sourcelist>
77
                                            </institution_id>
78
                                        </specimenreplicate>
79
                                    </plantobservation>
80
                                </aggregateoccurrence>
81
                                <collector_id><party><fullname>$Collector</fullname></party></collector_id>
82
                                <taxondetermination>
83
                                    <party_id><party><fullname>$IdentifiedBy</fullname></party></party_id>
84
                                    <taxonverbatim_id>
85
                                        <taxonverbatim>
86
                                            <taxonlabel_id>
87
                                                <taxonlabel>
88
                                                    <parent_id>
89
                                                        <taxonlabel>
90
                                                            <parent_id>
91
                                                                <taxonlabel>
92
                                                                    <rank>cultivar</rank>
93
                                                                    <parent_id>
94
                                                                        <taxonlabel>
95
                                                                            <rank>forma</rank>
96
                                                                            <parent_id>
97
                                                                                <taxonlabel>
98
                                                                                    <rank>variety</rank>
99
                                                                                    <parent_id>
100
                                                                                        <taxonlabel>
101
                                                                                            <rank>subspecies</rank>
102
                                                                                            <taxonepithet>$Subspecies</taxonepithet>
103
                                                                                            <parent_id>
104
                                                                                                <taxonlabel>
105
                                                                                                    <rank>species</rank>
106
                                                                                                    <taxonepithet>$species</taxonepithet>
107
                                                                                                    <parent_id>
108
                                                                                                        <taxonlabel>
109
                                                                                                            <rank>genus</rank>
110
                                                                                                            <taxonepithet>$genus</taxonepithet>
111
                                                                                                            <parent_id>
112
                                                                                                                <taxonlabel>
113
                                                                                                                    <rank>family</rank>
114
                                                                                                                    <taxonepithet>$family</taxonepithet>
115
                                                                                                                    <parent_id>
116
                                                                                                                        <taxonlabel>
117
                                                                                                                            <rank>order</rank>
118
                                                                                                                            <parent_id>
119
                                                                                                                                <taxonlabel>
120
                                                                                                                                    <rank>class</rank>
121
                                                                                                                                    <parent_id>
122
                                                                                                                                        <taxonlabel>
123
                                                                                                                                            <rank>phylum</rank>
124
                                                                                                                                            <parent_id>
125
                                                                                                                                                <taxonlabel>
126
                                                                                                                                                    <rank>kingdom</rank>
127
                                                                                                                                                    <taxonepithet>$Kingdom</taxonepithet>
128
                                                                                                                                                </taxonlabel>
129
                                                                                                                                            </parent_id>
130
                                                                                                                                        </taxonlabel>
131
                                                                                                                                    </parent_id>
132
                                                                                                                                </taxonlabel>
133
                                                                                                                            </parent_id>
134
                                                                                                                        </taxonlabel>
135
                                                                                                                    </parent_id>
136
                                                                                                                </taxonlabel>
137
                                                                                                            </parent_id>
138
                                                                                                        </taxonlabel>
139
                                                                                                    </parent_id>
140
                                                                                                </taxonlabel>
141
                                                                                            </parent_id>
142
                                                                                        </taxonlabel>
143
                                                                                    </parent_id>
144
                                                                                </taxonlabel>
145
                                                                            </parent_id>
146
                                                                        </taxonlabel>
147
                                                                    </parent_id>
148
                                                                </taxonlabel>
149
                                                            </parent_id>
150
                                                        </taxonlabel>
151
                                                    </parent_id>
152
                                                    <taxonomicname>
153
                                                        <_merge_prefix>
154
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
155
                                                            <value>
156
                                                                <_join_words>
157
                                                                    <1>
158
                                                                        <_alt>
159
                                                                            <1>$ScientificName</1>
160
                                                                            <2>
161
                                                                                <_join_words>
162
                                                                                    <2>$genus</2>
163
                                                                                    <3>$species</3>
164
                                                                                    <4>$Subspecies</4>
165
                                                                                </_join_words>
166
                                                                            </2>
167
                                                                        </_alt>
168
                                                                    </1>
169
                                                                    <2>$ScientificNameAuthor</2>
170
                                                                </_join_words>
171
                                                            </value>
172
                                                        </_merge_prefix>
173
                                                    </taxonomicname>
174
                                                </taxonlabel>
175
                                            </taxonlabel_id>
176
                                            <author>$ScientificNameAuthor</author>
177
                                            <family>$family</family>
178
                                            <genus>$genus</genus>
179
                                            <specific_epithet>$species</specific_epithet>
180
                                            <taxonname>$ScientificName</taxonname>
181
                                        </taxonverbatim>
182
                                    </taxonverbatim_id>
183
                                </taxondetermination>
184
                            </taxonoccurrence>
185
                        </locationevent>
186
                        <locationnarrative>$Locality</locationnarrative>
187
                        <locationplace>
188
                            <place_id>
189
                                <place>
190
                                    <coordinates_id>
191
                                        <coordinates>
192
                                            <latitude_deg>
193
                                                <_nullIf>
194
                                                    <null>0</null>
195
                                                    <type>float</type>
196
                                                    <value>$latitude</value>
197
                                                </_nullIf>
198
                                            </latitude_deg>
199
                                            <longitude_deg>
200
                                                <_nullIf>
201
                                                    <null>0</null>
202
                                                    <type>float</type>
203
                                                    <value>$longitude</value>
204
                                                </_nullIf>
205
                                            </longitude_deg>
206
                                        </coordinates>
207
                                    </coordinates_id>
208
                                    <continent>$ContinentOcean</continent>
209
                                    <country>$Country</country>
210
                                    <county>$County</county>
211
                                    <matched_place_id>
212
                                        <place>
213
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
214
                                            <coordinates_id>
215
                                                <coordinates>
216
                                                    <source_id><source><shortname>geoscrub</shortname></source></source_id>
217
                                                    <latitude_deg>
218
                                                        <_nullIf>
219
                                                            <null>0</null>
220
                                                            <type>float</type>
221
                                                            <value>$latitude</value>
222
                                                        </_nullIf>
223
                                                    </latitude_deg>
224
                                                    <longitude_deg>
225
                                                        <_nullIf>
226
                                                            <null>0</null>
227
                                                            <type>float</type>
228
                                                            <value>$longitude</value>
229
                                                        </_nullIf>
230
                                                    </longitude_deg>
231
                                                </coordinates>
232
                                            </coordinates_id>
233
                                            <country>$Country</country>
234
                                            <county>$County</county>
235
                                            <stateprovince>$StateProvince</stateprovince>
236
                                        </place>
237
                                    </matched_place_id>
238
                                    <stateprovince>$StateProvince</stateprovince>
239
                                </place>
240
                            </place_id>
241
                        </locationplace>
242
                    </location>
243
                </path>
244
            </_simplifyPath>
245
        </path>
246
    </_setDefault>
247
</VegBIEN>
248
Inserted 38 new rows into database
inputs/MO/Specimen/VegBIEN.csv
1
MO,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
CatalogNumber,"/_if[@name=""if specimen""]/cond/_exists",
3
InstitutionCode,"/_if[@name=""if specimen""]/else/source/shortname/_first/1",
4
CatalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/cond/_exists",
5
CatalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/1/_if[@name=""if specimen""]/cond/_exists",
6
InstitutionCode,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/1/_if[@name=""if specimen""]/then/_first/2",
7
CollectionCode,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/2/_join/1",
8
CatalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/3/_if[@name=""if indirect voucher""]/else",
9
MinimumElevation,/location/elevation_m/_alt/2/_avg/1,
10
MaximumElevation,/location/elevation_m/_alt/2/_avg/2,
11
CollectorNumber,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
12
Locality,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/1,
13
DayCollected,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/day/_nullIf:[null=0,type=float]/value",
14
MonthCollected,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/month/_nullIf:[null=0,type=float]/value",
15
YearCollected,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/year/_nullIf:[null=0,type=float]/value",
16
IndividualCount,/location/locationevent/taxonoccurrence/aggregateoccurrence/count,
17
convertednotes,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
18
notes,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
19
CollectorNumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/authorplantcode/_first/2,
20
CatalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
21
CollectionCode,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectioncode_dwc/_alt/1,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name
22
CollectorNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
23
CatalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
24
InstitutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/name/_first/2",
25
InstitutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/sourcename/name/_first/2/_split:[separator=""[,;] *""]/value",
26
CollectorNumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
27
ScientificName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/3",
28
Collector,/location/locationevent/taxonoccurrence/collector_id/party/fullname,
29
CollectorNumber,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
30
IdentifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/party/fullname,
31
Subspecies,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=subspecies]/taxonepithet",
32
species,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
33
genus,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=genus]/taxonepithet",
34
family,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=family]/taxonepithet",
35
Kingdom,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,phylum,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=kingdom]/taxonepithet",
36
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
37
ScientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/1,
38
genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/2,
39
species,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
40
Subspecies,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/4,
41
ScientificNameAuthor,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
42
ScientificNameAuthor,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
43
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
44
genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
45
species,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
46
ScientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonname,
47
CatalogNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/then",
48
CollectorNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/then",
49
Locality,/location/locationnarrative/_merge/1,
50
latitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
51
longitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
52
ContinentOcean,/location/locationplace/*_id/place/continent,
53
Country,/location/locationplace/*_id/place/country,
54
County,/location/locationplace/*_id/place/county,
55
latitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/latitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
56
longitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/longitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
57
Country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
58
County,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
59
StateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
60
StateProvince,/location/locationplace/*_id/place/stateprovince,
61
BasisOfRecord,,** No join mapping for basisOfRecord ** 
62
DateLastModified,,** No join mapping for modified ** 
63
TypeStatus,,** No join mapping for typeStatus ** 
inputs/MO/import_order.txt
1 1
Source
2
Specimen
3 2
Specimen.2

Also available in: Unified diff