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>$NoInd</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
                                        <notes>$Notes</notes>
56
                                        <plantobservation>
57
                                            <authorplantcode>$Ind</authorplantcode>
58
                                            <reproductivecondition>$phenology</reproductivecondition>
59
                                            <sourceaccessioncode>$PlotObsID</sourceaccessioncode>
60
                                            <specimenreplicate>
61
                                                <collectionnumber>
62
                                                    <_if name="if indirect voucher">
63
                                                        <cond>
64
                                                            <_eq>
65
                                                                <right>indirect</right>
66
                                                                <left>$DetType</left>
67
                                                            </_eq>
68
                                                        </cond>
69
                                                        <else>
70
                                                            <_alt>
71
                                                                <1>$coll_number</1>
72
                                                                <2>$SourceVoucher</2>
73
                                                            </_alt>
74
                                                        </else>
75
                                                    </_if>
76
                                                </collectionnumber>
77
                                            </specimenreplicate>
78
                                            <stemobservation>
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>$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>$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>$liana_infestation</definedvalue>
105
                                                </definedvalue>
106
                                                <diameterbreastheight_m><_cm_to_m><value>$temp_dbh</value></_cm_to_m></diameterbreastheight_m>
107
                                                <height_m>$height_m</height_m>
108
                                                <heightfirstbranch_m>$ht_first_branch_m</heightfirstbranch_m>
109
                                                <tag>
110
                                                    <_alt>
111
                                                        <1>$tag2</1>
112
                                                        <2>$tag1</2>
113
                                                    </_alt>
114
                                                </tag>
115
                                                <xposition_m>$x_position</xposition_m>
116
                                                <yposition_m>$y_position</yposition_m>
117
                                            </stemobservation>
118
                                        </plantobservation>
119
                                    </aggregateoccurrence>
120
                                    <authortaxoncode>$Ind</authortaxoncode>
121
                                    <collector_id>
122
                                        <party>
123
                                            <fullname>
124
                                                <_join_words>
125
                                                    <1>$coll_firstname</1>
126
                                                    <2>$coll_lastname</2>
127
                                                </_join_words>
128
                                            </fullname>
129
                                        </party>
130
                                    </collector_id>
131
                                    <growthform>
132
                                        <_map>
133
                                            <T>tree</T>
134
                                            <Arbol>tree</Arbol>
135
                                            <palm>tree</palm>
136
                                            <H>hemiepiphyte</H>
137
                                            <Hemiepífito>hemiepiphyte</Hemiepífito>
138
                                            <L>liana</L>
139
                                            <l>liana</l>
140
                                            <L?>liana</L?>
141
                                            <Liana>liana</Liana>
142
                                            <E>epiphyte</E>
143
                                            <S>shrub</S>
144
                                            <Hb>herb</Hb>
145
                                            <vine-herbaceous>vine</vine-herbaceous>
146
                                            <graminoid>grass</graminoid>
147
                                            <rosette>forb</rosette>
