Project

General

Profile

« Previous | Next » 

Revision 4621

mappings/VegCore-VegBIEN.csv: Added /_simplifyPath:[next=parent_id]/path to root so the returned subplot location will be its parent location if there is no subplot name or ID (indicating that that particular plot did not have subplots). Note that this also causes the parent_id forwarding effect to occur for all other tables containing parent_id, which will help prevent similar issues with subplot events, etc. This will hopefully fix the SALVIAS.plotObservations bug where some organisms did not have a subplot #, causing the subplot location to become NULL and causing the corresponding locationevent rows not to match the locationevent_unique_within_location index filter condition (which requires a parent_id), which caused multiple output table pkeys to be returned for those rows, violating the locationevent_pkeys temp table's primary key.

View differences:

test.xml.ref
1 1
Put template:
2 2
<VegBIEN>
3
    <location id="-1">
4
        <authorlocationcode>
5
            <_alt>
6
                <1>$GlobalUniqueIdentifier</1>
7
                <2>
8
                    <_join>
9
                        <1>$InstitutionCode</1>
10
                        <2>$CollectionCode</2>
11
                        <3>
12
                            <_alt>
13
                                <1>$CatalogNumberNumeric</1>
14
                                <2>$CatalogNumber</2>
15
                            </_alt>
16
                        </3>
17
                    </_join>
18
                </2>
19
            </_alt>
20
        </authorlocationcode>
21
        <elevation>
22
            <_alt>
23
                <1>
24
                    <_replace>
25
                        <\bca\.?></\bca\.?>
26
                        <value>$VerbatimElevation</value>
27
                    </_replace>
28
                </1>
29
                <2>
30
                    <_avg>
31
                        <max>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_alt>
9
                        <1>$GlobalUniqueIdentifier</1>
10
                        <2>
11
                            <_join>
12
                                <1>$InstitutionCode</1>
13
                                <2>$CollectionCode</2>
14
                                <3>
15
                                    <_alt>
16
                                        <1>$CatalogNumberNumeric</1>
17
                                        <2>$CatalogNumber</2>
18
                                    </_alt>
19
                                </3>
20
                            </_join>
21
                        </2>
22
                    </_alt>
23
                </authorlocationcode>
24
                <elevation>
25
                    <_alt>
26
                        <1>
27
                            <_replace>
28
                                <\bca\.?></\bca\.?>
29
                                <value>$VerbatimElevation</value>
30
                            </_replace>
31
                        </1>
32
                        <2>
33
                            <_avg>
34
                                <max>
35
                                    <_units>
36
                                        <default>m</default>
37
                                        <to>m</to>
38
                                        <to></to>
39
                                        <value>
40
                                            <_replace>
41
                                                <\bca\.?></\bca\.?>
42
                                                <value>$MaximumElevationInMeters</value>
43
                                            </_replace>
44
                                        </value>
45
                                    </_units>
46
                                </max>
47
                                <min>
48
                                    <_units>
49
                                        <default>m</default>
50
                                        <to>m</to>
51
                                        <to></to>
52
                                        <value>
53
                                            <_rangeStart>
54
                                                <value>
55
                                                    <_replace>
56
                                                        <\bca\.?></\bca\.?>
57
                                                        <value>$MinimumElevationInMeters</value>
58
                                                    </_replace>
59
                                                </value>
60
                                            </_rangeStart>
61
                                        </value>
62
                                    </_units>
63
                                </min>
64
                            </_avg>
65
                        </2>
66
                    </_alt>
67
                </elevation>
68
                <elevationrange>
69
                    <_range>
70
                        <from>
32 71
                            <_units>
33 72
                                <default>m</default>
34 73
                                <to>m</to>
35 74
                                <to></to>
36 75
                                <value>
37
                                    <_replace>
38
                                        <\bca\.?></\bca\.?>
39
                                        <value>$MaximumElevationInMeters</value>
40
                                    </_replace>
41
                                </value>
42
                            </_units>
43
                        </max>
44
                        <min>
45
                            <_units>
46
                                <default>m</default>
47
                                <to>m</to>
48
                                <to></to>
49
                                <value>
50 76
                                    <_rangeStart>
