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
            <_join>
6
                <1>$InstitutionCD</1>
7
                <2>$CollectionCD</2>
8
                <3>$CatalogNO</3>
9
            </_join>
10
        </authorlocationcode>
11
        <elevation>
12
            <_avg>
13
                <max>
14
                    <_units>
15
                        <default>m</default>
16
                        <to>m</to>
17
                        <to></to>
18
                        <value>
19
                            <_replace>
20
                                <\bca\.?></\bca\.?>
21
                                <value>$MaximumElevationInMeter</value>
22
                            </_replace>
23
                        </value>
24
                    </_units>
25
                </max>
26
                <min>
27
                    <_units>
28
                        <default>m</default>
29
                        <to>m</to>
30
                        <to></to>
31
                        <value>
32
                            <_rangeStart>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_join>
9
                        <1>$InstitutionCD</1>
10
                        <2>$CollectionCD</2>
11
                        <3>$CatalogNO</3>
12
                    </_join>
13
                </authorlocationcode>
14
                <elevation>
15
                    <_avg>
16
                        <max>
17
                            <_units>
18
                                <default>m</default>
19
                                <to>m</to>
20
                                <to></to>
33 21
                                <value>
34 22
                                    <_replace>
35 23
                                        <\bca\.?></\bca\.?>
36
                                        <value>$MinimumElevationInMeter</value>
24
                                        <value>$MaximumElevationInMeter</value>
37 25
                                    </_replace>
38 26
                                </value>
39
                            </_rangeStart>
40
                        </value>
41
                    </_units>
42
                </min>
43
            </_avg>
44
        </elevation>
45
        <elevationrange>
46
            <_range>
47
                <from>
48
                    <_units>
49
                        <default>m</default>
50
                        <to>m</to>
51
                        <to></to>
52
                        <value>
53
                            <_rangeStart>
27
                            </_units>
28
                        </max>
29
                        <min>
30
                            <_units>
31
                                <default>m</default>
32
                                <to>m</to>
33
                                <to></to>
54 34
                                <value>
55
                                    <_replace>
56
                                        <\bca\.?></\bca\.?>
57
                                        <value>$MinimumElevationInMeter</value>
58
                                    </_replace>
35
                                    <_rangeStart>
36
                                        <value>
37
                                            <_replace>
38
                                                <\bca\.?></\bca\.?>
39
                                                <value>$MinimumElevationInMeter</value>
40
                                            </_replace>
41
                                        </value>
42
                                    </_rangeStart>
59 43
                                </value>
60
                            </_rangeStart>
61
                        </value>
62
                    </_units>
63
                </from>
64
                <to>
65
                    <_units>
66
                        <default>m</default>
67
                        <to>m</to>
68
                        <to></to>
69
                        <value>
70
                            <_alt>
71
                                <1>
72
                                    <_replace>
73
                                        <\bca\.?></\bca\.?>
74
                                        <value>$MaximumElevationInMeter</value>
75
                                    </_replace>
76
                                </1>
77
                                <2>
78
                                    <_rangeEnd>
44
                            </_units>
45
                        </min>
46
                    </_avg>
47
                </elevation>
48
                <elevationrange>
49
                    <_range>
50
                        <from>
51
                            <_units>
52
                                <default>m</default>
53
                                <to>m</to>
54
                                <to></to>
55
                                <value>
56
                                    <_rangeStart>
79 57
                                        <value>
80 58
                                            <_replace>
81 59
                                                <\bca\.?></\bca\.?>
82 60
                                                <value>$MinimumElevationInMeter</value>
83 61
                                            </_replace>
84 62
                                        </value>
85
                                    </_rangeEnd>
86
                                </2>
87
                            </_alt>
88
                        </value>
89
                    </_units>
90
                </to>
91
            </_range>
92
        </elevationrange>
93
        <locationdetermination>
94
            <latitude>
95
                <_alt>
96
                    <1>
97
                        <_nullIf>
98
                            <null>0</null>
99
                            <type>float</type>
100
                            <value>$DecimalLatitude</value>
101
                        </_nullIf>
102
                    </1>
103
                    <2>
104
                        <_nullIf>
105
                            <null>0</null>
