Project

General

Profile

« Previous | Next » 

Revision 4621

mappings/VegCore-VegBIEN.csv: Added /_simplifyPath:[next=parent_id]/path to root so the returned subplot location will be its parent location if there is no subplot name or ID (indicating that that particular plot did not have subplots). Note that this also causes the parent_id forwarding effect to occur for all other tables containing parent_id, which will help prevent similar issues with subplot events, etc. This will hopefully fix the SALVIAS.plotObservations bug where some organisms did not have a subplot #, causing the subplot location to become NULL and causing the corresponding locationevent rows not to match the locationevent_unique_within_location index filter condition (which requires a parent_id), which caused multiple output table pkeys to be returned for those rows, violating the locationevent_pkeys temp table's primary key.

View differences:

test.xml.ref
1 1
Put template:
2 2
<VegBIEN>
3
    <location id="-1">
4
        <authorlocationcode>
5
            <_alt>
6
                <1>$id</1>
7
                <2>
8
                    <_join>
9
                        <1>$institutionCode</1>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_alt>
9
                        <1>$id</1>
10 10
                        <2>
11 11
                            <_join>
12
                                <1>$collectionCode</1>
13
                                <2>$collectionID</2>
12
                                <1>$institutionCode</1>
13
                                <2>
14
                                    <_join>
15
                                        <1>$collectionCode</1>
16
                                        <2>$collectionID</2>
17
                                    </_join>
18
                                </2>
19
                                <3>$catalogNumber</3>
14 20
                            </_join>
15 21
                        </2>
16
                        <3>$catalogNumber</3>
17
                    </_join>
18
                </2>
19
            </_alt>
20
        </authorlocationcode>
21
        <elevation>
22
            <_replace>
23
                <\bca\.?></\bca\.?>
24
                <value>$verbatimElevation</value>
25
            </_replace>
26
        </elevation>
27
        <locationdetermination>
28
            <latitude>
29
                <_nullIf>
30
                    <null>0</null>
31
                    <type>float</type>
32
                    <value>$decimalLatitude</value>
33
                </_nullIf>
34
            </latitude>
35
            <longitude>
36
                <_nullIf>
37
                    <null>0</null>
38
                    <type>float</type>
39
                    <value>$decimalLongitude</value>
40
                </_nullIf>
41
            </longitude>
42
            <namedplace_id>
43
                <_simplifyPath>
44
                    <next>parent_id</next>
45
                    <path>
46
                        <namedplace>
47
                            <rank>county</rank>
48
                            <placename>$county</placename>
49
                            <parent_id>
22
                    </_alt>
23
                </authorlocationcode>
24
                <elevation>
25
                    <_replace>
26
                        <\bca\.?></\bca\.?>
27
                        <value>$verbatimElevation</value>
28
                    </_replace>
29
                </elevation>
30
                <locationdetermination>
31
                    <latitude>
32
                        <_nullIf>
33
                            <null>0</null>
34
                            <type>float</type>
35
                            <value>$decimalLatitude</value>
36
                        </_nullIf>
37
                    </latitude>
38
                    <longitude>
39
                        <_nullIf>
40
                            <null>0</null>
41
                            <type>float</type>
42
                            <value>$decimalLongitude</value>
43
                        </_nullIf>
44
                    </longitude>
45
                    <namedplace_id>
46
                        <_simplifyPath>
47
                            <next>parent_id</next>
48
                            <path>
50 49
                                <namedplace>
51
                                    <rank>stateProvince</rank>
52
                                    <placename>$stateProvince</placename>
50
                                    <rank>county</rank>
51
                                    <placename>$county</placename>
53 52
                                    <parent_id>
54 53
                                        <namedplace>
55
                                            <rank>country</rank>
56
                                            <placename>$country</placename>
54
                                            <rank>stateProvince</rank>
55
                                            <placename>$stateProvince</placename>
57 56
                                            <parent_id>
58 57
                                                <namedplace>
59
                                                    <rank>continent</rank>
60
                                                    <placename>$continent</placename>
58
                                                    <rank>country</rank>
59
                                                    <placename>$country</placename>
60
                                                    <parent_id>
61
                                                        <namedplace>
62
                                                            <rank>continent</rank>
63
                                                            <placename>$continent</placename>
64
                                                        </namedplace>
65
                                                    </parent_id>
61 66
                                                </namedplace>
62 67
                                            </parent_id>
63 68
                                        </namedplace>
64 69
                                    </parent_id>
65 70
                                </namedplace>
66
                            </parent_id>
67
                        </namedplace>
68
                    </path>
