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
32 32
                        </elevation_m>
33 33
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
34 34
                        <locationevent>
35
                            <taxonoccurrence>
36
                                <aggregateoccurrence>
37
                                    <collectiondate>
38
                                        <_date>
39
                                            <day>
40
                                                <_nullIf>
41
                                                    <null>0</null>
42
                                                    <type>float</type>
43
                                                    <value>$dayCollected</value>
44
                                                </_nullIf>
45
                                            </day>
46
                                            <month>
47
                                                <_nullIf>
48
                                                    <null>0</null>
49
                                                    <type>float</type>
50
                                                    <value>$monthCollected</value>
51
                                                </_nullIf>
52
                                            </month>
53
                                            <year>
54
                                                <_nullIf>
55
                                                    <null>0</null>
56
                                                    <type>float</type>
57
                                                    <value>$yearCollected</value>
58
                                                </_nullIf>
59
                                            </year>
60
                                        </_date>
61
                                    </collectiondate>
62
                                    <count>$individualCount</count>
63
                                    <notes>$occurrenceRemarks</notes>
64
                                    <plantobservation>
65
                                        <authorplantcode>$collectorNumber</authorplantcode>
66
                                        <definedvalue fkey="tablerecord_id">
67
                                            <userdefined_id>
68
                                                <userdefined>
69
                                                    <tablename>plantobservation</tablename>
70
                                                    <userdefinedname>sex</userdefinedname>
71
                                                </userdefined>
72
                                            </userdefined_id>
73
                                            <definedvalue>$sex</definedvalue>
74
                                        </definedvalue>
75
                                        <specimenreplicate>
76
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
77
                                            <collectioncode_dwc>
78
                                                <_alt>
79
                                                    <1>$collection</1>
80
                                                    <2>$collectionURL</2>
81
                                                </_alt>
82
                                            </collectioncode_dwc>
83
                                            <collectionnumber>$collectorNumber</collectionnumber>
84
                                            <institution_id>
85
                                                <sourcelist>
86
                                                    <name>$specimenHolderInstitutions</name>
87
                                                    <sourcename>
88
                                                        <name>
89
                                                            <_split>
90
                                                                <separator>[,;] *</separator>
91
                                                                <value>$specimenHolderInstitutions</value>
92
                                                            </_split>
93
                                                        </name>
94
                                                    </sourcename>
95
                                                </sourcelist>
96
                                            </institution_id>
97
                                            <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
98
                                        </specimenreplicate>
99
                                    </plantobservation>
100
                                </aggregateoccurrence>
101
                                <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
102
                                <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
103
                                <taxondetermination>
104
                                    <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
105
                                    <taxonverbatim_id>
106
                                        <taxonverbatim>
107
                                            <taxonlabel_id>
108
                                                <taxonlabel>
109
                                                    <parent_id>
110
                                                        <taxonlabel>
111
                                                            <parent_id>
112
                                                                <taxonlabel>
113
                                                                    <rank>cultivar</rank>
114
                                                                    <parent_id>
115
                                                                        <taxonlabel>
116
                                                                            <rank>forma</rank>
117
                                                                            <parent_id>
118
                                                                                <taxonlabel>
119
                                                                                    <rank>variety</rank>
120
                                                                                    <parent_id>
121
                                                                                        <taxonlabel>
122
                                                                                            <rank>subspecies</rank>
123
                                                                                            <taxonepithet>$subspecies</taxonepithet>
124
                                                                                            <parent_id>
125
                                                                                                <taxonlabel>
126
                                                                                                    <rank>species</rank>
127
                                                                                                    <taxonepithet>$specificEpithet</taxonepithet>
128
                                                                                                    <parent_id>
129
                                                                                                        <taxonlabel>
130
                                                                                                            <rank>genus</rank>
131
                                                                                                            <taxonepithet>$genus</taxonepithet>
132
                                                                                                            <parent_id>
133
                                                                                                                <taxonlabel>
134
                                                                                                                    <rank>family</rank>
135
                                                                                                                    <taxonepithet>$family</taxonepithet>
136
                                                                                                                    <parent_id>
137
                                                                                                                        <taxonlabel>
138
                                                                                                                            <rank>order</rank>
139
                                                                                                                            <taxonepithet>$order</taxonepithet>
