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>$InstitutionCode</1>
7
                <2>$CollectionCode</2>
8
                <3>$CatalogNumber</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>$MaximumElevation</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>$InstitutionCode</1>
10
                        <2>$CollectionCode</2>
11
                        <3>$CatalogNumber</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>$MinimumElevation</value>
24
                                        <value>$MaximumElevation</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>$MinimumElevation</value>
58
                                    </_replace>
35
                                    <_rangeStart>
36
                                        <value>
37
                                            <_replace>
38
                                                <\bca\.?></\bca\.?>
39
                                                <value>$MinimumElevation</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>$MaximumElevation</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>$MinimumElevation</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
                <_nullIf>
96
                    <null>0</null>
97
                    <type>float</type>
98
                    <value>$latitude</value>
99
                </_nullIf>
100
            </latitude>
101
            <longitude>
102
                <_nullIf>
103
                    <null>0</null>
104
                    <type>float</type>
105
                    <value>$longitude</value>
106
                </_nullIf>
107
            </longitude>
108
            <namedplace_id>
109
                <_simplifyPath>
110
                    <next>parent_id</next>
111
                    <path>
112
                        <namedplace>
113
                            <rank>county</rank>
114
                            <placename>$County</placename>
115
                            <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>$MaximumElevation</value>
78
                                            </_replace>
79
                                        </1>
80
                                        <2>
81
                                            <_rangeEnd>
82
                                                <value>
83
                                                    <_replace>
84
                                                        <\bca\.?></\bca\.?>
85
                                                        <value>$MinimumElevation</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
                        <_nullIf>
99
                            <null>0</null>
100
                            <type>float</type>
101
                            <value>$latitude</value>
102
                        </_nullIf>
103
                    </latitude>
104
                    <longitude>
105
                        <_nullIf>
106
                            <null>0</null>
107
                            <type>float</type>
108
                            <value>$longitude</value>
109
                        </_nullIf>
110
                    </longitude>
111
                    <namedplace_id>
112
                        <_simplifyPath>
113
                            <next>parent_id</next>
114
                            <path>
116 115
                                <namedplace>
117
                                    <rank>stateProvince</rank>
118
                                    <placename>$StateProvince</placename>
116
                                    <rank>county</rank>
117
                                    <placename>$County</placename>
119 118
                                    <parent_id>
120 119
                                        <namedplace>
121
                                            <rank>country</rank>
122
                                            <placename>$Country</placename>
120
                                            <rank>stateProvince</rank>
121
                                            <placename>$StateProvince</placename>
123 122
                                            <parent_id>
124 123
                                                <namedplace>
125
                                                    <rank>continent</rank>
126
                                                    <placename>$ContinentOcean</placename>
124
                                                    <rank>country</rank>
125
                                                    <placename>$Country</placename>
126
                                                    <parent_id>
127
                                                        <namedplace>
128
                                                            <rank>continent</rank>
129
                                                            <placename>$ContinentOcean</placename>
130
                                                        </namedplace>
131
                                                    </parent_id>
127 132
                                                </namedplace>
128 133
                                            </parent_id>
129 134
                                        </namedplace>
130 135
                                    </parent_id>
131 136
                                </namedplace>
132
                            </parent_id>
133
                        </namedplace>
134
                    </path>
135
                </_simplifyPath>
136
            </namedplace_id>
137
        </locationdetermination>
138
        <locationevent>
139
            <taxonoccurrence>
140
                <aggregateoccurrence>
141
                    <collectiondate>
142
                        <_date>
143
                            <day>
144
                                <_nullIf>
145
                                    <null>0</null>
146
                                    <type>float</type>
147
                                    <value>$DayCollected</value>
148
                                </_nullIf>
149
                            </day>
150
                            <month>
151
                                <_nullIf>
152
                                    <null>0</null>
153
                                    <type>float</type>
154
                                    <value>$MonthCollected</value>
155
                                </_nullIf>
156
                            </month>
157
                            <year>
