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
48 48
                            </_locationnarrative_is_cultivated>
49 49
                        </iscultivated>
50 50
                        <locationevent>
51
                            <locationevent fkey="parent_id">
52
                                <taxonoccurrence>
53
                                    <aggregateoccurrence>
54
                                        <notes>$occurrenceRemarks</notes>
55
                                        <plantobservation>
56
                                            <authorplantcode>$collectorNumber</authorplantcode>
57
                                            <specimenreplicate>
58
                                                <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
59
                                                <collectioncode_dwc>
60
                                                    <_alt>
61
                                                        <1>$collection</1>
62
                                                        <2>$collectionURL</2>
63
                                                    </_alt>
64
                                                </collectioncode_dwc>
65
                                                <collectionnumber>$collectorNumber</collectionnumber>
66
                                                <institution_id>
67
                                                    <sourcelist>
68
                                                        <name>$specimenHolderInstitutions</name>
69
                                                        <sourcename>
70
                                                            <name>
71
                                                                <_split>
72
                                                                    <separator>[,;] *</separator>
73
                                                                    <value>$specimenHolderInstitutions</value>
74
                                                                </_split>
75
                                                            </name>
76
                                                        </sourcename>
77
                                                    </sourcelist>
78
                                                </institution_id>
79
                                                <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
80
                                            </specimenreplicate>
81
                                        </plantobservation>
82
                                    </aggregateoccurrence>
83
                                    <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
84
                                    <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
85
                                    <taxondetermination>
86
                                        <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
87
                                        <taxonverbatim_id>
88
                                            <taxonverbatim>
89
                                                <taxonlabel_id>
90
                                                    <taxonlabel>
91
                                                        <parent_id>
92
                                                            <taxonlabel>
93
                                                                <rank>$taxonRank</rank>
94
                                                                <parent_id>
95
                                                                    <taxonlabel>
96
                                                                        <rank>cultivar</rank>
97
                                                                        <parent_id>
98
                                                                            <taxonlabel>
99
                                                                                <rank>forma</rank>
100
                                                                                <parent_id>
101
                                                                                    <taxonlabel>
102
                                                                                        <rank>variety</rank>
103
                                                                                        <parent_id>
104
                                                                                            <taxonlabel>
105
                                                                                                <rank>subspecies</rank>
106
                                                                                                <parent_id>
107
                                                                                                    <taxonlabel>
108
                                                                                                        <rank>species</rank>
109
                                                                                                        <taxonepithet>$specificEpithet</taxonepithet>
110
                                                                                                        <parent_id>
111
                                                                                                            <taxonlabel>
112
                                                                                                                <rank>genus</rank>
113
                                                                                                                <taxonepithet>$genus</taxonepithet>
114
                                                                                                                <parent_id>
115
                                                                                                                    <taxonlabel>
116
                                                                                                                        <rank>family</rank>
117
                                                                                                                        <parent_id>
118
                                                                                                                            <taxonlabel>
119
                                                                                                                                <rank>order</rank>
120
                                                                                                                                <parent_id>
121
                                                                                                                                    <taxonlabel>
122
                                                                                                                                        <rank>class</rank>
123
                                                                                                                                        <parent_id>
124
                                                                                                                                            <taxonlabel>
125
                                                                                                                                                <rank>phylum</rank>
126
                                                                                                                                                <parent_id>
127
                                                                                                                                                    <taxonlabel>
128
                                                                                                                                                        <rank>kingdom</rank>
129
                                                                                                                                                        <taxonepithet>$kingdom</taxonepithet>
130
                                                                                                                                                    </taxonlabel>
131
                                                                                                                                                </parent_id>
132
                                                                                                                                            </taxonlabel>
133
                                                                                                                                        </parent_id>
134
                                                                                                                                    </taxonlabel>
135
                                                                                                                                </parent_id>
136
                                                                                                                            </taxonlabel>
137
                                                                                                                        </parent_id>
138
                                                                                                                    </taxonlabel>
139
                                                                                                                </parent_id>
140
                                                                                                            </taxonlabel>
141
                                                                                                        </parent_id>
142
                                                                                                    </taxonlabel>
143
                                                                                                </parent_id>
144
                                                                                            </taxonlabel>
145
                                                                                        </parent_id>
