Project

General

Profile

« Previous | Next » 

Revision 11107

bugfix: mappings/VegCore-VegBIEN.csv: nest all taxonoccurrences inside a stratum event, so that the parent locationevent is always fully populated before child locationevents point to it. (previously, a stub parent event was created when the child event was imported first, which blocked the fully-populated parent event from being inserted later on.) this uses auto-folding (for VegBank/CVS) and auto-forwarding (for other datasources) to prune empty stratum events for taxonoccurrences that don't have strata. (see wiki.vegpath.org/Auto-folding, wiki.vegpath.org/Auto-forwarding for more info about these normalization techniques.) note that the inserted row counts stay exactly the same for all datasources except VegBank (which was being fixed), indicating that this signficant change to the mappings did not change the semantics of the import of taxonoccurrences.

View differences:

test.xml.ref
37 37
                                    <obsstartdate><_dateRangeStart><value>$census_date</value></_dateRangeStart></obsstartdate>
38 38
                                </locationevent>
39 39
                            </parent_id>
40
                            <locationevent fkey="parent_id">
41
                                <taxonoccurrence>
42
                                    <aggregateoccurrence>
43
                                        <count>$no_of_individuals</count>
44
                                        <cover_fraction><_percent_to_fraction><value>$cover_percent</value></_percent_to_fraction></cover_fraction>
45
                                        <definedvalue fkey="tablerecord_id">
46
                                            <userdefined_id>
47
                                                <userdefined>
48
                                                    <tablename>aggregateoccurrence</tablename>
49
                                                    <userdefinedname>censusNo</userdefinedname>
50
                                                </userdefined>
51
                                            </userdefined_id>
52
                                            <definedvalue>$census_no</definedvalue>
53
                                        </definedvalue>
54
                                        <linecover_m><_cm_to_m><value>$intercept_cm</value></_cm_to_m></linecover_m>
55
                                        <plantobservation>
56
                                            <authorplantcode>$individual_code</authorplantcode>
57
                                            <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
58
                                            <specimenreplicate>
59
                                                <collectionnumber>
60
                                                    <_if name="if indirect voucher">
61
                                                        <cond>
62
                                                            <_eq>
63
                                                                <right>indirect</right>
64
                                                                <left>$det_type</left>
65
                                                            </_eq>
66
                                                        </cond>
67
                                                        <else>
68
                                                            <_alt>
69
                                                                <1>$coll_number</1>
70
                                                                <2>$voucher_string</2>
71
                                                            </_alt>
72
                                                        </else>
73
                                                    </_if>
74
                                                </collectionnumber>
75
                                            </specimenreplicate>
76
                                            <stemobservation>
77
                                                <basaldiameter_m><_cm_to_m><value>$basal_diam</value></_cm_to_m></basaldiameter_m>
78
                                                <definedvalue fkey="tablerecord_id">
79
                                                    <userdefined_id>
80
                                                        <userdefined>
81
                                                            <tablename>stemobservation</tablename>
82
                                                            <userdefinedname>canopyForm</userdefinedname>
83
                                                        </userdefined>
84
                                                    </userdefined_id>
85
                                                    <definedvalue>$stem_canopy_form</definedvalue>
86
                                                </definedvalue>
87
                                                <definedvalue fkey="tablerecord_id">
88
                                                    <userdefined_id>
89
                                                        <userdefined>
90
                                                            <tablename>stemobservation</tablename>
91
                                                            <userdefinedname>canopyPosition</userdefinedname>
92
                                                        </userdefined>
93
                                                    </userdefined_id>
94
                                                    <definedvalue>$stem_canopy_position</definedvalue>
95
                                                </definedvalue>
96
                                                <definedvalue fkey="tablerecord_id">
97
                                                    <userdefined_id>
98
                                                        <userdefined>
99
                                                            <tablename>stemobservation</tablename>
100
                                                            <userdefinedname>lianaInfestation</userdefinedname>
