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>$authorplotcode</authorlocationcode>
5
        <sourceaccessioncode>$plot_id</sourceaccessioncode>
6
        <area>$area</area>
7
        <elevation>
8
            <_replace>
9
                <\bca\.?></\bca\.?>
10
                <value>$elevation</value>
11
            </_replace>
12
        </elevation>
13
        <landform>$landform</landform>
14
        <locationdetermination>
15
            <coordsaccuracy><_noCV><value>$locationaccuracy</value></_noCV></coordsaccuracy>
16
            <footprintgeometry_dwc>$shape</footprintgeometry_dwc>
17
            <latitude>
18
                <_nullIf>
19
                    <null>0</null>
20
                    <type>float</type>
21
                    <value>$latitude</value>
22
                </_nullIf>
23
            </latitude>
24
            <longitude>
25
                <_nullIf>
26
                    <null>0</null>
27
                    <type>float</type>
28
                    <value>$longitude</value>
29
                </_nullIf>
30
            </longitude>
31
            <namedplace_id>
32
                <_simplifyPath>
33
                    <next>parent_id</next>
34
                    <path>
35
                        <namedplace>
36
                            <rank>county</rank>
37
                            <placename>$county</placename>
38
                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>$authorplotcode</authorlocationcode>
8
                <sourceaccessioncode>$plot_id</sourceaccessioncode>
9
                <area>$area</area>
10
                <elevation>
11
                    <_replace>
12
                        <\bca\.?></\bca\.?>
13
                        <value>$elevation</value>
14
                    </_replace>
15
                </elevation>
16
                <landform>$landform</landform>
17
                <locationdetermination>
18
                    <coordsaccuracy><_noCV><value>$locationaccuracy</value></_noCV></coordsaccuracy>
19
                    <footprintgeometry_dwc>$shape</footprintgeometry_dwc>
20
                    <latitude>
21
                        <_nullIf>
22
                            <null>0</null>
23
                            <type>float</type>
24
                            <value>$latitude</value>
25
                        </_nullIf>
26
                    </latitude>
27
                    <longitude>
28
                        <_nullIf>
29
                            <null>0</null>
30
                            <type>float</type>
31
                            <value>$longitude</value>
32
                        </_nullIf>
33
                    </longitude>
34
                    <namedplace_id>
35
                        <_simplifyPath>
36
                            <next>parent_id</next>
37
                            <path>
39 38
                                <namedplace>
40
                                    <rank>stateProvince</rank>
41
                                    <placename>
42
                                        <_alt>
43
                                            <0>$region|state|province</0>
44
                                            <1>$stateprovince</1>
45
                                        </_alt>
46
                                    </placename>
39
                                    <rank>county</rank>
40
                                    <placename>$county</placename>
47 41
                                    <parent_id>
48 42
                                        <namedplace>
49
                                            <rank>country</rank>
43
                                            <rank>stateProvince</rank>
50 44
                                            <placename>
51 45
                                                <_alt>
52
                                                    <0>$area|country|territory</0>
53
                                                    <1>$country</1>
46
                                                    <0>$region|state|province</0>
47
                                                    <1>$stateprovince</1>
54 48
                                                </_alt>
55 49
                                            </placename>
56 50
                                            <parent_id>
57 51
                                                <namedplace>
58
                                                    <rank>continent</rank>
59
                                                    <placename>$continent</placename>
52
                                                    <rank>country</rank>
53
                                                    <placename>
54
                                                        <_alt>
55
                                                            <0>$area|country|territory</0>
56
                                                            <1>$country</1>
57
                                                        </_alt>
58
                                                    </placename>
59
                                                    <parent_id>
60
                                                        <namedplace>
61
                                                            <rank>continent</rank>
62
                                                            <placename>$continent</placename>
63
                                                        </namedplace>
64
                                                    </parent_id>
60 65
                                                </namedplace>
61 66
                                            </parent_id>
62 67
                                        </namedplace>
63 68
                                    </parent_id>
64 69
                                </namedplace>
65
                            </parent_id>
66
                        </namedplace>
67
                    </path>
68
                </_simplifyPath>
69
            </namedplace_id>
70
        </locationdetermination>
71
        <locationnarrative>$locationnarrative</locationnarrative>
72
        <slopeaspect>
73
            <_alt>
74
                <1><_compass><value>$slopeaspect</value></_compass></1>
75
                <2>
76
                    <_avg>
77
                        <max>$maxslopeaspect</max>
78
                        <min>$minslopeaspect</min>
79
                    </_avg>
80
                </2>
81
            </_alt>
82
        </slopeaspect>
83
        <slopegradient>
84
            <_alt>
85
                <1>$slopegradient</1>
86
                <2>
87
                    <_avg>
88
                        <max>$maxslopegradient</max>
89
                        <min>$minslopegradient</min>
90
                    </_avg>
91
                </2>
92
            </_alt>
93
        </slopegradient>
94
    </location>
70
                            </path>
71
                        </_simplifyPath>
72
                    </namedplace_id>
73
                </locationdetermination>
74
                <locationnarrative>$locationnarrative</locationnarrative>
75
                <slopeaspect>
76
                    <_alt>
77
                        <1><_compass><value>$slopeaspect</value></_compass></1>
78
                        <2>
79
                            <_avg>
80
                                <max>$maxslopeaspect</max>
81
                                <min>$minslopeaspect</min>
82
                            </_avg>
83
                        </2>
84
                    </_alt>
85
                </slopeaspect>
86
                <slopegradient>
87
                    <_alt>
88
                        <1>$slopegradient</1>
89
                        <2>
90
                            <_avg>
91
                                <max>$maxslopegradient</max>
92
                                <min>$minslopegradient</min>
93
                            </_avg>
94
                        </2>
95
                    </_alt>
96
                </slopegradient>
97
            </location>
98
        </path>
99
    </_simplifyPath>
95 100
</VegBIEN>
96 101
Inserted 7 new rows into database

Also available in: Unified diff