106
                            <type>float</type>
107
                            <value>$VerbatimLatitude</value>
108
                        </_nullIf>
109
                    </2>
110
                </_alt>
111
            </latitude>
112
            <longitude>
113
                <_alt>
114
                    <1>
115
                        <_nullIf>
116
                            <null>0</null>
117
                            <type>float</type>
118
                            <value>$DecimalLongitude</value>
119
                        </_nullIf>
120
                    </1>
121
                    <2>
122
                        <_nullIf>
123
                            <null>0</null>
124
                            <type>float</type>
125
                            <value>$VerbatimLongitude</value>
126
                        </_nullIf>
127
                    </2>
128
                </_alt>
129
            </longitude>
130
            <namedplace_id>
131
                <_simplifyPath>
132
                    <next>parent_id</next>
133
                    <path>
134
                        <namedplace>
135
                            <rank>county</rank>
136
                            <placename>$County</placename>
137
                            <parent_id>
63
                                    </_rangeStart>
64
                                </value>
65
                            </_units>
66
                        </from>
67
                        <to>
68
                            <_units>
69
                                <default>m</default>
70
                                <to>m</to>
71
                                <to></to>
72
                                <value>
73
                                    <_alt>
74
                                        <1>
75
                                            <_replace>
76
                                                <\bca\.?></\bca\.?>
77
                                                <value>$MaximumElevationInMeter</value>
78
                                            </_replace>
79
                                        </1>
80
                                        <2>
81
                                            <_rangeEnd>
82
                                                <value>
83
                                                    <_replace>
84
                                                        <\bca\.?></\bca\.?>
85
                                                        <value>$MinimumElevationInMeter</value>
86
                                                    </_replace>
87
                                                </value>
88
                                            </_rangeEnd>
89
                                        </2>
90
                                    </_alt>
91
                                </value>
92
                            </_units>
93
                        </to>
94
                    </_range>
95
                </elevationrange>
96
                <locationdetermination>
97
                    <latitude>
98
                        <_alt>
99
                            <1>
100
                                <_nullIf>
101
                                    <null>0</null>
102
                                    <type>float</type>
103
                                    <value>$DecimalLatitude</value>
104
                                </_nullIf>
105
                            </1>
106
                            <2>
107
                                <_nullIf>
108
                                    <null>0</null>
109
                                    <type>float</type>
110
                                    <value>$VerbatimLatitude</value>
111
                                </_nullIf>
112
                            </2>
113
                        </_alt>
114
                    </latitude>
115
                    <longitude>
116
                        <_alt>
117
                            <1>
118
                                <_nullIf>
119
                                    <null>0</null>
120
                                    <type>float</type>
121
                                    <value>$DecimalLongitude</value>
122
                                </_nullIf>
123
                            </1>
124
                            <2>
125
                                <_nullIf>
126
                                    <null>0</null>
127
                                    <type>float</type>
128
                                    <value>$VerbatimLongitude</value>
129
                                </_nullIf>
130
                            </2>
131
                        </_alt>
132
                    </longitude>
133
                    <namedplace_id>
134
                        <_simplifyPath>
135
                            <next>parent_id</next>
136
                            <path>
138 137
                                <namedplace>
139
                                    <rank>stateProvince</rank>
140
                                    <placename>$StateProvince</placename>
138
                                    <rank>county</rank>
139
                                    <placename>$County</placename>
141 140
                                    <parent_id>
142 141
                                        <namedplace>
143
                                            <rank>country</rank>
144
                                            <placename>$Country</placename>
142
                                            <rank>stateProvince</rank>
143
                                            <placename>$StateProvince</placename>
144
                                            <parent_id>
145
                                                <namedplace>
146
                                                    <rank>country</rank>
147
                                                    <placename>$Country</placename>
148
                                                </namedplace>
149
                                            </parent_id>
145 150
                                        </namedplace>
146 151
                                    </parent_id>
147 152
                                </namedplace>
148
                            </parent_id>
149
                        </namedplace>
150
                    </path>
151
                </_simplifyPath>
152
            </namedplace_id>
153
        </locationdetermination>
154
        <locationevent>
155
            <taxonoccurrence>
