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
        <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
5 6
            <location>
6
                <authorlocationcode>$plot_code</authorlocationcode>
7
                <sourceaccessioncode>$PLOT_ID</sourceaccessioncode>
8
            </location>
9
        </parent_id>
10
        <authorlocationcode>$subplot</authorlocationcode>
11
        <locationevent>
12
            <obsenddate><_date><date><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></date></_date></obsenddate>
13
            <obsstartdate><_date><date><_dateRangeStart><value>$census_date</value></_dateRangeStart></date></_date></obsstartdate>
14
            <taxonoccurrence>
15
                <aggregateoccurrence>
16
                    <count>$no_of_individuals</count>
17
                    <cover>$cover_percent</cover>
18
                    <definedvalue fkey="tablerecord_id">
19
                        <userdefined_id>
20
                            <userdefined>
21
                                <tablename>aggregateoccurrence</tablename>
22
                                <userdefinedname>censusNo</userdefinedname>
23
                            </userdefined>
24
                        </userdefined_id>
25
                        <definedvalue>$census_no</definedvalue>
26
                    </definedvalue>
27
                    <linecover>$intercept_cm</linecover>
28
                    <plantobservation>
29
                        <collectionnumber>$individual_code</collectionnumber>
30
                        <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
31
                        <specimenreplicate>
32
                            <catalognumber_dwc>
33
                                <_if name="if indirect voucher">
34
                                    <cond>
35
                                        <_eq>
36
                                            <right>indirect</right>
37
                                            <left>$det_type</left>
38
                                        </_eq>
39
                                    </cond>
40
                                    <else>
41
                                        <_alt>
42
                                            <1>$coll_number</1>
43
                                            <2>$voucher_string</2>
44
                                        </_alt>
45
                                    </else>
46
                                </_if>
47
                            </catalognumber_dwc>
48
                        </specimenreplicate>
49
                        <stemobservation>
50
                            <basaldiameter>$basal_diam</basaldiameter>
7
                <parent_id>
8
                    <location>
9
                        <authorlocationcode>$plot_code</authorlocationcode>
10
                        <sourceaccessioncode>$PLOT_ID</sourceaccessioncode>
11
                    </location>
12
                </parent_id>
13
                <authorlocationcode>$subplot</authorlocationcode>
14
                <locationevent>
15
                    <obsenddate><_date><date><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></date></_date></obsenddate>
16
                    <obsstartdate><_date><date><_dateRangeStart><value>$census_date</value></_dateRangeStart></date></_date></obsstartdate>
17
                    <taxonoccurrence>
18
                        <aggregateoccurrence>
19
                            <count>$no_of_individuals</count>
20
                            <cover>$cover_percent</cover>
51 21
                            <definedvalue fkey="tablerecord_id">
52 22
                                <userdefined_id>
53 23
                                    <userdefined>
54
                                        <tablename>stemobservation</tablename>
55
                                        <userdefinedname>canopyForm</userdefinedname>
24
                                        <tablename>aggregateoccurrence</tablename>
25
                                        <userdefinedname>censusNo</userdefinedname>
56 26
                                    </userdefined>
57 27
                                </userdefined_id>
58
                                <definedvalue>$stem_canopy_form</definedvalue>
28
                                <definedvalue>$census_no</definedvalue>
59 29
                            </definedvalue>
60
                            <definedvalue fkey="tablerecord_id">
61
                                <userdefined_id>
62
                                    <userdefined>
63
                                        <tablename>stemobservation</tablename>
64
                                        <userdefinedname>canopyPosition</userdefinedname>
65
                                    </userdefined>
66
                                </userdefined_id>
67
                                <definedvalue>$stem_canopy_position</definedvalue>
68
                            </definedvalue>
69
                            <definedvalue fkey="tablerecord_id">
70
                                <userdefined_id>
71
                                    <userdefined>
72
                                        <tablename>stemobservation</tablename>
73
                                        <userdefinedname>lianaInfestation</userdefinedname>