51 77
                                        <value>
52 78
                                            <_replace>
......
57 83
                                    </_rangeStart>
58 84
                                </value>
59 85
                            </_units>
60
                        </min>
61
                    </_avg>
62
                </2>
63
            </_alt>
64
        </elevation>
65
        <elevationrange>
66
            <_range>
67
                <from>
68
                    <_units>
69
                        <default>m</default>
70
                        <to>m</to>
71
                        <to></to>
72
                        <value>
73
                            <_rangeStart>
86
                        </from>
87
                        <to>
88
                            <_units>
89
                                <default>m</default>
90
                                <to>m</to>
91
                                <to></to>
74 92
                                <value>
75
                                    <_replace>
76
                                        <\bca\.?></\bca\.?>
77
                                        <value>$MinimumElevationInMeters</value>
78
                                    </_replace>
79
                                </value>
80
                            </_rangeStart>
81
                        </value>
82
                    </_units>
83
                </from>
84
                <to>
85
                    <_units>
86
                        <default>m</default>
87
                        <to>m</to>
88
                        <to></to>
89
                        <value>
90
                            <_alt>
91
                                <1>
92
                                    <_replace>
93
                                        <\bca\.?></\bca\.?>
94
                                        <value>$MaximumElevationInMeters</value>
95
                                    </_replace>
96
                                </1>
97
                                <2>
98
                                    <_rangeEnd>
99
                                        <value>
93
                                    <_alt>
94
                                        <1>
100 95
                                            <_replace>
101 96
                                                <\bca\.?></\bca\.?>
102
                                                <value>$MinimumElevationInMeters</value>
97
                                                <value>$MaximumElevationInMeters</value>
103 98
                                            </_replace>
104
                                        </value>
105
                                    </_rangeEnd>
106
                                </2>
107
                            </_alt>
108
                        </value>
109
                    </_units>
110
                </to>
111
            </_range>
112
        </elevationrange>
113
        <locationdetermination>
114
            <coordsaccuracy><_noCV><value>$CoordinateUncertaintyInMeters</value></_noCV></coordsaccuracy>
115
            <footprintgeometry_dwc>$BoundingBox</footprintgeometry_dwc>
116
            <latitude>
117
                <_alt>
118
                    <1>
119
                        <_nullIf>
120
                            <null>0</null>
121
                            <type>float</type>
122
                            <value>$DecimalLatitude</value>
123
                        </_nullIf>
124
                    </1>
125
                    <2>
126
                        <_nullIf>
127
                            <null>0</null>
128
                            <type>float</type>
129
                            <value>$VerbatimLatitude</value>
130
                        </_nullIf>
131
                    </2>
132
                </_alt>
133
            </latitude>
134
            <longitude>
135
                <_alt>
136
                    <1>
137
                        <_nullIf>
138
                            <null>0</null>
139
                            <type>float</type>
140
                            <value>$DecimalLongitude</value>
141
                        </_nullIf>
142
                    </1>
143
                    <2>
144
                        <_nullIf>
145
                            <null>0</null>
146
                            <type>float</type>
147
                            <value>$VerbatimLongitude</value>
148
                        </_nullIf>
149
                    </2>
150
                </_alt>
151
            </longitude>
152
            <namedplace_id>
153
                <_simplifyPath>
154
                    <next>parent_id</next>
155
                    <path>
156
                        <namedplace>
157
                            <rank>county</rank>
158
                            <placename>$County</placename>
159
                            <parent_id>
99
                                        </1>
100
                                        <2>
101
                                            <_rangeEnd>
102
                                                <value>
103
                                                    <_replace>
104
                                                        <\bca\.?></\bca\.?>
105
                                                        <value>$MinimumElevationInMeters</value>
106
                                                    </_replace>
107
                                                </value>
108
                                            </_rangeEnd>
109
                                        </2>
110
                                    </_alt>
111
                                </value>
112
                            </_units>
113
                        </to>
114
                    </_range>
115
                </elevationrange>
116
                <locationdetermination>
117
                    <coordsaccuracy><_noCV><value>$CoordinateUncertaintyInMeters</value></_noCV></coordsaccuracy>
