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

Also available in: Unified diff