140
                                                                                                                            <parent_id>
141
                                                                                                                                <taxonlabel>
142
                                                                                                                                    <rank>class</rank>
143
                                                                                                                                    <taxonepithet>$class</taxonepithet>
144
                                                                                                                                    <parent_id>
145
                                                                                                                                        <taxonlabel>
146
                                                                                                                                            <rank>phylum</rank>
147
                                                                                                                                            <taxonepithet>$phylum</taxonepithet>
148
                                                                                                                                            <parent_id>
149
                                                                                                                                                <taxonlabel>
150
                                                                                                                                                    <rank>kingdom</rank>
151
                                                                                                                                                    <taxonepithet>$kingdom</taxonepithet>
152
                                                                                                                                                </taxonlabel>
153
                                                                                                                                            </parent_id>
154
                                                                                                                                        </taxonlabel>
155
                                                                                                                                    </parent_id>
156
                                                                                                                                </taxonlabel>
157
                                                                                                                            </parent_id>
158
                                                                                                                        </taxonlabel>
159
                                                                                                                    </parent_id>
160
                                                                                                                </taxonlabel>
161
                                                                                                            </parent_id>
162
                                                                                                        </taxonlabel>
163
                                                                                                    </parent_id>
164
                                                                                                </taxonlabel>
165
                                                                                            </parent_id>
166
                                                                                        </taxonlabel>
167
                                                                                    </parent_id>
168
                                                                                </taxonlabel>
169
                                                                            </parent_id>
170
                                                                        </taxonlabel>
171
                                                                    </parent_id>
172
                                                                </taxonlabel>
173
                                                            </parent_id>
174
                                                            <taxonepithet>$infraspecificEpithet</taxonepithet>
175
                                                        </taxonlabel>
176
                                                    </parent_id>
177
                                                    <taxonomicname>
178
                                                        <_merge_prefix>
179
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
180
                                                            <value>
181
                                                                <_alt>
182
                                                                    <1>$scientificName</1>
183
                                                                    <2>
184
                                                                        <_join_words>
185
                                                                            <1>
186
                                                                                <_join_words>
187
                                                                                    <2><_filter_genus><value>$genus</value></_filter_genus></2>
188
                                                                                    <3>$specificEpithet</3>
189
                                                                                    <4>$subspecies</4>
190
                                                                                    <5>$infraspecificEpithet</5>
191
                                                                                </_join_words>
192
                                                                            </1>
193
                                                                            <2>$scientificNameAuthorship</2>
194
                                                                        </_join_words>
195
                                                                    </2>
196
                                                                </_alt>
197
                                                            </value>
198
                                                        </_merge_prefix>
199
                                                    </taxonomicname>
200
                                                </taxonlabel>
201
                                            </taxonlabel_id>
202
                                            <author>$scientificNameAuthorship</author>
203
                                            <family>$family</family>
204
                                            <genus>$genus</genus>
205
                                            <specific_epithet>$specificEpithet</specific_epithet>
206
                                            <taxonomicname>$scientificName</taxonomicname>
207
                                        </taxonverbatim>
208
                                    </taxonverbatim_id>
209
                                    <determinationdate>
210
                                        <_alt>
211
                                            <1><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></1>
212
                                            <2>
213
                                                <_date>
214
                                                    <day>
215
                                                        <_nullIf>
216
                                                            <null>0</null>
217
                                                            <type>float</type>
218
                                                            <value>$dayIdentified</value>
219
                                                        </_nullIf>
220
                                                    </day>
221
                                                    <month>
222
                                                        <_nullIf>
223
                                                            <null>0</null>
224
                                                            <type>float</type>
225
                                                            <value>$monthIdentified</value>
226
                                                        </_nullIf>
227
                                                    </month>
228
                                                    <year>
229
                                                        <_nullIf>
230
                                                            <null>0</null>
231
                                                            <type>float</type>
232
                                                            <value>$yearIdentified</value>
233
                                                        </_nullIf>
234
                                                    </year>
235
                                                </_date>
236
                                            </2>
237
                                        </_alt>
238
                                    </determinationdate>
239
                                </taxondetermination>
240
                            </taxonoccurrence>
35
                            <locationevent fkey="parent_id">
36
                                <taxonoccurrence>
37
                                    <aggregateoccurrence>