118
                    <footprintgeometry_dwc>$BoundingBox</footprintgeometry_dwc>
119
                    <latitude>
120
                        <_alt>
121
                            <1>
122
                                <_nullIf>
123
                                    <null>0</null>
124
                                    <type>float</type>
125
                                    <value>$DecimalLatitude</value>
126
                                </_nullIf>
127
                            </1>
128
                            <2>
129
                                <_nullIf>
130
                                    <null>0</null>
131
                                    <type>float</type>
132
                                    <value>$VerbatimLatitude</value>
133
                                </_nullIf>
134
                            </2>
135
                        </_alt>
136
                    </latitude>
137
                    <longitude>
138
                        <_alt>
139
                            <1>
140
                                <_nullIf>
141
                                    <null>0</null>
142
                                    <type>float</type>
143
                                    <value>$DecimalLongitude</value>
144
                                </_nullIf>
145
                            </1>
146
                            <2>
147
                                <_nullIf>
148
                                    <null>0</null>
149
                                    <type>float</type>
150
                                    <value>$VerbatimLongitude</value>
151
                                </_nullIf>
152
                            </2>
153
                        </_alt>
154
                    </longitude>
155
                    <namedplace_id>
156
                        <_simplifyPath>
157
                            <next>parent_id</next>
158
                            <path>
160 159
                                <namedplace>
161
                                    <rank>stateProvince</rank>
162
                                    <placename>$StateProvince</placename>
160
                                    <rank>county</rank>
161
                                    <placename>$County</placename>
163 162
                                    <parent_id>
164 163
                                        <namedplace>
165
                                            <rank>country</rank>
166
                                            <placename>$Country</placename>
164
                                            <rank>stateProvince</rank>
165
                                            <placename>$StateProvince</placename>
167 166
                                            <parent_id>
168 167
                                                <namedplace>
169
                                                    <rank>continent</rank>
170
                                                    <placename>$ContinentOcean</placename>
168
                                                    <rank>country</rank>
169
                                                    <placename>$Country</placename>
170
                                                    <parent_id>
171
                                                        <namedplace>
172
                                                            <rank>continent</rank>
173
                                                            <placename>$ContinentOcean</placename>
174
                                                        </namedplace>
175
                                                    </parent_id>
171 176
                                                </namedplace>
172 177
                                            </parent_id>
173 178
                                        </namedplace>
174 179
                                    </parent_id>
175 180
                                </namedplace>
176
                            </parent_id>
177
                        </namedplace>
178
                    </path>
179
                </_simplifyPath>
180
            </namedplace_id>
181
        </locationdetermination>
182
        <locationevent>
183
            <taxonoccurrence>
184
                <aggregateoccurrence>
185
                    <collectiondate>
186
                        <_alt>
187
                            <1><_date><date>$VerbatimCollectingDate</date></_date></1>
188
                            <2>
189
                                <_date>
190
                                    <day>
191
                                        <_nullIf>
192
                                            <null>0</null>
193
                                            <type>float</type>
194
                                            <value>$DayCollected</value>
195
                                        </_nullIf>
196
                                    </day>
197
                                    <month>
198
                                        <_nullIf>
199
                                            <null>0</null>
200
                                            <type>float</type>
201
                                            <value>$MonthCollected</value>
202
                                        </_nullIf>
203
                                    </month>
204
                                    <year>
205
                                        <_nullIf>
206
                                            <null>0</null>
207
                                            <type>float</type>
208
                                            <value>$YearCollected</value>
209
                                        </_nullIf>
210
                                    </year>
211
                                </_date>
212
                            </2>
213
                        </_alt>
214
                    </collectiondate>
215
                    <count>$IndividualCount</count>
216
                    <notes>$FieldNotes</notes>
217
                    <plantobservation>
218
                        <collectionnumber>$CollectorNumber</collectionnumber>
219
                        <definedvalue fkey="tablerecord_id">
220
                            <userdefined_id>
221
                                <userdefined>
222
                                    <tablename>plantobservation</tablename>
223
                                    <userdefinedname>sex</userdefinedname>
224
                                </userdefined>
225
                            </userdefined_id>
226
                            <definedvalue>$Sex</definedvalue>
