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>$plot_code</authorlocationcode>
5
        <sourceaccessioncode>$PLOT_ID</sourceaccessioncode>
6
        <area>$plot_area_ha</area>
7
        <elevation>
8
            <_alt>
9
                <1>
10
                    <_replace>
11
                        <\bca\.?></\bca\.?>
12
                        <value>$elev_m</value>
13
                    </_replace>
14
                </1>
15
                <2>
16
                    <_avg>
17
                        <max>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>$plot_code</authorlocationcode>
8
                <sourceaccessioncode>$PLOT_ID</sourceaccessioncode>
9
                <area>$plot_area_ha</area>
10
                <elevation>
11
                    <_alt>
12
                        <1>
13
                            <_replace>
14
                                <\bca\.?></\bca\.?>
15
                                <value>$elev_m</value>
16
                            </_replace>
17
                        </1>
18
                        <2>
19
                            <_avg>
20
                                <max>
21
                                    <_units>
22
                                        <default>m</default>
23
                                        <to>m</to>
24
                                        <to></to>
25
                                        <value>
26
                                            <_replace>
27
                                                <\bca\.?></\bca\.?>
28
                                                <value>$elev_max_m</value>
29
                                            </_replace>
30
                                        </value>
31
                                    </_units>
32
                                </max>
33
                                <min>
34
                                    <_units>
35
                                        <default>m</default>
36
                                        <to>m</to>
37
                                        <to></to>
38
                                        <value>
39
                                            <_rangeStart>
40
                                                <value>
41
                                                    <_replace>
42
                                                        <\bca\.?></\bca\.?>
43
                                                        <value>$elev_min_m</value>
44
                                                    </_replace>
45
                                                </value>
46
                                            </_rangeStart>
47
                                        </value>
48
                                    </_units>
49
                                </min>
50
                            </_avg>
51
                        </2>
52
                    </_alt>
53
                </elevation>
54
                <elevationrange>
55
                    <_range>
56
                        <from>
18 57
                            <_units>
19 58
                                <default>m</default>
20 59
                                <to>m</to>
21 60
                                <to></to>
22 61
                                <value>
23
                                    <_replace>
24
                                        <\bca\.?></\bca\.?>
25
                                        <value>$elev_max_m</value>
26
                                    </_replace>
27
                                </value>
28
                            </_units>
29
                        </max>
30
                        <min>
31
                            <_units>
32
                                <default>m</default>
33
                                <to>m</to>
34
                                <to></to>
35
                                <value>
36 62
                                    <_rangeStart>
37 63
                                        <value>
38 64
                                            <_replace>
......
43 69
                                    </_rangeStart>
44 70
                                </value>
45 71
                            </_units>
46
                        </min>
47
                    </_avg>
48
                </2>
49
            </_alt>
50
        </elevation>
51
        <elevationrange>
52
            <_range>
53
                <from>
54
                    <_units>
55
                        <default>m</default>
56
                        <to>m</to>
57
                        <to></to>
58
                        <value>
59
                            <_rangeStart>
72
                        </from>
73
                        <to>
74
                            <_units>
75
                                <default>m</default>
76
                                <to>m</to>
77
                                <to></to>
60 78
                                <value>
61
                                    <_replace>
62
                                        <\bca\.?></\bca\.?>
63
                                        <value>$elev_min_m</value>
64
                                    </_replace>
65
                                </value>
66
                            </_rangeStart>
67
                        </value>
68
                    </_units>
69
                </from>
70
                <to>
71
                    <_units>
72
                        <default>m</default>
73
                        <to>m</to>
74
                        <to></to>
75
                        <value>
76
                            <_alt>
77
                                <1>
78
                                    <_replace>
79
                                        <\bca\.?></\bca\.?>
80
                                        <value>$elev_max_m</value>
81
                                    </_replace>
82
                                </1>
83
                                <2>
84
                                    <_rangeEnd>
85
                                        <value>
79
                                    <_alt>
80
                                        <1>
86 81
                                            <_replace>
87 82
                                                <\bca\.?></\bca\.?>