101
                                                        </userdefined>
102
                                                    </userdefined_id>
103
                                                    <definedvalue>$stem_liana_infestation</definedvalue>
104
                                                </definedvalue>
105
                                                <definedvalue fkey="tablerecord_id">
106
                                                    <userdefined_id>
107
                                                        <userdefined>
108
                                                            <tablename>stemobservation</tablename>
109
                                                            <userdefinedname>notes</userdefinedname>
110
                                                        </userdefined>
111
                                                    </userdefined_id>
112
                                                    <definedvalue>$notes</definedvalue>
113
                                                </definedvalue>
114
                                                <diameterbreastheight_m><_cm_to_m><value>$stem_dbh</value></_cm_to_m></diameterbreastheight_m>
115
                                                <height_m>
116
                                                    <_alt>
117
                                                        <1>$stem_height_m</1>
118
                                                        <2>$height_m</2>
119
                                                    </_alt>
120
                                                </height_m>
121
                                                <heightfirstbranch_m>
122
                                                    <_alt>
123
                                                        <0>$ht_first_branch_m</0>
124
                                                        <1>$stem_height_first_branch_m</1>
125
                                                    </_alt>
126
                                                </heightfirstbranch_m>
127
                                                <tag>
128
                                                    <_alt>
129
                                                        <1>
130
                                                            <_alt>
131
                                                                <1>$stem_tag2</1>
132
                                                                <2>$stem_tag1</2>
133
                                                            </_alt>
134
                                                        </1>
135
                                                        <2>
136
                                                            <_alt>
137
                                                                <1>$tag2</1>
138
                                                                <2>$tag1</2>
139
                                                            </_alt>
140
                                                        </2>
141
                                                    </_alt>
142
                                                </tag>
143
                                                <xposition_m>$x_position</xposition_m>
144
                                                <yposition_m>$y_position</yposition_m>
145
                                            </stemobservation>
146
                                        </plantobservation>
147
                                    </aggregateoccurrence>
148
                                    <authortaxoncode>$individual_code</authortaxoncode>
149
                                    <collector_id>
150
                                        <party>
151
                                            <fullname>
152
                                                <_join_words>
153
                                                    <1>$coll_firstname</1>
154
                                                    <2>$coll_lastname</2>
155
                                                </_join_words>
156
                                            </fullname>
157
                                        </party>
158
                                    </collector_id>
159
                                    <growthform>
160
                                        <_map>
161
                                            <T>tree</T>
162
                                            <Arbol>tree</Arbol>
163
                                            <palm>tree</palm>
164
                                            <H>hemiepiphyte</H>
165
                                            <Hemiepífito>hemiepiphyte</Hemiepífito>
166
                                            <L>liana</L>
167
                                            <l>liana</l>
168
                                            <L?>liana</L?>
169
                                            <Liana>liana</Liana>
170
                                            <E>epiphyte</E>
171
                                            <S>shrub</S>
172
                                            <Hb>herb</Hb>
173
                                            <vine-herbaceous>vine</vine-herbaceous>
174
                                            <graminoid>grass</graminoid>
175
                                            <rosette>forb</rosette>