148
                                            <*>*</*>
149
                                            <value>$Habit</value>
150
                                        </_map>
151
                                    </growthform>
152
                                    <sourceaccessioncode>$PlotObsID</sourceaccessioncode>
153
                                    <taxondetermination>
154
                                        <party_id><party><fullname>$det_by</fullname></party></party_id>
155
                                        <taxonverbatim_id>
156
                                            <taxonverbatim>
157
                                                <taxonlabel_id>
158
                                                    <taxonlabel>
159
                                                        <parent_id>
160
                                                            <taxonlabel>
161
                                                                <rank>$infra_rank_1</rank>
162
                                                                <parent_id>
163
                                                                    <taxonlabel>
164
                                                                        <rank>cultivar</rank>
165
                                                                        <parent_id>
166
                                                                            <taxonlabel>
167
                                                                                <rank>forma</rank>
168
                                                                                <parent_id>
169
                                                                                    <taxonlabel>
170
                                                                                        <rank>variety</rank>
171
                                                                                        <parent_id>
172
                                                                                            <taxonlabel>
173
                                                                                                <rank>subspecies</rank>
174
                                                                                                <parent_id>
175
                                                                                                    <taxonlabel>
176
                                                                                                        <rank>species</rank>
177
                                                                                                        <taxonepithet>$Species</taxonepithet>
178
                                                                                                        <parent_id>
179
                                                                                                            <taxonlabel>
180
                                                                                                                <rank>genus</rank>
181
                                                                                                                <taxonepithet>$Genus</taxonepithet>
182
                                                                                                                <parent_id>
183
                                                                                                                    <taxonlabel>
184
                                                                                                                        <rank>family</rank>
185
                                                                                                                        <taxonepithet>$Family</taxonepithet>
186
                                                                                                                    </taxonlabel>
187
                                                                                                                </parent_id>
188
                                                                                                            </taxonlabel>
189
                                                                                                        </parent_id>
190
                                                                                                    </taxonlabel>
191
                                                                                                </parent_id>
192
                                                                                            </taxonlabel>
193
                                                                                        </parent_id>
194
                                                                                    </taxonlabel>
195
                                                                                </parent_id>
196
                                                                            </taxonlabel>
197
                                                                        </parent_id>
198
                                                                    </taxonlabel>
199
                                                                </parent_id>
200
                                                                <taxonepithet>$infra_ep_1</taxonepithet>
201
                                                            </taxonlabel>
202
                                                        </parent_id>
203
                                                        <rank>$infra_rank_1</rank>
204
                                                        <taxonomicname>
205
                                                            <_merge_prefix>
206
                                                                <prefix><_taxon_family_require_std><family>$Family</family></_taxon_family_require_std></prefix>
207
                                                                <value>
208
                                                                    <_join_words>
209
                                                                        <1>
210
                                                                            <_join_words>
211
                                                                                <2><_filter_genus><value>$Genus</value></_filter_genus></2>
212
                                                                                <3>$Species</3>
213
                                                                                <5>
214
                                                                                    <_join_words>
215
                                                                                        <1>
216
                                                                                            <_if name="if has infraspecificEpithet">
217
                                                                                                <cond>$infra_ep_1</cond>
218
                                                                                                <then>$infra_rank_1</then>
219
                                                                                            </_if>
220
                                                                                        </1>
221
                                                                                        <2>$infra_ep_1</2>
222
                                                                                    </_join_words>
223
                                                                                </5>
224
                                                                            </_join_words>
225
                                                                        </1>
226
                                                                        <2>$auth</2>
227
                                                                    </_join_words>
228
                                                                </value>
229
                                                            </_merge_prefix>
230
                                                        </taxonomicname>
231
                                                    </taxonlabel>
232
                                                </taxonlabel_id>
233
                                                <author>$auth</author>
234
                                                <family>$Family</family>
235
                                                <genus>$Genus</genus>
236
                                                <specific_epithet>$Species</specific_epithet>
237
                                                <verbatimrank>$infra_rank_1</verbatimrank>
238
                                            </taxonverbatim>
239
                                        </taxonverbatim_id>
240
                                        <taxonfit>$cfaff</taxonfit>
241
                                    </taxondetermination>
242
                                    <taxondetermination>
243
                                        <isoriginal>true</isoriginal>
244
                                        <taxonverbatim_id>
245
                                            <taxonverbatim>
246
                                                <family>$OrigFamily</family>
247
                                                <genus>$OrigGenus</genus>
248
                                                <morphoname>$morphoname</morphoname>
249
                                                <specific_epithet>$OrigSpecies</specific_epithet>
250
                                            </taxonverbatim>
251
                                        </taxonverbatim_id>
252
                                    </taxondetermination>
253
                                    <voucher>
254
                                        <specimenreplicate_id>
255
                                            <specimenreplicate>
256
                                                <collectionnumber>
257
                                                    <_if name="if indirect voucher">
258
                                                        <cond>
259
                                                            <_eq>
260
                                                                <right>indirect</right>
261
                                                                <left>$DetType</left>
262
                                                            </_eq>
263
                                                        </cond>
264
                                                        <then>
265
                                                            <_alt>
266
                                                                <1>$coll_number</1>
267
                                                                <2>$SourceVoucher</2>
268
                                                            </_alt>
269
                                                        </then>
270
                                                    </_if>
271
                                                </collectionnumber>
272
                                            </specimenreplicate>
273
                                        </specimenreplicate_id>
274
                                    </voucher>
275
                                </taxonoccurrence>
276
                            </locationevent>
40 277
                            <obsenddate><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></obsenddate>
41 278
                            <obsstartdate><_dateRangeStart><value>$census_date</value></_dateRangeStart></obsstartdate>
42
                            <taxonoccurrence>
43
                                <aggregateoccurrence>
44
                                    <count>$NoInd</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
                                    <notes>$Notes</notes>
57
                                    <plantobservation>
58
                                        <authorplantcode>$Ind</authorplantcode>
59
                                        <reproductivecondition>$phenology</reproductivecondition>
60
                                        <sourceaccessioncode>$PlotObsID</sourceaccessioncode>
61
                                        <specimenreplicate>
62
                                            <collectionnumber>
63
                                                <_if name="if indirect voucher">
64
                                                    <cond>
65
                                                        <_eq>
66
                                                            <right>indirect</right>
67
                                                            <left>$DetType</left>
68
                                                        </_eq>
69
                                                    </cond>
70
                                                    <else>
71
                                                        <_alt>
72
                                                            <1>$coll_number</1>
73
                                                            <2>$SourceVoucher</2>
74
                                                        </_alt>
75
                                                    </else>
76
                                                </_if>
77
                                            </collectionnumber>
78
                                        </specimenreplicate>
79
                                        <stemobservation>
80
                                            <definedvalue fkey="tablerecord_id">
81
                                                <userdefined_id>
82
                                                    <userdefined>
83
                                                        <tablename>stemobservation</tablename>
84
                                                        <userdefinedname>canopyForm</userdefinedname>
85
                                                    </userdefined>
86
                                                </userdefined_id>
87
                                                <definedvalue>$canopy_form</definedvalue>
88
                                            </definedvalue>
89
                                            <definedvalue fkey="tablerecord_id">
90
                                                <userdefined_id>
91
                                                    <userdefined>
92
                                                        <tablename>stemobservation</tablename>
93
                                                        <userdefinedname>canopyPosition</userdefinedname>
94
                                                    </userdefined>
95
                                                </userdefined_id>
96
                                                <definedvalue>$canopy_position</definedvalue>
97
                                            </definedvalue>
98
                                            <definedvalue fkey="tablerecord_id">
99
                                                <userdefined_id>
100
                                                    <userdefined>
101
                                                        <tablename>stemobservation</tablename>
102
                                                        <userdefinedname>lianaInfestation</userdefinedname>
103
                                                    </userdefined>
104
                                                </userdefined_id>
105
                                                <definedvalue>$liana_infestation</definedvalue>
106
                                            </definedvalue>
107
                                            <diameterbreastheight_m><_cm_to_m><value>$temp_dbh</value></_cm_to_m></diameterbreastheight_m>
108
                                            <height_m>$height_m</height_m>
109
                                            <heightfirstbranch_m>$ht_first_branch_m</heightfirstbranch_m>
110
                                            <tag>
111
                                                <_alt>
112
                                                    <1>$tag2</1>
113
                                                    <2>$tag1</2>
114
                                                </_alt>
115
                                            </tag>
116
                                            <xposition_m>$x_position</xposition_m>
117
                                            <yposition_m>$y_position</yposition_m>
118
                                        </stemobservation>
119
                                    </plantobservation>
120
                                </aggregateoccurrence>
121
                                <authortaxoncode>$Ind</authortaxoncode>
122
                                <collector_id>
123
                                    <party>
124
                                        <fullname>
125
                                            <_join_words>
126
                                                <1>$coll_firstname</1>
127
                                                <2>$coll_lastname</2>
128
                                            </_join_words>
129
                                        </fullname>
130
                                    </party>
131
                                </collector_id>
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>$PlotObsID</sourceaccessioncode>
154
                                <taxondetermination>
155
                                    <party_id><party><fullname>$det_by</fullname></party></party_id>
156
                                    <taxonverbatim_id>
157
                                        <taxonverbatim>
158
                                            <taxonlabel_id>
159
                                                <taxonlabel>
160
                                                    <parent_id>
161
                                                        <taxonlabel>
162
                                                            <rank>$infra_rank_1</rank>
163
                                                            <parent_id>
164
                                                                <taxonlabel>
165
                                                                    <rank>cultivar</rank>
166
                                                                    <parent_id>
167
                                                                        <taxonlabel>
168
                                                                            <rank>forma</rank>
169
                                                                            <parent_id>
170
                                                                                <taxonlabel>
171
                                                                                    <rank>variety</rank>
172
                                                                                    <parent_id>
173
                                                                                        <taxonlabel>
174
                                                                                            <rank>subspecies</rank>
175
                                                                                            <parent_id>
176
                                                                                                <taxonlabel>
177
                                                                                                    <rank>species</rank>
178
                                                                                                    <taxonepithet>$Species</taxonepithet>
179
                                                                                                    <parent_id>
180
                                                                                                        <taxonlabel>
181
                                                                                                            <rank>genus</rank>
182
                                                                                                            <taxonepithet>$Genus</taxonepithet>
183
                                                                                                            <parent_id>
184
                                                                                                                <taxonlabel>
185
                                                                                                                    <rank>family</rank>
186
                                                                                                                    <taxonepithet>$Family</taxonepithet>
187
                                                                                                                </taxonlabel>
188
                                                                                                            </parent_id>
189
                                                                                                        </taxonlabel>
190
                                                                                                    </parent_id>
191
                                                                                                </taxonlabel>
192
                                                                                            </parent_id>
193
                                                                                        </taxonlabel>
194
                                                                                    </parent_id>
195
                                                                                </taxonlabel>
196
                                                                            </parent_id>
197
                                                                        </taxonlabel>
198
                                                                    </parent_id>
199
                                                                </taxonlabel>
200
                                                            </parent_id>
201
                                                            <taxonepithet>$infra_ep_1</taxonepithet>
202
                                                        </taxonlabel>
203
                                                    </parent_id>
204
                                                    <rank>$infra_rank_1</rank>
205
                                                    <taxonomicname>
206
                                                        <_merge_prefix>
207
                                                            <prefix><_taxon_family_require_std><family>$Family</family></_taxon_family_require_std></prefix>
208
                                                            <value>
209
                                                                <_join_words>
210
                                                                    <1>
211
                                                                        <_join_words>
212
                                                                            <2><_filter_genus><value>$Genus</value></_filter_genus></2>
213
                                                                            <3>$Species</3>
214
                                                                            <5>
215
                                                                                <_join_words>
216
                                                                                    <1>
217
                                                                                        <_if name="if has infraspecificEpithet">
218
                                                                                            <cond>$infra_ep_1</cond>
219
                                                                                            <then>$infra_rank_1</then>
220
                                                                                        </_if>
221
                                                                                    </1>
222
                                                                                    <2>$infra_ep_1</2>
223
                                                                                </_join_words>
224
                                                                            </5>
225
                                                                        </_join_words>
226
                                                                    </1>
227
                                                                    <2>$auth</2>
228
                                                                </_join_words>
229
                                                            </value>
230
                                                        </_merge_prefix>
231
                                                    </taxonomicname>
232
                                                </taxonlabel>
233
                                            </taxonlabel_id>
234
                                            <author>$auth</author>
235
                                            <family>$Family</family>
236
                                            <genus>$Genus</genus>
237
                                            <specific_epithet>$Species</specific_epithet>
238
                                            <verbatimrank>$infra_rank_1</verbatimrank>
239
                                        </taxonverbatim>
240
                                    </taxonverbatim_id>
241
                                    <taxonfit>$cfaff</taxonfit>
242
                                </taxondetermination>
243
                                <taxondetermination>
244
                                    <isoriginal>true</isoriginal>
245
                                    <taxonverbatim_id>
246
                                        <taxonverbatim>
247
                                            <family>$OrigFamily</family>
248
                                            <genus>$OrigGenus</genus>
249
                                            <morphoname>$morphoname</morphoname>
250
                                            <specific_epithet>$OrigSpecies</specific_epithet>
251
                                        </taxonverbatim>
252
                                    </taxonverbatim_id>
253
                                </taxondetermination>
254
                                <voucher>
255
                                    <specimenreplicate_id>
256
                                        <specimenreplicate>
257
                                            <collectionnumber>
258
                                                <_if name="if indirect voucher">
259
                                                    <cond>
260
                                                        <_eq>
261
                                                            <right>indirect</right>
262
                                                            <left>$DetType</left>
263
                                                        </_eq>
264
                                                    </cond>
265
                                                    <then>
266
                                                        <_alt>
267
                                                            <1>$coll_number</1>
268
                                                            <2>$SourceVoucher</2>
269
                                                        </_alt>
270
                                                    </then>
271
                                                </_if>
272
                                            </collectionnumber>
273
                                        </specimenreplicate>
274
                                    </specimenreplicate_id>
275
                                </voucher>
276
                            </taxonoccurrence>
277 279
                        </locationevent>
278 280
                        <sourceaccessioncode>
279 281
                            <_join>

Also available in: Unified diff