156
                <aggregateoccurrence>
157
                    <collectiondate><_date><date>$LatestDateCollected</date></_date></collectiondate>
158
                    <plantobservation>
159
                        <specimenreplicate>
160
                            <catalognumber_dwc>$CatalogNO</catalognumber_dwc>
161
                            <collectioncode_dwc>$CollectionCD</collectioncode_dwc>
162
                            <institution_id><party><organizationname>$InstitutionCD</organizationname></party></institution_id>
163
                        </specimenreplicate>
164
                    </plantobservation>
165
                </aggregateoccurrence>
166
                <authortaxoncode>
167
                    <_alt>
168
                        <1>$ScientificNameOriginal</1>
169
                        <2>$ScientificName</2>
170
                    </_alt>
171
                </authortaxoncode>
172
                <taxondetermination>
173
                    <party_id>
174
                        <party>
175
                            <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
176
                            <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
177
                            <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
178
                        </party>
179
                    </party_id>
180
                    <plantconcept_id>
181
                        <plantconcept>
182
                            <plantname_id>
183
                                <_simplifyPath>
184
                                    <next>parent_id</next>
185
                                    <path>
186
                                        <plantname>
187
                                            <rank>binomial</rank>
188
                                            <plantname>$ScientificName</plantname>
189
                                            <parent_id>
153
                            </path>
154
                        </_simplifyPath>
155
                    </namedplace_id>
156
                </locationdetermination>
157
                <locationevent>
158
                    <taxonoccurrence>
159
                        <aggregateoccurrence>
160
                            <collectiondate><_date><date>$LatestDateCollected</date></_date></collectiondate>
161
                            <plantobservation>
162
                                <specimenreplicate>
163
                                    <catalognumber_dwc>$CatalogNO</catalognumber_dwc>
164
                                    <collectioncode_dwc>$CollectionCD</collectioncode_dwc>
165
                                    <institution_id><party><organizationname>$InstitutionCD</organizationname></party></institution_id>
166
                                </specimenreplicate>
167
                            </plantobservation>
168
                        </aggregateoccurrence>
169
                        <authortaxoncode>
170
                            <_alt>
171
                                <1>$ScientificNameOriginal</1>
172
                                <2>$ScientificName</2>
173
                            </_alt>
174
                        </authortaxoncode>
175
                        <taxondetermination>
176
                            <party_id>
177
                                <party>
178
                                    <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
179
                                    <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
180
                                    <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
181
                                </party>
182
                            </party_id>
183
                            <plantconcept_id>
184
                                <plantconcept>
185
                                    <plantname_id>
186
                                        <_simplifyPath>
187
                                            <next>parent_id</next>
188
                                            <path>
190 189
                                                <plantname>
191
                                                    <rank>authority</rank>
192
                                                    <plantname>$AuthorOfScientificName</plantname>
190
                                                    <rank>binomial</rank>
191
                                                    <plantname>$ScientificName</plantname>
193 192
                                                    <parent_id>
194 193
                                                        <plantname>
195
                                                            <rank>subspecies</rank>
196
                                                            <plantname>$InfraspecificEpithet</plantname>
194
                                                            <rank>authority</rank>
195
                                                            <plantname>$AuthorOfScientificName</plantname>
197 196
                                                            <parent_id>
198 197
                                                                <plantname>
199
                                                                    <rank>species</rank>
200
                                                                    <plantname>$SpecificEpithet</plantname>
198
                                                                    <rank>subspecies</rank>
199
                                                                    <plantname>$InfraspecificEpithet</plantname>
201 200
                                                                    <parent_id>
202 201
                                                                        <plantname>
203
                                                                            <rank>genus</rank>
204
                                                                            <plantname>$Genus</plantname>
202
                                                                            <rank>species</rank>
203
                                                                            <plantname>$SpecificEpithet</plantname>
205 204
                                                                            <parent_id>
206 205
                                                                                <plantname>
207
                                                                                    <rank>family</rank>
208
                                                                                    <plantname>$Family</plantname>
206
                                                                                    <rank>genus</rank>
207
                                                                                    <plantname>$Genus</plantname>
208
                                                                                    <parent_id>
209
                                                                                        <plantname>
