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
        <sourceaccessioncode>$PlotCD</sourceaccessioncode>
5
        <locationdetermination>
6
            <latitude>
7
                <_nullIf>
8
                    <null>0</null>
9
                    <type>float</type>
10
                    <value>$DecimalLatitude</value>
11
                </_nullIf>
12
            </latitude>
13
            <longitude>
14
                <_nullIf>
15
                    <null>0</null>
16
                    <type>float</type>
17
                    <value>$DecimalLongitude</value>
18
                </_nullIf>
19
            </longitude>
20
            <namedplace_id>
21
                <_simplifyPath>
22
                    <next>parent_id</next>
23
                    <path>
24
                        <namedplace>
25
                            <rank>county</rank>
26
                            <placename>$County</placename>
27
                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <sourceaccessioncode>$PlotCD</sourceaccessioncode>
8
                <locationdetermination>
9
                    <latitude>
10
                        <_nullIf>
11
                            <null>0</null>
12
                            <type>float</type>
13
                            <value>$DecimalLatitude</value>
14
                        </_nullIf>
15
                    </latitude>
16
                    <longitude>
17
                        <_nullIf>
18
                            <null>0</null>
19
                            <type>float</type>
20
                            <value>$DecimalLongitude</value>
21
                        </_nullIf>
22
                    </longitude>
23
                    <namedplace_id>
24
                        <_simplifyPath>
25
                            <next>parent_id</next>
26
                            <path>
28 27
                                <namedplace>
29
                                    <rank>stateProvince</rank>
30
                                    <placename>$StateProvince</placename>
28
                                    <rank>county</rank>
29
                                    <placename>$County</placename>
30
                                    <parent_id>
31
                                        <namedplace>
32
                                            <rank>stateProvince</rank>
33
                                            <placename>$StateProvince</placename>
34
                                        </namedplace>
35
                                    </parent_id>
31 36
                                </namedplace>
32
                            </parent_id>
33
                        </namedplace>
34
                    </path>
35
                </_simplifyPath>
36
            </namedplace_id>
37
        </locationdetermination>
38
        <locationevent>
39
            <taxonoccurrence>
40
                <aggregateoccurrence>
41
                    <collectiondate>
42
                        <_date>
43
                            <day>
44
                                <_nullIf>
45
                                    <null>0</null>
46
                                    <type>float</type>
47
                                    <value>$MeasDay</value>
48
                                </_nullIf>
49
                            </day>
50
                            <month>
51
                                <_nullIf>
52
                                    <null>0</null>
53
                                    <type>float</type>
54
                                    <value>$MeasMon</value>
55
                                </_nullIf>
56
                            </month>
57
                            <year>
58
                                <_nullIf>
59
                                    <null>0</null>
60
                                    <type>float</type>
61
                                    <value>$MeasYear</value>
62
                                </_nullIf>
63
                            </year>
64
                        </_date>
65
                    </collectiondate>
66
                    <plantobservation>
67
                        <stemobservation>
68
                            <basaldiameter>$BasalDiameter</basaldiameter>
69
                            <diameterbreastheight>$DBH</diameterbreastheight>
70
                            <height>$Height</height>
71
                            <stemtag>
72
                                <iscurrent>true</iscurrent>
73
                                <tag>$TreeTag</tag>
74
                            </stemtag>
75
                        </stemobservation>
76
                    </plantobservation>
77
                </aggregateoccurrence>
78
                <taxondetermination>
79
                    <plantconcept_id>
80
                        <plantconcept>
81
                            <plantname_id>
82
                                <_simplifyPath>
83
                                    <next>parent_id</next>
84
                                    <path>
85
                                        <plantname>
86
                                            <rank>binomial</rank>
87
                                            <parent_id>
37
                            </path>
38
                        </_simplifyPath>
39
                    </namedplace_id>
40
                </locationdetermination>
41
                <locationevent>
42
                    <taxonoccurrence>
43
                        <aggregateoccurrence>
44
                            <collectiondate>
45
                                <_date>
46
                                    <day>
47
                                        <_nullIf>
48
                                            <null>0</null>
49
                                            <type>float</type>
50
                                            <value>$MeasDay</value>
51
                                        </_nullIf>
52
                                    </day>
53
                                    <month>
54
                                        <_nullIf>
55
                                            <null>0</null>
56
                                            <type>float</type>
57
                                            <value>$MeasMon</value>
58
                                        </_nullIf>
59
                                    </month>
60
                                    <year>
61
                                        <_nullIf>
62
                                            <null>0</null>
63
                                            <type>float</type>
64
                                            <value>$MeasYear</value>
65
                                        </_nullIf>
66
                                    </year>
67
                                </_date>
68
                            </collectiondate>
69
                            <plantobservation>
70
                                <stemobservation>
71
                                    <basaldiameter>$BasalDiameter</basaldiameter>
72
                                    <diameterbreastheight>$DBH</diameterbreastheight>
73
                                    <height>$Height</height>
74
                                    <stemtag>
75
                                        <iscurrent>true</iscurrent>
76
                                        <tag>$TreeTag</tag>
77
                                    </stemtag>
78
                                </stemobservation>
79
                            </plantobservation>
80
                        </aggregateoccurrence>
81
                        <taxondetermination>
82
                            <plantconcept_id>
83
                                <plantconcept>
84
                                    <plantname_id>
85
                                        <_simplifyPath>
86
                                            <next>parent_id</next>
87
                                            <path>
88 88
                                                <plantname>
89
                                                    <rank>authority</rank>
89
                                                    <rank>binomial</rank>
90 90
                                                    <parent_id>
91 91
                                                        <plantname>
92
                                                            <rank>subspecies</rank>
92
                                                            <rank>authority</rank>
93 93
                                                            <parent_id>
94 94
                                                                <plantname>
95
                                                                    <rank>species</rank>
96
                                                                    <plantname>$SpecificEpithet</plantname>
95
                                                                    <rank>subspecies</rank>
97 96
                                                                    <parent_id>
98 97
                                                                        <plantname>
99
                                                                            <rank>genus</rank>
100
                                                                            <plantname>$Genus</plantname>
98
                                                                            <rank>species</rank>
99
                                                                            <plantname>$SpecificEpithet</plantname>
100
                                                                            <parent_id>
101
                                                                                <plantname>
102
                                                                                    <rank>genus</rank>
103
                                                                                    <plantname>$Genus</plantname>
104
                                                                                </plantname>
105
                                                                            </parent_id>
101 106
                                                                        </plantname>
102 107
                                                                    </parent_id>
103 108
                                                                </plantname>
......
105 110
                                                        </plantname>
106 111
                                                    </parent_id>
107 112
                                                </plantname>
108
                                            </parent_id>
109
                                        </plantname>
110
                                    </path>
111
                                </_simplifyPath>
112
                            </plantname_id>
113
                        </plantconcept>
114
                    </plantconcept_id>
115
                </taxondetermination>
116
            </taxonoccurrence>
117
        </locationevent>
118
    </location>
113
                                            </path>
114
                                        </_simplifyPath>
115
                                    </plantname_id>
116
                                </plantconcept>
117
                            </plantconcept_id>
118
                        </taxondetermination>
119
                    </taxonoccurrence>
120
                </locationevent>
121
            </location>
122
        </path>
123
    </_simplifyPath>
119 124
</VegBIEN>
120 125
Inserted 15 new rows into database

Also available in: Unified diff