88
                                                <value>$elev_min_m</value>
83
                                                <value>$elev_max_m</value>
89 84
                                            </_replace>
90
                                        </value>
91
                                    </_rangeEnd>
92
                                </2>
93
                            </_alt>
94
                        </value>
95
                    </_units>
96
                </to>
97
            </_range>
98
        </elevationrange>
99
        <locationdetermination>
100
            <latitude>
101
                <_nullIf>
102
                    <null>0</null>
103
                    <type>float</type>
104
                    <value>$lat_decimal</value>
105
                </_nullIf>
106
            </latitude>
107
            <longitude>
108
                <_nullIf>
109
                    <null>0</null>
110
                    <type>float</type>
111
                    <value>$long_decimal</value>
112
                </_nullIf>
113
            </longitude>
114
            <namedplace_id>
115
                <_simplifyPath>
116
                    <next>parent_id</next>
117
                    <path>
118
                        <namedplace>
119
                            <rank>county</rank>
120
                            <placename>$pol2</placename>
121
                            <parent_id>
85
                                        </1>
86
                                        <2>
87
                                            <_rangeEnd>
88
                                                <value>
89
                                                    <_replace>
90
                                                        <\bca\.?></\bca\.?>
91
                                                        <value>$elev_min_m</value>
92
                                                    </_replace>
93
                                                </value>
94
                                            </_rangeEnd>
95
                                        </2>
96
                                    </_alt>
97
                                </value>
98
                            </_units>
99
                        </to>
100
                    </_range>
101
                </elevationrange>
102
                <locationdetermination>
103
                    <latitude>
104
                        <_nullIf>
105
                            <null>0</null>
106
                            <type>float</type>
107
                            <value>$lat_decimal</value>
108
                        </_nullIf>
109
                    </latitude>
110
                    <longitude>
111
                        <_nullIf>
112
                            <null>0</null>
113
                            <type>float</type>
114
                            <value>$long_decimal</value>
115
                        </_nullIf>
116
                    </longitude>
117
                    <namedplace_id>
118
                        <_simplifyPath>
119
                            <next>parent_id</next>
120
                            <path>
122 121
                                <namedplace>
123
                                    <rank>stateProvince</rank>
124
                                    <placename>$pol1</placename>
122
                                    <rank>county</rank>
123
                                    <placename>$pol2</placename>
125 124
                                    <parent_id>
126 125
                                        <namedplace>
127
                                            <rank>country</rank>
128
                                            <placename>$country</placename>
126
                                            <rank>stateProvince</rank>
127
                                            <placename>$pol1</placename>
129 128
                                            <parent_id>
130 129
                                                <namedplace>
131
                                                    <rank>continent</rank>
132
                                                    <placename>$major_geo</placename>
130
                                                    <rank>country</rank>
131
                                                    <placename>$country</placename>
132
                                                    <parent_id>
133
                                                        <namedplace>
134
                                                            <rank>continent</rank>
135
                                                            <placename>$major_geo</placename>
136
                                                        </namedplace>
137
                                                    </parent_id>
133 138
                                                </namedplace>
134 139
                                            </parent_id>
135 140
                                        </namedplace>
136 141
                                    </parent_id>
137 142
                                </namedplace>
138
                            </parent_id>
139
                        </namedplace>
140
                    </path>
141
                </_simplifyPath>
142
            </namedplace_id>
143
        </locationdetermination>
144
        <locationevent>
145
            <method_id><method><name>$plot_methodology</name></method></method_id>
146
            <project_id><project><projectname>$project</projectname></project></project_id>
147
            <commclass>
148
                <commdetermination>
149
                    <commconcept_id>
150
                        <commconcept>
151
                            <commname_id><commname><commname>$holdridge_life_zone</commname></commname></commname_id>
152
                            <commdescription>$life_zone_code</commdescription>
153
                        </commconcept>
154
                    </commconcept_id>
155
                </commdetermination>
156
            </commclass>
157
            <obsenddate><_date><date>$date_finish</date></_date></obsenddate>