158
                                <_nullIf>
159
                                    <null>0</null>
160
                                    <type>float</type>
161
                                    <value>$YearCollected</value>
162
                                </_nullIf>
163
                            </year>
164
                        </_date>
165
                    </collectiondate>
166
                    <count>$IndividualCount</count>
167
                    <notes>
168
                        <_alt>
169
                            <0>$convertednotes</0>
170
                            <1>$notes</1>
171
                        </_alt>
172
                    </notes>
173
                    <plantobservation>
174
                        <collectionnumber>$CollectorNumber</collectionnumber>
175
                        <specimenreplicate>
176
                            <catalognumber_dwc>$CatalogNumber</catalognumber_dwc>
177
                            <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
178
                            <institution_id><party><organizationname>$InstitutionCode</organizationname></party></institution_id>
179
                        </specimenreplicate>
180
                    </plantobservation>
181
                </aggregateoccurrence>
182
                <authortaxoncode>
183
                    <_alt>
184
                        <1>$CollectorNumber</1>
185
                        <2>$ScientificName</2>
186
                    </_alt>
187
                </authortaxoncode>
188
                <taxondetermination>
189
                    <party_id>
190
                        <party>
191
                            <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
192
                            <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
193
                            <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
194
                        </party>
195
                    </party_id>
196
                    <plantconcept_id>
197
                        <plantconcept>
198
                            <plantname_id>
199
                                <_simplifyPath>
200
                                    <next>parent_id</next>
201
                                    <path>
202
                                        <plantname>
203
                                            <rank>binomial</rank>
204
                                            <plantname>$ScientificName</plantname>
205
                                            <parent_id>
137
                            </path>
138
                        </_simplifyPath>
139
                    </namedplace_id>
140
                </locationdetermination>
141
                <locationevent>
142
                    <taxonoccurrence>
143
                        <aggregateoccurrence>
144
                            <collectiondate>
145
                                <_date>
146
                                    <day>
147
                                        <_nullIf>
148
                                            <null>0</null>
149
                                            <type>float</type>
150
                                            <value>$DayCollected</value>
151
                                        </_nullIf>
152
                                    </day>
153
                                    <month>
154
                                        <_nullIf>
155
                                            <null>0</null>
156
                                            <type>float</type>
157
                                            <value>$MonthCollected</value>
158
                                        </_nullIf>
159
                                    </month>
160
                                    <year>
161
                                        <_nullIf>
162
                                            <null>0</null>
163
                                            <type>float</type>
164
                                            <value>$YearCollected</value>
165
                                        </_nullIf>
166
                                    </year>
167
                                </_date>
168
                            </collectiondate>
169
                            <count>$IndividualCount</count>
170
                            <notes>
171
                                <_alt>
172
                                    <0>$convertednotes</0>
173
                                    <1>$notes</1>
174
                                </_alt>
175
                            </notes>
176
                            <plantobservation>
177
                                <collectionnumber>$CollectorNumber</collectionnumber>
178
                                <specimenreplicate>
179
                                    <catalognumber_dwc>$CatalogNumber</catalognumber_dwc>
180
                                    <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
181
                                    <institution_id><party><organizationname>$InstitutionCode</organizationname></party></institution_id>
182
                                </specimenreplicate>
183
                            </plantobservation>
184
                        </aggregateoccurrence>
185
                        <authortaxoncode>
186
                            <_alt>
187
                                <1>$CollectorNumber</1>
188
                                <2>$ScientificName</2>
189
                            </_alt>
190
                        </authortaxoncode>
191
                        <taxondetermination>
192
                            <party_id>
193
                                <party>
194
                                    <givenname><_namePart><first>$IdentifiedBy</first></_namePart></givenname>
195
                                    <middlename><_namePart><middle>$IdentifiedBy</middle></_namePart></middlename>
196
                                    <surname><_namePart><last>$IdentifiedBy</last></_namePart></surname>
197
                                </party>
198
                            </party_id>
199
                            <plantconcept_id>