74
                                    </userdefined>
75
                                </userdefined_id>
76
                                <definedvalue>$stem_liana_infestation</definedvalue>
77
                            </definedvalue>
78
                            <definedvalue fkey="tablerecord_id">
79
                                <userdefined_id>
80
                                    <userdefined>
81
                                        <tablename>stemobservation</tablename>
82
                                        <userdefinedname>notes</userdefinedname>
83
                                    </userdefined>
84
                                </userdefined_id>
85
                                <definedvalue>$notes</definedvalue>
86
                            </definedvalue>
87
                            <diameterbreastheight>$stem_dbh</diameterbreastheight>
88
                            <height>
89
                                <_alt>
90
                                    <1>$stem_height_m</1>
91
                                    <2>$height_m</2>
92
                                </_alt>
93
                            </height>
94
                            <heightfirstbranch>
95
                                <_alt>
96
                                    <0>$ht_first_branch_m</0>
97
                                    <1>$stem_height_first_branch_m</1>
98
                                </_alt>
99
                            </heightfirstbranch>
100
                            <stemtag>
101
                                <iscurrent>
102
                                    <_alt>
103
                                        <2>true</2>
104
                                        <1>false</1>
105
                                    </_alt>
106
                                </iscurrent>
107
                                <tag>
108
                                    <_alt>
109
                                        <1>$tag1</1>
110
                                        <2>$stem_tag1</2>
111
                                    </_alt>
112
                                </tag>
113
                            </stemtag>
114
                            <stemtag>
115
                                <iscurrent>true</iscurrent>
116
                                <tag>
117
                                    <_alt>
118
                                        <1>$tag2</1>
119
                                        <2>$stem_tag2</2>
120
                                    </_alt>
121
                                </tag>
122
                            </stemtag>
123
                            <xposition>$x_position</xposition>
124
                            <yposition>$y_position</yposition>
125
                        </stemobservation>
126
                    </plantobservation>
127
                </aggregateoccurrence>
128
                <authortaxoncode>$individual_code</authortaxoncode>
129
                <growthform>
130
                    <_map>
131
                        <T>tree</T>
132
                        <Arbol>tree</Arbol>
133
                        <palm>tree</palm>
134
                        <H>hemiepiphyte</H>
135
                        <Hemiepífito>hemiepiphyte</Hemiepífito>
136
                        <L>liana</L>
137
                        <l>liana</l>
138
                        <L?>liana</L?>
139
                        <Liana>liana</Liana>
140
                        <E>epiphyte</E>
141
                        <S>shrub</S>
142
                        <Hb>herb</Hb>
143
                        <vine-herbaceous>vine</vine-herbaceous>
144
                        <graminoid>grass</graminoid>
145
                        <rosette>forb</rosette>