210
                                                                                            <rank>family</rank>
211
                                                                                            <plantname>$Family</plantname>
212
                                                                                        </plantname>
213
                                                                                    </parent_id>
209 214
                                                                                </plantname>
210 215
                                                                            </parent_id>
211 216
                                                                        </plantname>
......
215 220
                                                        </plantname>
216 221
                                                    </parent_id>
217 222
                                                </plantname>
218
                                            </parent_id>
219
                                        </plantname>
220
                                    </path>
221
                                </_simplifyPath>
222
                            </plantname_id>
223
                        </plantconcept>
224
                    </plantconcept_id>
225
                </taxondetermination>
226
                <taxondetermination>
227
                    <isoriginal>true</isoriginal>
228
                    <plantconcept_id>
229
                        <plantconcept>
230
                            <plantname_id>
231
                                <_simplifyPath>
232
                                    <next>parent_id</next>
233
                                    <path>
234
                                        <plantname>
235
                                            <rank>binomial</rank>
236
                                            <plantname>$ScientificNameOriginal</plantname>
237
                                            <parent_id>
223
                                            </path>
224
                                        </_simplifyPath>
225
                                    </plantname_id>
226
                                </plantconcept>
227
                            </plantconcept_id>
228
                        </taxondetermination>
229
                        <taxondetermination>
230
                            <isoriginal>true</isoriginal>
231
                            <plantconcept_id>
232
                                <plantconcept>
233
                                    <plantname_id>
234
                                        <_simplifyPath>
235
                                            <next>parent_id</next>
236
                                            <path>
238 237
                                                <plantname>
239
                                                    <rank>authority</rank>
238
                                                    <rank>binomial</rank>
239
                                                    <plantname>$ScientificNameOriginal</plantname>
240 240
                                                    <parent_id>
241 241
                                                        <plantname>
242
                                                            <rank>subspecies</rank>
242
                                                            <rank>authority</rank>
243 243
                                                            <parent_id>
244 244
                                                                <plantname>
245
                                                                    <rank>species</rank>
245
                                                                    <rank>subspecies</rank>
246 246
                                                                    <parent_id>
247 247
                                                                        <plantname>
248
                                                                            <rank>genus</rank>
249
                                                                            <plantname>$GBIFGenusOriginal</plantname>
248
                                                                            <rank>species</rank>
250 249
                                                                            <parent_id>
251 250
                                                                                <plantname>
252
                                                                                    <rank>family</rank>
253
                                                                                    <plantname>$GBIFFamilyOriginal</plantname>
251
                                                                                    <rank>genus</rank>
252
                                                                                    <plantname>$GBIFGenusOriginal</plantname>
253
                                                                                    <parent_id>
254
                                                                                        <plantname>
255
                                                                                            <rank>family</rank>
256
                                                                                            <plantname>$GBIFFamilyOriginal</plantname>
257
                                                                                        </plantname>
258
                                                                                    </parent_id>
254 259
                                                                                </plantname>
255 260
                                                                            </parent_id>
256 261
                                                                        </plantname>
......
260 265
                                                        </plantname>
261 266
                                                    </parent_id>
262 267
                                                </plantname>
263
                                            </parent_id>
264
                                        </plantname>
265
                                    </path>
266
                                </_simplifyPath>
267
                            </plantname_id>
268
                        </plantconcept>
269
                    </plantconcept_id>
270
                </taxondetermination>
271
                <verbatimcollectorname>$Collector</verbatimcollectorname>
272
            </taxonoccurrence>
273
        </locationevent>
274
        <locationnarrative>$Locality</locationnarrative>
275
    </location>
268
                                            </path>
269
                                        </_simplifyPath>
270
                                    </plantname_id>
271
                                </plantconcept>
272
                            </plantconcept_id>
273
                        </taxondetermination>
274
                        <verbatimcollectorname>$Collector</verbatimcollectorname>
275
                    </taxonoccurrence>
276
                </locationevent>
277
                <locationnarrative>$Locality</locationnarrative>
278
            </location>
279
        </path>
280
    </_simplifyPath>
276 281
</VegBIEN>
277 282
Inserted 37 new rows into database

Also available in: Unified diff