69
                </_simplifyPath>
70
            </namedplace_id>
71
        </locationdetermination>
72
        <locationevent>
73
            <obsenddate><_date><date><_dateRangeEnd><value>$eventDate</value></_dateRangeEnd></date></_date></obsenddate>
74
            <obsstartdate><_date><date><_dateRangeStart><value>$eventDate</value></_dateRangeStart></date></_date></obsstartdate>
75
            <taxonoccurrence>
76
                <aggregateoccurrence>
77
                    <plantobservation>
78
                        <collectionnumber>$recordNumber</collectionnumber>
79
                        <specimenreplicate>
80
                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
81
                            <collectioncode_dwc>
82
                                <_join>
83
                                    <1>$collectionCode</1>
84
                                    <2>$collectionID</2>
85
                                </_join>
86
                            </collectioncode_dwc>
87
                            <institution_id><party><organizationname>$institutionCode</organizationname></party></institution_id>
88
                            <sourceaccessioncode>$id</sourceaccessioncode>
89
                        </specimenreplicate>
90
                    </plantobservation>
91
                </aggregateoccurrence>
92
                <authortaxoncode>
93
                    <_alt>
94
                        <1>$recordNumber</1>
95
                        <2>$scientificName</2>
96
                    </_alt>
97
                </authortaxoncode>
98
                <taxondetermination>
99
                    <party_id>
100
                        <party>
101
                            <givenname><_namePart><first>$identifiedBy</first></_namePart></givenname>
102
                            <middlename><_namePart><middle>$identifiedBy</middle></_namePart></middlename>
103
                            <surname><_namePart><last>$identifiedBy</last></_namePart></surname>
104
                        </party>
105
                    </party_id>
106
                    <plantconcept_id>
107
                        <plantconcept>
108
                            <plantname_id>
109
                                <_simplifyPath>
110
                                    <next>parent_id</next>
111
                                    <path>
112
                                        <plantname>
113
                                            <rank>binomial</rank>
114
                                            <plantname>$scientificName</plantname>
115
                                            <parent_id>
71
                            </path>
72
                        </_simplifyPath>
73
                    </namedplace_id>
74
                </locationdetermination>
75
                <locationevent>
76
                    <obsenddate><_date><date><_dateRangeEnd><value>$eventDate</value></_dateRangeEnd></date></_date></obsenddate>
77
                    <obsstartdate><_date><date><_dateRangeStart><value>$eventDate</value></_dateRangeStart></date></_date></obsstartdate>
78
                    <taxonoccurrence>
79
                        <aggregateoccurrence>
80
                            <plantobservation>
81
                                <collectionnumber>$recordNumber</collectionnumber>
82
                                <specimenreplicate>
83
                                    <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
84
                                    <collectioncode_dwc>
85
                                        <_join>
86
                                            <1>$collectionCode</1>
87
                                            <2>$collectionID</2>
88
                                        </_join>
89
                                    </collectioncode_dwc>
90
                                    <institution_id><party><organizationname>$institutionCode</organizationname></party></institution_id>
91
                                    <sourceaccessioncode>$id</sourceaccessioncode>
92
                                </specimenreplicate>
93
                            </plantobservation>
94
                        </aggregateoccurrence>
95
                        <authortaxoncode>
96
                            <_alt>
97
                                <1>$recordNumber</1>
98
                                <2>$scientificName</2>
99
                            </_alt>
100
                        </authortaxoncode>
101
                        <taxondetermination>
102
                            <party_id>
103
                                <party>
104
                                    <givenname><_namePart><first>$identifiedBy</first></_namePart></givenname>
105
                                    <middlename><_namePart><middle>$identifiedBy</middle></_namePart></middlename>
106
                                    <surname><_namePart><last>$identifiedBy</last></_namePart></surname>
107
                                </party>
108
                            </party_id>
109
                            <plantconcept_id>
110
                                <plantconcept>
111
                                    <plantname_id>
112
                                        <_simplifyPath>
113
                                            <next>parent_id</next>
114
                                            <path>
116 115
                                                <plantname>
117
                                                    <rank>authority</rank>
118
                                                    <plantname>$scientificNameAuthorship</plantname>
116
                                                    <rank>binomial</rank>
117
                                                    <plantname>$scientificName</plantname>
119 118
                                                    <parent_id>
120 119
                                                        <plantname>
121
                                                            <rank>subspecies</rank>
122
                                                            <plantname>
123
                                                                <_name>
124
                                                                    <first>$taxonRank</first>
125
                                                                    <last>$infraspecificEpithet</last>
126
                                                                </_name>