146
                        <*>*</*>
147
                        <value>$habit</value>
148
                    </_map>
149
                </growthform>
150
                <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
151
                <taxondetermination>
152
                    <plantconcept_id>
153
                        <plantconcept>
154
                            <plantname_id>
155
                                <_simplifyPath>
156
                                    <next>parent_id</next>
157
                                    <path>
158
                                        <plantname>
159
                                            <rank>binomial</rank>
160
                                            <parent_id>
30
                            <linecover>$intercept_cm</linecover>
31
                            <plantobservation>
32
                                <collectionnumber>$individual_code</collectionnumber>
33
                                <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
34
                                <specimenreplicate>
35
                                    <catalognumber_dwc>
36
                                        <_if name="if indirect voucher">
37
                                            <cond>
38
                                                <_eq>
39
                                                    <right>indirect</right>
40
                                                    <left>$det_type</left>
41
                                                </_eq>
42
                                            </cond>
43
                                            <else>
44
                                                <_alt>
45
                                                    <1>$coll_number</1>
46
                                                    <2>$voucher_string</2>
47
                                                </_alt>
48
                                            </else>
49
                                        </_if>
50
                                    </catalognumber_dwc>
51
                                </specimenreplicate>
52
                                <stemobservation>
53
                                    <basaldiameter>$basal_diam</basaldiameter>
54
                                    <definedvalue fkey="tablerecord_id">
55
                                        <userdefined_id>
56
                                            <userdefined>
57
                                                <tablename>stemobservation</tablename>
58
                                                <userdefinedname>canopyForm</userdefinedname>
59
                                            </userdefined>
60
                                        </userdefined_id>
61
                                        <definedvalue>$stem_canopy_form</definedvalue>
62
                                    </definedvalue>
63
                                    <definedvalue fkey="tablerecord_id">
64
                                        <userdefined_id>
65
                                            <userdefined>
66
                                                <tablename>stemobservation</tablename>
67
                                                <userdefinedname>canopyPosition</userdefinedname>
68
                                            </userdefined>
69
                                        </userdefined_id>
70
                                        <definedvalue>$stem_canopy_position</definedvalue>
71
                                    </definedvalue>
72
                                    <definedvalue fkey="tablerecord_id">
73
                                        <userdefined_id>
74
                                            <userdefined>
75
                                                <tablename>stemobservation</tablename>
76
                                                <userdefinedname>lianaInfestation</userdefinedname>
77
                                            </userdefined>
78
                                        </userdefined_id>
79
                                        <definedvalue>$stem_liana_infestation</definedvalue>
80
                                    </definedvalue>
81
                                    <definedvalue fkey="tablerecord_id">
82
                                        <userdefined_id>
83
                                            <userdefined>
84
                                                <tablename>stemobservation</tablename>
85
                                                <userdefinedname>notes</userdefinedname>
86
                                            </userdefined>
87
                                        </userdefined_id>
88
                                        <definedvalue>$notes</definedvalue>
89
                                    </definedvalue>
90
                                    <diameterbreastheight>$stem_dbh</diameterbreastheight>
91
                                    <height>
92
                                        <_alt>
93
                                            <1>$stem_height_m</1>
94
                                            <2>$height_m</2>
95
                                        </_alt>
96
                                    </height>
97
                                    <heightfirstbranch>
98
                                        <_alt>
99
                                            <0>$ht_first_branch_m</0>
100
                                            <1>$stem_height_first_branch_m</1>
101
                                        </_alt>
102
                                    </heightfirstbranch>
103
                                    <stemtag>
104
                                        <iscurrent>
105
                                            <_alt>
106
                                                <2>true</2>
107
                                                <1>false</1>
108
                                            </_alt>
109
                                        </iscurrent>
110
                                        <tag>
111
                                            <_alt>
112
                                                <1>$tag1</1>
113
                                                <2>$stem_tag1</2>
114
                                            </_alt>
115
                                        </tag>
116
                                    </stemtag>
117
                                    <stemtag>
118
                                        <iscurrent>true</iscurrent>
119
                                        <tag>
120
                                            <_alt>
121
                                                <1>$tag2</1>
122
                                                <2>$stem_tag2</2>
123
                                            </_alt>
124
                                        </tag>
125
                                    </stemtag>
126
                                    <xposition>$x_position</xposition>
127
                                    <yposition>$y_position</yposition>
128
                                </stemobservation>
129
                            </plantobservation>
130
                        </aggregateoccurrence>
131
                        <authortaxoncode>$individual_code</authortaxoncode>
132
                        <growthform>
133
                            <_map>
134
                                <T>tree</T>
135
                                <Arbol>tree</Arbol>
136
                                <palm>tree</palm>
137
                                <H>hemiepiphyte</H>
138
                                <Hemiepífito>hemiepiphyte</Hemiepífito>
139
                                <L>liana</L>
140
                                <l>liana</l>
141
                                <L?>liana</L?>
142
                                <Liana>liana</Liana>
143
                                <E>epiphyte</E>
144
                                <S>shrub</S>
145
                                <Hb>herb</Hb>
146
                                <vine-herbaceous>vine</vine-herbaceous>
147
                                <graminoid>grass</graminoid>
148
                                <rosette>forb</rosette>
149
                                <*>*</*>
150
                                <value>$habit</value>
151
                            </_map>
152
                        </growthform>
153
                        <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
154
                        <taxondetermination>
155
                            <plantconcept_id>
156
                                <plantconcept>
157
                                    <plantname_id>
158
                                        <_simplifyPath>
159
                                            <next>parent_id</next>
160
                                            <path>
161 161
                                                <plantname>
162
                                                    <rank>authority</rank>
163
                                                    <plantname>$specific_authority</plantname>
162
                                                    <rank>binomial</rank>
164 163
                                                    <parent_id>
165 164
                                                        <plantname>
166
                                                            <rank>subspecies</rank>
167
                                                            <plantname>
168
                                                                <_name>
169
                                                                    <first>$infra_rank_1</first>
170
                                                                    <last>$infra_ep_1</last>
171
                                                                </_name>
172
                                                            </plantname>
165
                                                            <rank>authority</rank>
166
                                                            <plantname>$specific_authority</plantname>
173 167
                                                            <parent_id>
174 168
                                                                <plantname>
175
                                                                    <rank>species</rank>
176
                                                                    <plantname>$specific_epithet</plantname>
169
                                                                    <rank>subspecies</rank>
170
                                                                    <plantname>
171
                                                                        <_name>
172
                                                                            <first>$infra_rank_1</first>
173
                                                                            <last>$infra_ep_1</last>
174
                                                                        </_name>
175
                                                                    </plantname>
177 176
                                                                    <parent_id>
178 177
                                                                        <plantname>
179
                                                                            <rank>genus</rank>
180
                                                                            <plantname>$genus</plantname>
178
                                                                            <rank>species</rank>
179
                                                                            <plantname>$specific_epithet</plantname>
181 180
                                                                            <parent_id>
182 181
                                                                                <plantname>
183
                                                                                    <rank>family</rank>
184
                                                                                    <plantname>$family</plantname>
182
                                                                                    <rank>genus</rank>
183
                                                                                    <plantname>$genus</plantname>
184
                                                                                    <parent_id>
185
                                                                                        <plantname>
186
                                                                                            <rank>family</rank>
187
                                                                                            <plantname>$family</plantname>
188
                                                                                        </plantname>
189
                                                                                    </parent_id>
185 190
                                                                                </plantname>
186 191
                                                                            </parent_id>
187 192
                                                                        </plantname>
......
191 196
                                                        </plantname>
192 197
                                                    </parent_id>
193 198
                                                </plantname>
194
                                            </parent_id>
195
                                        </plantname>
196
                                    </path>
197
                                </_simplifyPath>
198
                            </plantname_id>
199
                        </plantconcept>
200
                    </plantconcept_id>
201
                    <taxonfit>$cf_aff</taxonfit>
202
                </taxondetermination>
203
                <taxondetermination>
204
                    <isoriginal>true</isoriginal>
205
                    <plantconcept_id>
206
                        <plantconcept>
207
                            <plantname_id>
208
                                <_simplifyPath>
209
                                    <next>parent_id</next>
210
                                    <path>
211
                                        <plantname>
212
                                            <rank>binomial</rank>
213
                                            <parent_id>
199
                                            </path>
200
                                        </_simplifyPath>
201
                                    </plantname_id>
202
                                </plantconcept>
203
                            </plantconcept_id>
204
                            <taxonfit>$cf_aff</taxonfit>
205
                        </taxondetermination>
206
                        <taxondetermination>
207
                            <isoriginal>true</isoriginal>
208
                            <plantconcept_id>
209
                                <plantconcept>
210
                                    <plantname_id>
211
                                        <_simplifyPath>
212
                                            <next>parent_id</next>
213
                                            <path>
214 214
                                                <plantname>
215
                                                    <rank>authority</rank>
215
                                                    <rank>binomial</rank>
216 216
                                                    <parent_id>
217 217
                                                        <plantname>
218
                                                            <rank>subspecies</rank>
218
                                                            <rank>authority</rank>
219 219
                                                            <parent_id>
220 220
                                                                <plantname>
221
                                                                    <rank>species</rank>
222
                                                                    <plantname>$orig_species</plantname>
221
                                                                    <rank>subspecies</rank>
223 222
                                                                    <parent_id>
224 223
                                                                        <plantname>
225
                                                                            <rank>genus</rank>
224
                                                                            <rank>species</rank>
225
                                                                            <plantname>$orig_species</plantname>
226 226
                                                                            <parent_id>
227 227
                                                                                <plantname>
228
                                                                                    <rank>family</rank>
229
                                                                                    <plantname>$orig_family</plantname>
228
                                                                                    <rank>genus</rank>
229
                                                                                    <parent_id>
230
                                                                                        <plantname>
231
                                                                                            <rank>family</rank>
232
                                                                                            <plantname>$orig_family</plantname>
233
                                                                                        </plantname>
234
                                                                                    </parent_id>
230 235
                                                                                </plantname>
231 236
                                                                            </parent_id>
232 237
                                                                        </plantname>
......
236 241
                                                        </plantname>
237 242
                                                    </parent_id>
238 243
                                                </plantname>
239
                                            </parent_id>
240
                                        </plantname>
241
                                    </path>
242
                                </_simplifyPath>
243
                            </plantname_id>
244
                        </plantconcept>
245
                    </plantconcept_id>
246
                </taxondetermination>
247
                <verbatimcollectorname>
248
                    <_name>
249
                        <first>$coll_firstname</first>
250
                        <last>$coll_lastname</last>
251
                    </_name>
252
                </verbatimcollectorname>
253
                <voucher>
254
                    <specimenreplicate_id>
255
                        <specimenreplicate>
256
                            <catalognumber_dwc>
257
                                <_if name="if indirect voucher">
258
                                    <cond>
259
                                        <_eq>
260
                                            <right>indirect</right>
261
                                            <left>$det_type</left>
262
                                        </_eq>
263
                                    </cond>
264
                                    <then>
265
                                        <_alt>
266
                                            <1>$coll_number</1>
267
                                            <2>$voucher_string</2>
268
                                        </_alt>
269
                                    </then>
270
                                </_if>
271
                            </catalognumber_dwc>
272
                        </specimenreplicate>
273
                    </specimenreplicate_id>
274
                </voucher>
275
            </taxonoccurrence>
276
        </locationevent>
277
    </location>
244
                                            </path>
245
                                        </_simplifyPath>
246
                                    </plantname_id>
247
                                </plantconcept>
248
                            </plantconcept_id>
249
                        </taxondetermination>
250
                        <verbatimcollectorname>
251
                            <_name>
252
                                <first>$coll_firstname</first>
253
                                <last>$coll_lastname</last>
254
                            </_name>
255
                        </verbatimcollectorname>
256
                        <voucher>
257
                            <specimenreplicate_id>
258
                                <specimenreplicate>
259
                                    <catalognumber_dwc>
260
                                        <_if name="if indirect voucher">
261
                                            <cond>
262
                                                <_eq>
263
                                                    <right>indirect</right>
264
                                                    <left>$det_type</left>
265
                                                </_eq>
266
                                            </cond>
267
                                            <then>
268
                                                <_alt>
269
                                                    <1>$coll_number</1>
270
                                                    <2>$voucher_string</2>
271
                                                </_alt>
272
                                            </then>
273
                                        </_if>
274
                                    </catalognumber_dwc>
275
                                </specimenreplicate>
276
                            </specimenreplicate_id>
277
                        </voucher>
278
                    </taxonoccurrence>
279
                </locationevent>
280
            </location>
281
        </path>
282
    </_simplifyPath>
278 283
</VegBIEN>
279 284
Inserted 51 new rows into database

Also available in: Unified diff