38
                                        <collectiondate>
39
                                            <_date>
40
                                                <day>
41
                                                    <_nullIf>
42
                                                        <null>0</null>
43
                                                        <type>float</type>
44
                                                        <value>$dayCollected</value>
45
                                                    </_nullIf>
46
                                                </day>
47
                                                <month>
48
                                                    <_nullIf>
49
                                                        <null>0</null>
50
                                                        <type>float</type>
51
                                                        <value>$monthCollected</value>
52
                                                    </_nullIf>
53
                                                </month>
54
                                                <year>
55
                                                    <_nullIf>
56
                                                        <null>0</null>
57
                                                        <type>float</type>
58
                                                        <value>$yearCollected</value>
59
                                                    </_nullIf>
60
                                                </year>
61
                                            </_date>
62
                                        </collectiondate>
63
                                        <count>$individualCount</count>
64
                                        <notes>$occurrenceRemarks</notes>
65
                                        <plantobservation>
66
                                            <authorplantcode>$collectorNumber</authorplantcode>
67
                                            <definedvalue fkey="tablerecord_id">
68
                                                <userdefined_id>
69
                                                    <userdefined>
70
                                                        <tablename>plantobservation</tablename>
71
                                                        <userdefinedname>sex</userdefinedname>
72
                                                    </userdefined>
73
                                                </userdefined_id>
74
                                                <definedvalue>$sex</definedvalue>
75
                                            </definedvalue>
76
                                            <specimenreplicate>
77
                                                <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
78
                                                <collectioncode_dwc>
79
                                                    <_alt>
80
                                                        <1>$collection</1>
81
                                                        <2>$collectionURL</2>
82
                                                    </_alt>
83
                                                </collectioncode_dwc>
84
                                                <collectionnumber>$collectorNumber</collectionnumber>
85
                                                <institution_id>
86
                                                    <sourcelist>
87
                                                        <name>$specimenHolderInstitutions</name>
88
                                                        <sourcename>
89
                                                            <name>
90
                                                                <_split>
91
                                                                    <separator>[,;] *</separator>
92
                                                                    <value>$specimenHolderInstitutions</value>
93
                                                                </_split>
94
                                                            </name>
95
                                                        </sourcename>
96
                                                    </sourcelist>
97
                                                </institution_id>
98
                                                <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
99
                                            </specimenreplicate>
100
                                        </plantobservation>
101
                                    </aggregateoccurrence>
102
                                    <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
103
                                    <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
104
                                    <taxondetermination>
105
                                        <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
106
                                        <taxonverbatim_id>
107
                                            <taxonverbatim>
108
                                                <taxonlabel_id>
109
                                                    <taxonlabel>
110
                                                        <parent_id>
111
                                                            <taxonlabel>
112
                                                                <parent_id>
113
                                                                    <taxonlabel>
114
                                                                        <rank>cultivar</rank>
115
                                                                        <parent_id>
116
                                                                            <taxonlabel>
117
                                                                                <rank>forma</rank>
118
                                                                                <parent_id>
119
                                                                                    <taxonlabel>
120
                                                                                        <rank>variety</rank>
121
                                                                                        <parent_id>
122
                                                                                            <taxonlabel>
123
                                                                                                <rank>subspecies</rank>
124
                                                                                                <taxonepithet>$subspecies</taxonepithet>
125
                                                                                                <parent_id>
126
                                                                                                    <taxonlabel>
127
                                                                                                        <rank>species</rank>
128
                                                                                                        <taxonepithet>$specificEpithet</taxonepithet>
129
                                                                                                        <parent_id>
130
                                                                                                            <taxonlabel>
131
                                                                                                                <rank>genus</rank>
132
                                                                                                                <taxonepithet>$genus</taxonepithet>
133
                                                                                                                <parent_id>
134
                                                                                                                    <taxonlabel>
135
                                                                                                                        <rank>family</rank>
136
                                                                                                                        <taxonepithet>$family</taxonepithet>
137
                                                                                                                        <parent_id>
138
                                                                                                                            <taxonlabel>
139
                                                                                                                                <rank>order</rank>
140
                                                                                                                                <taxonepithet>$order</taxonepithet>
141
                                                                                                                                <parent_id>
142
                                                                                                                                    <taxonlabel>