227
                        </definedvalue>
228
                        <specimenreplicate>
229
                            <catalognumber_dwc>
181
                            </path>
182
                        </_simplifyPath>
183
                    </namedplace_id>
184
                </locationdetermination>
185
                <locationevent>
186
                    <taxonoccurrence>
187
                        <aggregateoccurrence>
188
                            <collectiondate>
230 189
                                <_alt>
231
                                    <1>$CatalogNumberNumeric</1>
232
                                    <2>$CatalogNumber</2>
190
                                    <1><_date><date>$VerbatimCollectingDate</date></_date></1>
191
                                    <2>
192
                                        <_date>
193
                                            <day>
194
                                                <_nullIf>
195
                                                    <null>0</null>
196
                                                    <type>float</type>
197
                                                    <value>$DayCollected</value>
198
                                                </_nullIf>
199
                                            </day>
200
                                            <month>
201
                                                <_nullIf>
202
                                                    <null>0</null>
203
                                                    <type>float</type>
204
                                                    <value>$MonthCollected</value>
205
                                                </_nullIf>
206
                                            </month>
207
                                            <year>
208
                                                <_nullIf>
209
                                                    <null>0</null>
210
                                                    <type>float</type>
211
                                                    <value>$YearCollected</value>
212
                                                </_nullIf>
213
                                            </year>
214
                                        </_date>
215
                                    </2>
233 216
                                </_alt>
234
                            </catalognumber_dwc>
235
                            <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
236
                            <institution_id><party><organizationname>$InstitutionCode</organizationname></party></institution_id>
237
                            <sourceaccessioncode>$GlobalUniqueIdentifier</sourceaccessioncode>
238
                        </specimenreplicate>
239
                    </plantobservation>
240
                </aggregateoccurrence>
241
                <authortaxoncode>
242
                    <_alt>
243
                        <1>$CollectorNumber</1>
244
                        <2>
217
                            </collectiondate>
218
                            <count>$IndividualCount</count>
219
                            <notes>$FieldNotes</notes>
220
                            <plantobservation>
221
                                <collectionnumber>$CollectorNumber</collectionnumber>
222
                                <definedvalue fkey="tablerecord_id">
223
                                    <userdefined_id>
224
                                        <userdefined>
225
                                            <tablename>plantobservation</tablename>
226
                                            <userdefinedname>sex</userdefinedname>
227
                                        </userdefined>
228
                                    </userdefined_id>
229
                                    <definedvalue>$Sex</definedvalue>
230
                                </definedvalue>
231
                                <specimenreplicate>
232
                                    <catalognumber_dwc>
233
                                        <_alt>
234
                                            <1>$CatalogNumberNumeric</1>
235
                                            <2>$CatalogNumber</2>
236
                                        </_alt>
237
                                    </catalognumber_dwc>
238
                                    <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
239
                                    <institution_id><party><organizationname>$InstitutionCode</organizationname></party></institution_id>
240
                                    <sourceaccessioncode>$GlobalUniqueIdentifier</sourceaccessioncode>
241
                                </specimenreplicate>
242
                            </plantobservation>
243
                        </aggregateoccurrence>
244
                        <authortaxoncode>
245 245
                            <_alt>
246
                                <1>$ScientificNameAuthor</1>
247
                                <2>$ScientificName</2>
246
                                <1>$CollectorNumber</1>
247
                                <2>
248
                                    <_alt>
249
                                        <1>$ScientificNameAuthor</1>
250
                                        <2>$ScientificName</2>
251
                                    </_alt>
252
                                </2>
248 253
                            </_alt>
249
                        </2>
250
                    </_alt>
251
                </authortaxoncode>
252
                <taxondetermination>
253
                    <party_id>
254
                        <party>
255
                            <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
256
                            <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
257
                            <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
258
                        </party>
259
                    </party_id>
260
                    <plantconcept_id>
261
                        <plantconcept>
262
                            <plantname_id>
263
                                <_simplifyPath>
264
                                    <next>parent_id</next>
265
                                    <path>
266
                                        <plantname>
267
                                            <rank>binomial</rank>
268
                                            <plantname>
269
                                                <_alt>