146
                                                                                    </taxonlabel>
147
                                                                                </parent_id>
148
                                                                            </taxonlabel>
149
                                                                        </parent_id>
150
                                                                    </taxonlabel>
151
                                                                </parent_id>
152
                                                                <taxonepithet>$infraspecificEpithet</taxonepithet>
153
                                                            </taxonlabel>
154
                                                        </parent_id>
155
                                                        <rank>$taxonRank</rank>
156
                                                        <taxonomicname>
157
                                                            <_alt>
158
                                                                <1>$scientificName</1>
159
                                                                <2>
160
                                                                    <_join_words>
161
                                                                        <1>
162
                                                                            <_join_words>
163
                                                                                <2><_filter_genus><value>$genus</value></_filter_genus></2>
164
                                                                                <3>$specificEpithet</3>
165
                                                                                <5>
166
                                                                                    <_join_words>
167
                                                                                        <1>
168
                                                                                            <_if name="if has infraspecificEpithet">
169
                                                                                                <cond>$infraspecificEpithet</cond>
170
                                                                                                <then>$taxonRank</then>
171
                                                                                            </_if>
172
                                                                                        </1>
173
                                                                                        <2>$infraspecificEpithet</2>
174
                                                                                    </_join_words>
175
                                                                                </5>
176
                                                                            </_join_words>
177
                                                                        </1>
178
                                                                        <2>$scientificNameAuthorship</2>
179
                                                                    </_join_words>
180
                                                                </2>
181
                                                            </_alt>
182
                                                        </taxonomicname>
183
                                                    </taxonlabel>
184
                                                </taxonlabel_id>
185
                                                <author>$scientificNameAuthorship</author>
186
                                                <genus>$genus</genus>
187
                                                <specific_epithet>$specificEpithet</specific_epithet>
188
                                                <taxonomicname>$scientificName</taxonomicname>
189
                                                <verbatimrank>$taxonRank</verbatimrank>
190
                                            </taxonverbatim>
191
                                        </taxonverbatim_id>
192
                                        <determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate>
193
                                    </taxondetermination>
194
                                </taxonoccurrence>
195
                            </locationevent>
51 196
                            <obsenddate><_dateRangeEnd><value>$eventDate</value></_dateRangeEnd></obsenddate>
52 197
                            <obsstartdate><_dateRangeStart><value>$eventDate</value></_dateRangeStart></obsstartdate>
53
                            <taxonoccurrence>
54
                                <aggregateoccurrence>
55
                                    <notes>$occurrenceRemarks</notes>
56
                                    <plantobservation>
57
                                        <authorplantcode>$collectorNumber</authorplantcode>
58
                                        <specimenreplicate>
59
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
60
                                            <collectioncode_dwc>
61
                                                <_alt>
62
                                                    <1>$collection</1>
63
                                                    <2>$collectionURL</2>
64
                                                </_alt>
65
                                            </collectioncode_dwc>
66
                                            <collectionnumber>$collectorNumber</collectionnumber>
67
                                            <institution_id>
68
                                                <sourcelist>
69
                                                    <name>$specimenHolderInstitutions</name>
70
                                                    <sourcename>
71
                                                        <name>
72
                                                            <_split>
73
                                                                <separator>[,;] *</separator>
74
                                                                <value>$specimenHolderInstitutions</value>
75
                                                            </_split>
76
                                                        </name>
77
                                                    </sourcename>
78
                                                </sourcelist>
79
                                            </institution_id>
80
                                            <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
81
                                        </specimenreplicate>
82
                                    </plantobservation>
83
                                </aggregateoccurrence>
84
                                <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
85
                                <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
86
                                <taxondetermination>
87
                                    <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
88
                                    <taxonverbatim_id>
89
                                        <taxonverbatim>
90
                                            <taxonlabel_id>
91
                                                <taxonlabel>
92
                                                    <parent_id>
93
                                                        <taxonlabel>
94
                                                            <rank>$taxonRank</rank>
95
                                                            <parent_id>
96
                                                                <taxonlabel>
97
                                                                    <rank>cultivar</rank>
98
                                                                    <parent_id>
99
                                                                        <taxonlabel>
100
                                                                            <rank>forma</rank>
101
                                                                            <parent_id>
102
                                                                                <taxonlabel>