158
            <obsstartdate><_date><date>$date_start</date></_date></obsstartdate>
159
            <precipitation>$precip_mm</precipitation>
160
            <soilobs>
161
                <acidity>
162
                    <_units>
163
                        <default>%</default>
164
                        <to></to>
165
                        <value>
166
                            <_map>
167
                                <<0.05>0</<0.05>
168
                                <*>*</*>
169
                                <value>$soil_acidity</value>
170
                            </_map>
171
                        </value>
172
                    </_units>
173
                </acidity>
174
                <basesaturation>
175
                    <_units>
176
                        <default>%</default>
177
                        <to></to>
178
                        <value>$soil_base</value>
179
                    </_units>
180
                </basesaturation>
181
                <calcium>
182
                    <_units>
183
                        <default>%</default>
184
                        <to></to>
185
                        <value>$soil_Ca</value>
186
                    </_units>
187
                </calcium>
188
                <carbon>
189
                    <_units>
190
                        <default>%</default>
191
                        <to></to>
192
                        <value>$soil_C</value>
193
                    </_units>
194
                </carbon>
195
                <cationexchangecapacity>$soil_cation_cap</cationexchangecapacity>
196
                <clay>
197
                    <_units>
198
                        <default>%</default>
199
                        <to></to>
200
                        <value>$clay_percent</value>
201
                    </_units>
202
                </clay>
203
                <conductivity>$soil_conductivity</conductivity>
204
                <magnesium>
205
                    <_units>
206
                        <default>%</default>
207
                        <to></to>
208
                        <value>$soil_Mg</value>
209
                    </_units>
210
                </magnesium>
211
                <nitrogen>
212
                    <_units>
213
                        <default>%</default>
214
                        <to></to>
215
                        <value>$soil_N</value>
216
                    </_units>
217
                </nitrogen>
218
                <organic>
219
                    <_units>
220
                        <default>%</default>
221
                        <to></to>
222
                        <value>$organic_percent</value>
223
                    </_units>
224
                </organic>
225
                <ph>$pH</ph>
226
                <phosphorus>
227
                    <_units>
228
                        <default>%</default>
229
                        <to></to>
230
                        <value>
231
                            <_map>
232
                                <<1,5>0</<1,5>
233
                                <*>*</*>
234
                                <value>$soil_P</value>
235
                            </_map>
236
                        </value>
237
                    </_units>
238
                </phosphorus>
239
                <potassium>
240
                    <_units>
241
                        <default>%</default>
242
                        <to></to>
243
                        <value>$soil_K</value>
244
                    </_units>
245
                </potassium>
246
                <sand>
247
                    <_units>
248
                        <default>%</default>
249
                        <to></to>
250
                        <value>$sand_percent</value>
251
                    </_units>
252
                </sand>
253
                <silt>
254
                    <_units>
255
                        <default>%</default>
256
                        <to></to>
257
                        <value>$silt_percent</value>
258
                    </_units>
259
                </silt>
260
                <sodium>
261
                    <_units>
262
                        <default>%</default>
263
                        <to></to>
264
                        <value>$soil_Na</value>
265
                    </_units>
266
                </sodium>
267
                <texture>$soil_texture</texture>
268
            </soilobs>
269
            <temperature>$temp_c</temperature>
270
        </locationevent>
271
        <locationnarrative>$locality_description</locationnarrative>
272
        <slopeaspect><_compass><value>$slope_aspect</value></_compass></slopeaspect>
273
        <slopegradient>$slope_gradient</slopegradient>
274
    </location>
143
                            </path>
144
                        </_simplifyPath>
145
                    </namedplace_id>
146
                </locationdetermination>
147
                <locationevent>
148
                    <method_id><method><name>$plot_methodology</name></method></method_id>
149
                    <project_id><project><projectname>$project</projectname></project></project_id>
150
                    <commclass>
151
                        <commdetermination>
152
                            <commconcept_id>
153
                                <commconcept>
154
                                    <commname_id><commname><commname>$holdridge_life_zone</commname></commname></commname_id>
155
                                    <commdescription>$life_zone_code</commdescription>
156
                                </commconcept>
157
                            </commconcept_id>
158
                        </commdetermination>
159
                    </commclass>
160
                    <obsenddate><_date><date>$date_finish</date></_date></obsenddate>
161
                    <obsstartdate><_date><date>$date_start</date></_date></obsstartdate>
162
                    <precipitation>$precip_mm</precipitation>
163
                    <soilobs>
164
                        <acidity>
165
                            <_units>
166
                                <default>%</default>
167
                                <to></to>
168
                                <value>
169
                                    <_map>
170
                                        <<0.05>0</<0.05>
171
                                        <*>*</*>
172
                                        <value>$soil_acidity</value>
173
                                    </_map>
174
                                </value>
175
                            </_units>
176
                        </acidity>
177
                        <basesaturation>
178
                            <_units>
179
                                <default>%</default>
180
                                <to></to>
181
                                <value>$soil_base</value>
182
                            </_units>
183
                        </basesaturation>
184
                        <calcium>
185
                            <_units>
186
                                <default>%</default>
187
                                <to></to>
188
                                <value>$soil_Ca</value>
189
                            </_units>
190
                        </calcium>
191
                        <carbon>
192
                            <_units>
193
                                <default>%</default>
194
                                <to></to>
195
                                <value>$soil_C</value>
196
                            </_units>
197
                        </carbon>
198
                        <cationexchangecapacity>$soil_cation_cap</cationexchangecapacity>
199
                        <clay>
200
                            <_units>
201
                                <default>%</default>
202
                                <to></to>
203
                                <value>$clay_percent</value>
204
                            </_units>
205
                        </clay>
206
                        <conductivity>$soil_conductivity</conductivity>
207
                        <magnesium>
208
                            <_units>
209
                                <default>%</default>
210
                                <to></to>
211
                                <value>$soil_Mg</value>
212
                            </_units>
213
                        </magnesium>
214
                        <nitrogen>
215
                            <_units>
216
                                <default>%</default>
217
                                <to></to>
218
                                <value>$soil_N</value>
219
                            </_units>
220
                        </nitrogen>
221
                        <organic>
222
                            <_units>
223
                                <default>%</default>
224
                                <to></to>
225
                                <value>$organic_percent</value>
226
                            </_units>
227
                        </organic>
228
                        <ph>$pH</ph>
229
                        <phosphorus>
230
                            <_units>
231
                                <default>%</default>
232
                                <to></to>
233
                                <value>
234
                                    <_map>
235
                                        <<1,5>0</<1,5>
236
                                        <*>*</*>
237
                                        <value>$soil_P</value>
238
                                    </_map>
239
                                </value>
240
                            </_units>
241
                        </phosphorus>
242
                        <potassium>
243
                            <_units>
244
                                <default>%</default>
245
                                <to></to>
246
                                <value>$soil_K</value>
247
                            </_units>
248
                        </potassium>
249
                        <sand>
250
                            <_units>
251
                                <default>%</default>
252
                                <to></to>
253
                                <value>$sand_percent</value>
254
                            </_units>
255
                        </sand>
256
                        <silt>
257
                            <_units>
258
                                <default>%</default>
259
                                <to></to>
260
                                <value>$silt_percent</value>
261
                            </_units>
262
                        </silt>
263
                        <sodium>
264
                            <_units>
265
                                <default>%</default>
266
                                <to></to>
267
                                <value>$soil_Na</value>
268
                            </_units>
269
                        </sodium>
270
                        <texture>$soil_texture</texture>
271
                    </soilobs>
272
                    <temperature>$temp_c</temperature>
273
                </locationevent>
274
                <locationnarrative>$locality_description</locationnarrative>
275
                <slopeaspect><_compass><value>$slope_aspect</value></_compass></slopeaspect>
276
                <slopegradient>$slope_gradient</slopegradient>
277
            </location>
278
        </path>
279
    </_simplifyPath>
275 280
</VegBIEN>
276 281
Inserted 16 new rows into database

Also available in: Unified diff