143
                                                                                                                                        <rank>class</rank>
144
                                                                                                                                        <taxonepithet>$class</taxonepithet>
145
                                                                                                                                        <parent_id>
146
                                                                                                                                            <taxonlabel>
147
                                                                                                                                                <rank>phylum</rank>
148
                                                                                                                                                <taxonepithet>$phylum</taxonepithet>
149
                                                                                                                                                <parent_id>
150
                                                                                                                                                    <taxonlabel>
151
                                                                                                                                                        <rank>kingdom</rank>
152
                                                                                                                                                        <taxonepithet>$kingdom</taxonepithet>
153
                                                                                                                                                    </taxonlabel>
154
                                                                                                                                                </parent_id>
155
                                                                                                                                            </taxonlabel>
156
                                                                                                                                        </parent_id>
157
                                                                                                                                    </taxonlabel>
158
                                                                                                                                </parent_id>
159
                                                                                                                            </taxonlabel>
160
                                                                                                                        </parent_id>
161
                                                                                                                    </taxonlabel>
162
                                                                                                                </parent_id>
163
                                                                                                            </taxonlabel>
164
                                                                                                        </parent_id>
165
                                                                                                    </taxonlabel>
166
                                                                                                </parent_id>
167
                                                                                            </taxonlabel>
168
                                                                                        </parent_id>
169
                                                                                    </taxonlabel>
170
                                                                                </parent_id>
171
                                                                            </taxonlabel>
172
                                                                        </parent_id>
173
                                                                    </taxonlabel>
174
                                                                </parent_id>
175
                                                                <taxonepithet>$infraspecificEpithet</taxonepithet>
176
                                                            </taxonlabel>
177
                                                        </parent_id>
178
                                                        <taxonomicname>
179
                                                            <_merge_prefix>
180
                                                                <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
181
                                                                <value>
182
                                                                    <_alt>
183
                                                                        <1>$scientificName</1>
184
                                                                        <2>
185
                                                                            <_join_words>
186
                                                                                <1>
187
                                                                                    <_join_words>
188
                                                                                        <2><_filter_genus><value>$genus</value></_filter_genus></2>
189
                                                                                        <3>$specificEpithet</3>
190
                                                                                        <4>$subspecies</4>
191
                                                                                        <5>$infraspecificEpithet</5>
192
                                                                                    </_join_words>
193
                                                                                </1>
194
                                                                                <2>$scientificNameAuthorship</2>
195
                                                                            </_join_words>
196
                                                                        </2>
197
                                                                    </_alt>
198
                                                                </value>
199
                                                            </_merge_prefix>
200
                                                        </taxonomicname>
201
                                                    </taxonlabel>
202
                                                </taxonlabel_id>
203
                                                <author>$scientificNameAuthorship</author>
204
                                                <family>$family</family>
205
                                                <genus>$genus</genus>
206
                                                <specific_epithet>$specificEpithet</specific_epithet>
207
                                                <taxonomicname>$scientificName</taxonomicname>
208
                                            </taxonverbatim>
209
                                        </taxonverbatim_id>
210
                                        <determinationdate>
211
                                            <_alt>
212
                                                <1><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></1>
213
                                                <2>
214
                                                    <_date>
215
                                                        <day>
216
                                                            <_nullIf>
217
                                                                <null>0</null>
218
                                                                <type>float</type>
219
                                                                <value>$dayIdentified</value>
220
                                                            </_nullIf>
221
                                                        </day>
222
                                                        <month>
223
                                                            <_nullIf>
224
                                                                <null>0</null>
225
                                                                <type>float</type>
226
                                                                <value>$monthIdentified</value>
227
                                                            </_nullIf>
228
                                                        </month>
229
                                                        <year>
230
                                                            <_nullIf>
231
                                                                <null>0</null>
232
                                                                <type>float</type>
233
                                                                <value>$yearIdentified</value>
234
                                                            </_nullIf>
235
                                                        </year>
236
                                                    </_date>
237
                                                </2>
238
                                            </_alt>
239
                                        </determinationdate>
240
                                    </taxondetermination>
241
                                </taxonoccurrence>
242
                            </locationevent>
241 243
                            <waterdepth_m>
242 244
                                <_avg>
243 245
                                    <1>$minimumDepthInMeters</1>

Also available in: Unified diff