200
                                <plantconcept>
201
                                    <plantname_id>
202
                                        <_simplifyPath>
203
                                            <next>parent_id</next>
204
                                            <path>
206 205
                                                <plantname>
207
                                                    <rank>authority</rank>
208
                                                    <plantname>$ScientificNameAuthor</plantname>
206
                                                    <rank>binomial</rank>
207
                                                    <plantname>$ScientificName</plantname>
209 208
                                                    <parent_id>
210 209
                                                        <plantname>
211
                                                            <rank>subspecies</rank>
212
                                                            <plantname>$Subspecies</plantname>
210
                                                            <rank>authority</rank>
211
                                                            <plantname>$ScientificNameAuthor</plantname>
213 212
                                                            <parent_id>
214 213
                                                                <plantname>
215
                                                                    <rank>species</rank>
216
                                                                    <plantname>$species</plantname>
214
                                                                    <rank>subspecies</rank>
215
                                                                    <plantname>$Subspecies</plantname>
217 216
                                                                    <parent_id>
218 217
                                                                        <plantname>
219
                                                                            <rank>genus</rank>
220
                                                                            <plantname>$genus</plantname>
218
                                                                            <rank>species</rank>
219
                                                                            <plantname>$species</plantname>
221 220
                                                                            <parent_id>
222 221
                                                                                <plantname>
223
                                                                                    <rank>family</rank>
224
                                                                                    <plantname>$family</plantname>
222
                                                                                    <rank>genus</rank>
223
                                                                                    <plantname>$genus</plantname>
225 224
                                                                                    <parent_id>
226 225
                                                                                        <plantname>
227
                                                                                            <rank>order</rank>
226
                                                                                            <rank>family</rank>
227
                                                                                            <plantname>$family</plantname>
228 228
                                                                                            <parent_id>
229 229
                                                                                                <plantname>
230
                                                                                                    <rank>class</rank>
230
                                                                                                    <rank>order</rank>
231 231
                                                                                                    <parent_id>
232 232
                                                                                                        <plantname>
233
                                                                                                            <rank>subkingdom</rank>
233
                                                                                                            <rank>class</rank>
234 234
                                                                                                            <parent_id>
235 235
                                                                                                                <plantname>
236
                                                                                                                    <rank>kingdom</rank>
237
                                                                                                                    <plantname>$Kingdom</plantname>
236
                                                                                                                    <rank>subkingdom</rank>
237
                                                                                                                    <parent_id>
238
                                                                                                                        <plantname>
239
                                                                                                                            <rank>kingdom</rank>
240
                                                                                                                            <plantname>$Kingdom</plantname>
241
                                                                                                                        </plantname>
242
                                                                                                                    </parent_id>
238 243
                                                                                                                </plantname>
239 244
                                                                                                            </parent_id>
240 245
                                                                                                        </plantname>
......
252 257
                                                        </plantname>
253 258
                                                    </parent_id>
254 259
                                                </plantname>
255
                                            </parent_id>
256
                                        </plantname>
257
                                    </path>
258
                                </_simplifyPath>
259
                            </plantname_id>
260
                        </plantconcept>
261
                    </plantconcept_id>
262
                </taxondetermination>
263
                <verbatimcollectorname>$Collector</verbatimcollectorname>
264
            </taxonoccurrence>
265
        </locationevent>
266
        <locationnarrative>$Locality</locationnarrative>
267
    </location>
260
                                            </path>
261
                                        </_simplifyPath>
262
                                    </plantname_id>
263
                                </plantconcept>
264
                            </plantconcept_id>
265
                        </taxondetermination>
266
                        <verbatimcollectorname>$Collector</verbatimcollectorname>
267
                    </taxonoccurrence>
268
                </locationevent>
269
                <locationnarrative>$Locality</locationnarrative>
270
            </location>
271
        </path>
272
    </_simplifyPath>
268 273
</VegBIEN>
269 274
Inserted 38 new rows into database

Also available in: Unified diff