176
                                            <*>*</*>
177
                                            <value>$habit</value>
178
                                        </_map>
179
                                    </growthform>
180
                                    <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
181
                                    <taxondetermination>
182
                                        <taxonverbatim_id>
183
                                            <taxonverbatim>
184
                                                <taxonlabel_id>
185
                                                    <taxonlabel>
186
                                                        <parent_id>
187
                                                            <taxonlabel>
188
                                                                <rank>$infra_rank_1</rank>
189
                                                                <parent_id>
190
                                                                    <taxonlabel>
191
                                                                        <rank>cultivar</rank>
192
                                                                        <parent_id>
193
                                                                            <taxonlabel>
194
                                                                                <rank>forma</rank>
195
                                                                                <parent_id>
196
                                                                                    <taxonlabel>
197
                                                                                        <rank>variety</rank>
198
                                                                                        <parent_id>
199
                                                                                            <taxonlabel>
200
                                                                                                <rank>subspecies</rank>
201
                                                                                                <parent_id>
202
                                                                                                    <taxonlabel>
203
                                                                                                        <rank>species</rank>
204
                                                                                                        <taxonepithet>$specific_epithet</taxonepithet>
205
                                                                                                        <parent_id>
206
                                                                                                            <taxonlabel>
207
                                                                                                                <rank>genus</rank>
208
                                                                                                                <taxonepithet>$genus</taxonepithet>
209
                                                                                                                <parent_id>
210
                                                                                                                    <taxonlabel>
211
                                                                                                                        <rank>family</rank>
212
                                                                                                                        <taxonepithet>$family</taxonepithet>
213
                                                                                                                    </taxonlabel>
214
                                                                                                                </parent_id>
215
                                                                                                            </taxonlabel>
216
                                                                                                        </parent_id>
217
                                                                                                    </taxonlabel>
218
                                                                                                </parent_id>
219
                                                                                            </taxonlabel>
220
                                                                                        </parent_id>
221
                                                                                    </taxonlabel>
222
                                                                                </parent_id>
223
                                                                            </taxonlabel>
224
                                                                        </parent_id>
225
                                                                    </taxonlabel>
226
                                                                </parent_id>
227
                                                                <taxonepithet>$infra_ep_1</taxonepithet>
228
                                                            </taxonlabel>
229
                                                        </parent_id>
230
                                                        <rank>$infra_rank_1</rank>
231
                                                        <taxonomicname>
232
                                                            <_merge_prefix>
233
                                                                <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
234
                                                                <value>
235
                                                                    <_join_words>
236
                                                                        <1>
237
                                                                            <_join_words>
238
                                                                                <2><_filter_genus><value>$genus</value></_filter_genus></2>
239
                                                                                <3>$specific_epithet</3>
240
                                                                                <5>
241
                                                                                    <_join_words>
242
                                                                                        <1>
243
                                                                                            <_if name="if has infraspecificEpithet">
244
                                                                                                <cond>$infra_ep_1</cond>
245
                                                                                                <then>$infra_rank_1</then>
246
                                                                                            </_if>
247
                                                                                        </1>
248
                                                                                        <2>$infra_ep_1</2>
249
                                                                                    </_join_words>
250
                                                                                </5>
251
                                                                            </_join_words>
252
                                                                        </1>
253
                                                                        <2>$specific_authority</2>
254
                                                                    </_join_words>
255
                                                                </value>
256
                                                            </_merge_prefix>
257
                                                        </taxonomicname>
258
                                                    </taxonlabel>
259
                                                </taxonlabel_id>
260
                                                <author>$specific_authority</author>
261
                                                <family>$family</family>
262
                                                <genus>$genus</genus>
263
                                                <specific_epithet>$specific_epithet</specific_epithet>
264
                                                <verbatimrank>$infra_rank_1</verbatimrank>
265
                                            </taxonverbatim>
266
                                        </taxonverbatim_id>
267
                                        <taxonfit>$cf_aff</taxonfit>
268
                                    </taxondetermination>
269
                                    <taxondetermination>
270
                                        <isoriginal>true</isoriginal>
271
                                        <taxonverbatim_id>
272
                                            <taxonverbatim>
273
                                                <family>$orig_family</family>
274
                                                <specific_epithet>$orig_species</specific_epithet>
275
                                            </taxonverbatim>
276
                                        </taxonverbatim_id>
277
                                    </taxondetermination>
278
                                    <voucher>
279
                                        <specimenreplicate_id>
280
                                            <specimenreplicate>
281
                                                <collectionnumber>
282
                                                    <_if name="if indirect voucher">
283
                                                        <cond>
284
                                                            <_eq>
285
                                                                <right>indirect</right>
286
                                                                <left>$det_type</left>
287
                                                            </_eq>
288
                                                        </cond>
289
                                                        <then>
290
                                                            <_alt>
291
                                                                <1>$coll_number</1>
292
                                                                <2>$voucher_string</2>
293
                                                            </_alt>
294
                                                        </then>
295
                                                    </_if>
296
                                                </collectionnumber>
297
                                            </specimenreplicate>
298
                                        </specimenreplicate_id>
299
                                    </voucher>
300
                                </taxonoccurrence>
301
                            </locationevent>
40 302
                            <obsenddate><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></obsenddate>
41 303
                            <obsstartdate><_dateRangeStart><value>$census_date</value></_dateRangeStart></obsstartdate>
42
                            <taxonoccurrence>
43
                                <aggregateoccurrence>
44
                                    <count>$no_of_individuals</count>
45
                                    <cover_fraction><_percent_to_fraction><value>$cover_percent</value></_percent_to_fraction></cover_fraction>
46
                                    <definedvalue fkey="tablerecord_id">
47
                                        <userdefined_id>
48
                                            <userdefined>
49
                                                <tablename>aggregateoccurrence</tablename>
50
                                                <userdefinedname>censusNo</userdefinedname>
51
                                            </userdefined>
52
                                        </userdefined_id>
53
                                        <definedvalue>$census_no</definedvalue>
54
                                    </definedvalue>
55
                                    <linecover_m><_cm_to_m><value>$intercept_cm</value></_cm_to_m></linecover_m>
56
                                    <plantobservation>
57
                                        <authorplantcode>$individual_code</authorplantcode>
58
                                        <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
59
                                        <specimenreplicate>
60
                                            <collectionnumber>
61
                                                <_if name="if indirect voucher">
62
                                                    <cond>
63
                                                        <_eq>
64
                                                            <right>indirect</right>
65
                                                            <left>$det_type</left>
66
                                                        </_eq>
67
                                                    </cond>
68
                                                    <else>
69
                                                        <_alt>
70
                                                            <1>$coll_number</1>
71
                                                            <2>$voucher_string</2>
72
                                                        </_alt>
73
                                                    </else>
74
                                                </_if>
75
                                            </collectionnumber>
76
                                        </specimenreplicate>
77
                                        <stemobservation>
78
                                            <basaldiameter_m><_cm_to_m><value>$basal_diam</value></_cm_to_m></basaldiameter_m>
79
                                            <definedvalue fkey="tablerecord_id">
80
                                                <userdefined_id>
81
                                                    <userdefined>
82
                                                        <tablename>stemobservation</tablename>
83
                                                        <userdefinedname>canopyForm</userdefinedname>
84
                                                    </userdefined>
85
                                                </userdefined_id>
86
                                                <definedvalue>$stem_canopy_form</definedvalue>
87
                                            </definedvalue>
88
                                            <definedvalue fkey="tablerecord_id">
89
                                                <userdefined_id>
90
                                                    <userdefined>
91
                                                        <tablename>stemobservation</tablename>
92
                                                        <userdefinedname>canopyPosition</userdefinedname>
93
                                                    </userdefined>
94
                                                </userdefined_id>
95
                                                <definedvalue>$stem_canopy_position</definedvalue>
96
                                            </definedvalue>
97
                                            <definedvalue fkey="tablerecord_id">
98
                                                <userdefined_id>
99
                                                    <userdefined>
100
                                                        <tablename>stemobservation</tablename>
101
                                                        <userdefinedname>lianaInfestation</userdefinedname>
102
                                                    </userdefined>
103
                                                </userdefined_id>
104
                                                <definedvalue>$stem_liana_infestation</definedvalue>
105
                                            </definedvalue>
106
                                            <definedvalue fkey="tablerecord_id">
107
                                                <userdefined_id>
108
                                                    <userdefined>
109
                                                        <tablename>stemobservation</tablename>
110
                                                        <userdefinedname>notes</userdefinedname>
111
                                                    </userdefined>
112
                                                </userdefined_id>
113
                                                <definedvalue>$notes</definedvalue>
114
                                            </definedvalue>
115
                                            <diameterbreastheight_m><_cm_to_m><value>$stem_dbh</value></_cm_to_m></diameterbreastheight_m>
116
                                            <height_m>
117
                                                <_alt>
118
                                                    <1>$stem_height_m</1>
119
                                                    <2>$height_m</2>
120
                                                </_alt>
121
                                            </height_m>
122
                                            <heightfirstbranch_m>
123
                                                <_alt>
124
                                                    <0>$ht_first_branch_m</0>
125
                                                    <1>$stem_height_first_branch_m</1>
126
                                                </_alt>
127
                                            </heightfirstbranch_m>
128
                                            <tag>
129
                                                <_alt>
130
                                                    <1>
131
                                                        <_alt>
132
                                                            <1>$stem_tag2</1>
133
                                                            <2>$stem_tag1</2>
134
                                                        </_alt>
135
                                                    </1>
136
                                                    <2>
137
                                                        <_alt>
138
                                                            <1>$tag2</1>
139
                                                            <2>$tag1</2>
140
                                                        </_alt>
141
                                                    </2>
142
                                                </_alt>
143
                                            </tag>
144
                                            <xposition_m>$x_position</xposition_m>
145
                                            <yposition_m>$y_position</yposition_m>
146
                                        </stemobservation>
147
                                    </plantobservation>
148
                                </aggregateoccurrence>
149
                                <authortaxoncode>$individual_code</authortaxoncode>
150
                                <collector_id>
151
                                    <party>
152
                                        <fullname>
153
                                            <_join_words>
154
                                                <1>$coll_firstname</1>
155
                                                <2>$coll_lastname</2>
156
                                            </_join_words>
157
                                        </fullname>
158
                                    </party>
159
                                </collector_id>
160
                                <growthform>
161
                                    <_map>
162
                                        <T>tree</T>
163
                                        <Arbol>tree</Arbol>
164
                                        <palm>tree</palm>
165
                                        <H>hemiepiphyte</H>
166
                                        <Hemiepífito>hemiepiphyte</Hemiepífito>
167
                                        <L>liana</L>
168
                                        <l>liana</l>
169
                                        <L?>liana</L?>
170
                                        <Liana>liana</Liana>
171
                                        <E>epiphyte</E>
172
                                        <S>shrub</S>
173
                                        <Hb>herb</Hb>
174
                                        <vine-herbaceous>vine</vine-herbaceous>
175
                                        <graminoid>grass</graminoid>
176
                                        <rosette>forb</rosette>
177
                                        <*>*</*>
178
                                        <value>$habit</value>
179
                                    </_map>
180
                                </growthform>
181
                                <sourceaccessioncode>$OBSERVATION_ID</sourceaccessioncode>
182
                                <taxondetermination>
183
                                    <taxonverbatim_id>
184
                                        <taxonverbatim>
185
                                            <taxonlabel_id>
186
                                                <taxonlabel>
187
                                                    <parent_id>
188
                                                        <taxonlabel>
189
                                                            <rank>$infra_rank_1</rank>
190
                                                            <parent_id>
191
                                                                <taxonlabel>
192
                                                                    <rank>cultivar</rank>
193
                                                                    <parent_id>
194
                                                                        <taxonlabel>
195
                                                                            <rank>forma</rank>
196
                                                                            <parent_id>
197
                                                                                <taxonlabel>
198
                                                                                    <rank>variety</rank>
199
                                                                                    <parent_id>
200
                                                                                        <taxonlabel>
201
                                                                                            <rank>subspecies</rank>
202
                                                                                            <parent_id>
203
                                                                                                <taxonlabel>
204
                                                                                                    <rank>species</rank>
205
                                                                                                    <taxonepithet>$specific_epithet</taxonepithet>
206
                                                                                                    <parent_id>
207
                                                                                                        <taxonlabel>
208
                                                                                                            <rank>genus</rank>
209
                                                                                                            <taxonepithet>$genus</taxonepithet>
210
                                                                                                            <parent_id>
211
                                                                                                                <taxonlabel>
212
                                                                                                                    <rank>family</rank>
213
                                                                                                                    <taxonepithet>$family</taxonepithet>
214
                                                                                                                </taxonlabel>
215
                                                                                                            </parent_id>
216
                                                                                                        </taxonlabel>
217
                                                                                                    </parent_id>
218
                                                                                                </taxonlabel>
219
                                                                                            </parent_id>
220
                                                                                        </taxonlabel>
221
                                                                                    </parent_id>
222
                                                                                </taxonlabel>
223
                                                                            </parent_id>
224
                                                                        </taxonlabel>
225
                                                                    </parent_id>
226
                                                                </taxonlabel>
227
                                                            </parent_id>
228
                                                            <taxonepithet>$infra_ep_1</taxonepithet>
229
                                                        </taxonlabel>
230
                                                    </parent_id>
231
                                                    <rank>$infra_rank_1</rank>
232
                                                    <taxonomicname>
233
                                                        <_merge_prefix>
234
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
235
                                                            <value>
236
                                                                <_join_words>
237
                                                                    <1>
238
                                                                        <_join_words>
239
                                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
240
                                                                            <3>$specific_epithet</3>
241
                                                                            <5>
242
                                                                                <_join_words>
243
                                                                                    <1>
244
                                                                                        <_if name="if has infraspecificEpithet">
245
                                                                                            <cond>$infra_ep_1</cond>
246
                                                                                            <then>$infra_rank_1</then>
247
                                                                                        </_if>
248
                                                                                    </1>
249
                                                                                    <2>$infra_ep_1</2>
250
                                                                                </_join_words>
251
                                                                            </5>
252
                                                                        </_join_words>
253
                                                                    </1>
254
                                                                    <2>$specific_authority</2>
255
                                                                </_join_words>
256
                                                            </value>
257
                                                        </_merge_prefix>
258
                                                    </taxonomicname>
259
                                                </taxonlabel>
260
                                            </taxonlabel_id>
261
                                            <author>$specific_authority</author>
262
                                            <family>$family</family>
263
                                            <genus>$genus</genus>
264
                                            <specific_epithet>$specific_epithet</specific_epithet>
265
                                            <verbatimrank>$infra_rank_1</verbatimrank>
266
                                        </taxonverbatim>
267
                                    </taxonverbatim_id>
268
                                    <taxonfit>$cf_aff</taxonfit>
269
                                </taxondetermination>
270
                                <taxondetermination>
271
                                    <isoriginal>true</isoriginal>
272
                                    <taxonverbatim_id>
273
                                        <taxonverbatim>
274
                                            <family>$orig_family</family>
275
                                            <specific_epithet>$orig_species</specific_epithet>
276
                                        </taxonverbatim>
277
                                    </taxonverbatim_id>
278
                                </taxondetermination>
279
                                <voucher>
280
                                    <specimenreplicate_id>
281
                                        <specimenreplicate>
282
                                            <collectionnumber>
283
                                                <_if name="if indirect voucher">
284
                                                    <cond>
285
                                                        <_eq>
286
                                                            <right>indirect</right>
287
                                                            <left>$det_type</left>
288
                                                        </_eq>
289
                                                    </cond>
290
                                                    <then>
291
                                                        <_alt>
292
                                                            <1>$coll_number</1>
293
                                                            <2>$voucher_string</2>
294
                                                        </_alt>
295
                                                    </then>
296
                                                </_if>
297
                                            </collectionnumber>
298
                                        </specimenreplicate>
299
                                    </specimenreplicate_id>
300
                                </voucher>
301
                            </taxonoccurrence>
302 304
                        </locationevent>
303 305
                        <sourceaccessioncode>
304 306
                            <_join>

Also available in: Unified diff