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

Also available in: Unified diff