103
                                                                                    <rank>variety</rank>
104
                                                                                    <parent_id>
105
                                                                                        <taxonlabel>
106
                                                                                            <rank>subspecies</rank>
107
                                                                                            <parent_id>
108
                                                                                                <taxonlabel>
109
                                                                                                    <rank>species</rank>
110
                                                                                                    <taxonepithet>$specificEpithet</taxonepithet>
111
                                                                                                    <parent_id>
112
                                                                                                        <taxonlabel>
113
                                                                                                            <rank>genus</rank>
114
                                                                                                            <taxonepithet>$genus</taxonepithet>
115
                                                                                                            <parent_id>
116
                                                                                                                <taxonlabel>
117
                                                                                                                    <rank>family</rank>
118
                                                                                                                    <parent_id>
119
                                                                                                                        <taxonlabel>
120
                                                                                                                            <rank>order</rank>
121
                                                                                                                            <parent_id>
122
                                                                                                                                <taxonlabel>
123
                                                                                                                                    <rank>class</rank>
124
                                                                                                                                    <parent_id>
125
                                                                                                                                        <taxonlabel>
126
                                                                                                                                            <rank>phylum</rank>
127
                                                                                                                                            <parent_id>
128
                                                                                                                                                <taxonlabel>
129
                                                                                                                                                    <rank>kingdom</rank>
130
                                                                                                                                                    <taxonepithet>$kingdom</taxonepithet>
131
                                                                                                                                                </taxonlabel>
132
                                                                                                                                            </parent_id>
133
                                                                                                                                        </taxonlabel>
134
                                                                                                                                    </parent_id>
135
                                                                                                                                </taxonlabel>
136
                                                                                                                            </parent_id>
137
                                                                                                                        </taxonlabel>
138
                                                                                                                    </parent_id>
139
                                                                                                                </taxonlabel>
140
                                                                                                            </parent_id>
141
                                                                                                        </taxonlabel>
142
                                                                                                    </parent_id>
143
                                                                                                </taxonlabel>
144
                                                                                            </parent_id>
145
                                                                                        </taxonlabel>
146
                                                                                    </parent_id>
147
                                                                                </taxonlabel>
148
                                                                            </parent_id>
149
                                                                        </taxonlabel>
150
                                                                    </parent_id>
151
                                                                </taxonlabel>
152
                                                            </parent_id>
153
                                                            <taxonepithet>$infraspecificEpithet</taxonepithet>
154
                                                        </taxonlabel>
155
                                                    </parent_id>
156
                                                    <rank>$taxonRank</rank>
157
                                                    <taxonomicname>
158
                                                        <_alt>
159
                                                            <1>$scientificName</1>
160
                                                            <2>
161
                                                                <_join_words>
162
                                                                    <1>
163
                                                                        <_join_words>
164
                                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
165
                                                                            <3>$specificEpithet</3>
166
                                                                            <5>
167
                                                                                <_join_words>
168
                                                                                    <1>
169
                                                                                        <_if name="if has infraspecificEpithet">
170
                                                                                            <cond>$infraspecificEpithet</cond>
171
                                                                                            <then>$taxonRank</then>
172
                                                                                        </_if>
173
                                                                                    </1>
174
                                                                                    <2>$infraspecificEpithet</2>
175
                                                                                </_join_words>
176
                                                                            </5>
177
                                                                        </_join_words>
178
                                                                    </1>
179
                                                                    <2>$scientificNameAuthorship</2>
180
                                                                </_join_words>
181
                                                            </2>
182
                                                        </_alt>
183
                                                    </taxonomicname>
184
                                                </taxonlabel>
185
                                            </taxonlabel_id>
186
                                            <author>$scientificNameAuthorship</author>
187
                                            <genus>$genus</genus>
188
                                            <specific_epithet>$specificEpithet</specific_epithet>
189
                                            <taxonomicname>$scientificName</taxonomicname>
190
                                            <verbatimrank>$taxonRank</verbatimrank>
191
                                        </taxonverbatim>
192
                                    </taxonverbatim_id>
193
                                    <determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate>
194
                                </taxondetermination>
195
                            </taxonoccurrence>
196 198
                        </locationevent>
197 199
                        <locationnarrative>
198 200
                            <_merge>

Also available in: Unified diff