127
                                                            </plantname>
120
                                                            <rank>authority</rank>
121
                                                            <plantname>$scientificNameAuthorship</plantname>
128 122
                                                            <parent_id>
129 123
                                                                <plantname>
130
                                                                    <rank>species</rank>
131
                                                                    <plantname>$specificEpithet</plantname>
124
                                                                    <rank>subspecies</rank>
125
                                                                    <plantname>
126
                                                                        <_name>
127
                                                                            <first>$taxonRank</first>
128
                                                                            <last>$infraspecificEpithet</last>
129
                                                                        </_name>
130
                                                                    </plantname>
132 131
                                                                    <parent_id>
133 132
                                                                        <plantname>
134
                                                                            <rank>genus</rank>
135
                                                                            <plantname>$genus</plantname>
133
                                                                            <rank>species</rank>
134
                                                                            <plantname>$specificEpithet</plantname>
136 135
                                                                            <parent_id>
137 136
                                                                                <plantname>
138
                                                                                    <rank>family</rank>
139
                                                                                    <plantname>$family</plantname>
137
                                                                                    <rank>genus</rank>
138
                                                                                    <plantname>$genus</plantname>
140 139
                                                                                    <parent_id>
141 140
                                                                                        <plantname>
142
                                                                                            <rank>order</rank>
143
                                                                                            <plantname>$order</plantname>
141
                                                                                            <rank>family</rank>
142
                                                                                            <plantname>$family</plantname>
144 143
                                                                                            <parent_id>
145 144
                                                                                                <plantname>
146
                                                                                                    <rank>class</rank>
147
                                                                                                    <plantname>$class</plantname>
145
                                                                                                    <rank>order</rank>
146
                                                                                                    <plantname>$order</plantname>
148 147
                                                                                                    <parent_id>
149 148
                                                                                                        <plantname>
150
                                                                                                            <rank>subkingdom</rank>
151
                                                                                                            <plantname>$phylum</plantname>
149
                                                                                                            <rank>class</rank>
150
                                                                                                            <plantname>$class</plantname>
152 151
                                                                                                            <parent_id>
153 152
                                                                                                                <plantname>
154
                                                                                                                    <rank>kingdom</rank>
155
                                                                                                                    <plantname>$kingdom</plantname>
153
                                                                                                                    <rank>subkingdom</rank>
154
                                                                                                                    <plantname>$phylum</plantname>
155
                                                                                                                    <parent_id>
156
                                                                                                                        <plantname>
157
                                                                                                                            <rank>kingdom</rank>
158
                                                                                                                            <plantname>$kingdom</plantname>
159
                                                                                                                        </plantname>
160
                                                                                                                    </parent_id>
156 161
                                                                                                                </plantname>
157 162
                                                                                                            </parent_id>
158 163
                                                                                                        </plantname>
......
170 175
                                                        </plantname>
171 176
                                                    </parent_id>
172 177
                                                </plantname>
173
                                            </parent_id>
174
                                        </plantname>
175
                                    </path>
176
                                </_simplifyPath>
177
                            </plantname_id>
178
                        </plantconcept>
179
                    </plantconcept_id>
180
                    <determinationdate><_date><date><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></date></_date></determinationdate>
181
                </taxondetermination>
182
                <verbatimcollectorname>$recordedBy</verbatimcollectorname>
183
            </taxonoccurrence>
184
        </locationevent>
185
        <locationnarrative>
186
            <_merge>
187
                <1>$locality</1>
188
                <3>
189
                    <_label>
190
                        <label>habitat</label>
191
                        <value>$habitat</value>
192
                    </_label>
193
                </3>
194
            </_merge>
195
        </locationnarrative>
196
    </location>
178
                                            </path>
179
                                        </_simplifyPath>
180
                                    </plantname_id>
181
                                </plantconcept>
182
                            </plantconcept_id>
183
                            <determinationdate><_date><date><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></date></_date></determinationdate>
184
                        </taxondetermination>
185
                        <verbatimcollectorname>$recordedBy</verbatimcollectorname>
186
                    </taxonoccurrence>
187
                </locationevent>
188
                <locationnarrative>
189
                    <_merge>
190
                        <1>$locality</1>
191
                        <3>
192
                            <_label>
193
                                <label>habitat</label>
194
                                <value>$habitat</value>
195
                            </_label>
196
                        </3>
197
                    </_merge>
198
                </locationnarrative>
199
            </location>
200
        </path>
201
    </_simplifyPath>
197 202
</VegBIEN>
198 203
Inserted 39 new rows into database

Also available in: Unified diff