270
                                                    <1>$ScientificNameAuthor</1>
271
                                                    <2>$ScientificName</2>
272
                                                </_alt>
273
                                            </plantname>
274
                                            <parent_id>
254
                        </authortaxoncode>
255
                        <taxondetermination>
256
                            <party_id>
257
                                <party>
258
                                    <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
259
                                    <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
260
                                    <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
261
                                </party>
262
                            </party_id>
263
                            <plantconcept_id>
264
                                <plantconcept>
265
                                    <plantname_id>
266
                                        <_simplifyPath>
267
                                            <next>parent_id</next>
268
                                            <path>
275 269
                                                <plantname>
276
                                                    <rank>authority</rank>
270
                                                    <rank>binomial</rank>
271
                                                    <plantname>
272
                                                        <_alt>
273
                                                            <1>$ScientificNameAuthor</1>
274
                                                            <2>$ScientificName</2>
275
                                                        </_alt>
276
                                                    </plantname>
277 277
                                                    <parent_id>
278 278
                                                        <plantname>
279
                                                            <rank>subspecies</rank>
280
                                                            <plantname>$Subspecies</plantname>
279
                                                            <rank>authority</rank>
281 280
                                                            <parent_id>
282 281
                                                                <plantname>
283
                                                                    <rank>species</rank>
284
                                                                    <plantname>$Species</plantname>
282
                                                                    <rank>subspecies</rank>
283
                                                                    <plantname>$Subspecies</plantname>
285 284
                                                                    <parent_id>
286 285
                                                                        <plantname>
287
                                                                            <rank>genus</rank>
288
                                                                            <plantname>$Genus</plantname>
286
                                                                            <rank>species</rank>
287
                                                                            <plantname>$Species</plantname>
289 288
                                                                            <parent_id>
290 289
                                                                                <plantname>
291
                                                                                    <rank>family</rank>
292
                                                                                    <plantname>$Family</plantname>
290
                                                                                    <rank>genus</rank>
291
                                                                                    <plantname>$Genus</plantname>
293 292
                                                                                    <parent_id>
294 293
                                                                                        <plantname>
295
                                                                                            <rank>order</rank>
296
                                                                                            <plantname>$Order</plantname>
294
                                                                                            <rank>family</rank>
295
                                                                                            <plantname>$Family</plantname>
297 296
                                                                                            <parent_id>
298 297
                                                                                                <plantname>
299
                                                                                                    <rank>class</rank>
300
                                                                                                    <plantname>$Class</plantname>
298
                                                                                                    <rank>order</rank>
299
                                                                                                    <plantname>$Order</plantname>
301 300
                                                                                                    <parent_id>
302 301
                                                                                                        <plantname>
303
                                                                                                            <rank>subkingdom</rank>
304
                                                                                                            <plantname>$Phylum</plantname>
302
                                                                                                            <rank>class</rank>
303
                                                                                                            <plantname>$Class</plantname>
305 304
                                                                                                            <parent_id>
306 305
                                                                                                                <plantname>
307
                                                                                                                    <rank>kingdom</rank>
308
                                                                                                                    <plantname>$Kingdom</plantname>
306
                                                                                                                    <rank>subkingdom</rank>
307
                                                                                                                    <plantname>$Phylum</plantname>
308
                                                                                                                    <parent_id>
309
                                                                                                                        <plantname>
310
                                                                                                                            <rank>kingdom</rank>
311
                                                                                                                            <plantname>$Kingdom</plantname>
312
                                                                                                                        </plantname>
313
                                                                                                                    </parent_id>
309 314
                                                                                                                </plantname>
310 315
                                                                                                            </parent_id>
311 316
                                                                                                        </plantname>
......
323 328
                                                        </plantname>
324 329
                                                    </parent_id>
325 330
                                                </plantname>
326
                                            </parent_id>
327
                                        </plantname>
328
                                    </path>
329
                                </_simplifyPath>
330
                            </plantname_id>
331
                        </plantconcept>
332
                    </plantconcept_id>
333
                    <determinationdate>
334
                        <_date>
335
                            <day>
336
                                <_nullIf>
337
                                    <null>0</null>
338
                                    <type>float</type>
339
                                    <value>$DayIdentified</value>
340
                                </_nullIf>
341
                            </day>
342
                            <month>
343
                                <_nullIf>
344
                                    <null>0</null>
345
                                    <type>float</type>
346
                                    <value>$MonthIdentified</value>
347
                                </_nullIf>
348
                            </month>
349
                            <year>
350
                                <_nullIf>
351
                                    <null>0</null>
352
                                    <type>float</type>
353
                                    <value>$YearIdentified</value>
354
                                </_nullIf>
355
                            </year>
356
                        </_date>
357
                    </determinationdate>
358
                    <notes>$Remarks</notes>
359
                    <taxonfit>$IdentificationModifier</taxonfit>
360
                </taxondetermination>
361
                <verbatimcollectorname>$Collector</verbatimcollectorname>
362
            </taxonoccurrence>
363
            <waterdepth>
364
                <_avg>
365
                    <max>
366
                        <_units>
367
                            <default>m</default>
368
                            <to>m</to>
369
                            <to></to>
370
                            <value>
371
                                <_replace>
372
                                    <\bca\.?></\bca\.?>
373
                                    <value>$MaximumDepthInMeters</value>
374
                                </_replace>
375
                            </value>
376
                        </_units>
377
                    </max>
378
                    <min>
379
                        <_units>
380
                            <default>m</default>
381
                            <to>m</to>
382
                            <to></to>
383
                            <value>
384
                                <_replace>
385
                                    <\bca\.?></\bca\.?>
386
                                    <value>$MinimumDepthInMeters</value>
387
                                </_replace>
388
                            </value>
389
                        </_units>
390
                    </min>
391
                </_avg>
392
            </waterdepth>
393
        </locationevent>
394
        <locationnarrative>$Locality</locationnarrative>
395
    </location>
331
                                            </path>
332
                                        </_simplifyPath>
333
                                    </plantname_id>
334
                                </plantconcept>
335
                            </plantconcept_id>
336
                            <determinationdate>
337
                                <_date>
338
                                    <day>
339
                                        <_nullIf>
340
                                            <null>0</null>
341
                                            <type>float</type>
342
                                            <value>$DayIdentified</value>
343
                                        </_nullIf>
344
                                    </day>
345
                                    <month>
346
                                        <_nullIf>
347
                                            <null>0</null>
348
                                            <type>float</type>
349
                                            <value>$MonthIdentified</value>
350
                                        </_nullIf>
351
                                    </month>
352
                                    <year>
353
                                        <_nullIf>
354
                                            <null>0</null>
355
                                            <type>float</type>
356
                                            <value>$YearIdentified</value>
357
                                        </_nullIf>
358
                                    </year>
359
                                </_date>
360
                            </determinationdate>
361
                            <notes>$Remarks</notes>
362
                            <taxonfit>$IdentificationModifier</taxonfit>
363
                        </taxondetermination>
364
                        <verbatimcollectorname>$Collector</verbatimcollectorname>
365
                    </taxonoccurrence>
366
                    <waterdepth>
367
                        <_avg>
368
                            <max>
369
                                <_units>
370
                                    <default>m</default>
371
                                    <to>m</to>
372
                                    <to></to>
373
                                    <value>
374
                                        <_replace>
375
                                            <\bca\.?></\bca\.?>
376
                                            <value>$MaximumDepthInMeters</value>
377
                                        </_replace>
378
                                    </value>
379
                                </_units>
380
                            </max>
381
                            <min>
382
                                <_units>
383
                                    <default>m</default>
384
                                    <to>m</to>
385
                                    <to></to>
386
                                    <value>
387
                                        <_replace>
388
                                            <\bca\.?></\bca\.?>
389
                                            <value>$MinimumDepthInMeters</value>
390
                                        </_replace>
391
                                    </value>
392
                                </_units>
393
                            </min>
394
                        </_avg>
395
                    </waterdepth>
396
                </locationevent>
397
                <locationnarrative>$Locality</locationnarrative>
398
            </location>
399
        </path>
400
    </_simplifyPath>
396 401
</VegBIEN>
397 402
Inserted 38 new rows into database

Also available in: Unified diff