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
        <parent_id><location><authorlocationcode>$1haPlotCode</authorlocationcode></location></parent_id>
5
        <authorlocationcode>$Subplot</authorlocationcode>
6
        <locationdetermination>
7
            <latitude>
8
                <_nullIf>
9
                    <null>0</null>
10
                    <type>float</type>
11
                    <value>$Latitude</value>
12
                </_nullIf>
13
            </latitude>
14
            <longitude>
15
                <_nullIf>
16
                    <null>0</null>
17
                    <type>float</type>
18
                    <value>$Longitude</value>
19
                </_nullIf>
20
            </longitude>
21
        </locationdetermination>
22
        <locationevent>
23
            <method_id><method><name>$Method</name></method></method_id>
24
            <project_id><project><projectname>$SiteName</projectname></project></project_id>
25
            <obsenddate><_date><date><_dateRangeEnd><value>$ObservationDate</value></_dateRangeEnd></date></_date></obsenddate>
26
            <obsstartdate><_date><date><_dateRangeStart><value>$ObservationDate</value></_dateRangeStart></date></_date></obsstartdate>
27
            <taxonoccurrence>
28
                <aggregateoccurrence>
29
                    <plantobservation>
30
                        <specimenreplicate><sourceaccessioncode>$ID</sourceaccessioncode></specimenreplicate>
31
                        <stemobservation>
32
                            <diameterbreastheight>$dbh</diameterbreastheight>
33
                            <stemtag>
34
                                <iscurrent>true</iscurrent>
35
                                <tag>$TreeNumber</tag>
36
                            </stemtag>
37
                            <xposition>$X_1haPlot</xposition>
38
                            <yposition>$Y_1haPlot</yposition>
39
                        </stemobservation>
40
                    </plantobservation>
41
                </aggregateoccurrence>
42
                <taxondetermination>
43
                    <plantconcept_id>
44
                        <plantconcept>
45
                            <plantname_id>
46
                                <_simplifyPath>
47
                                    <next>parent_id</next>
48
                                    <path>
49
                                        <plantname>
50
                                            <rank>binomial</rank>
51
                                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <parent_id><location><authorlocationcode>$1haPlotCode</authorlocationcode></location></parent_id>
8
                <authorlocationcode>$Subplot</authorlocationcode>
9
                <locationdetermination>
10
                    <latitude>
11
                        <_nullIf>
12
                            <null>0</null>
13
                            <type>float</type>
14
                            <value>$Latitude</value>
15
                        </_nullIf>
16
                    </latitude>
17
                    <longitude>
18
                        <_nullIf>
19
                            <null>0</null>
20
                            <type>float</type>
21
                            <value>$Longitude</value>
22
                        </_nullIf>
23
                    </longitude>
24
                </locationdetermination>
25
                <locationevent>
26
                    <method_id><method><name>$Method</name></method></method_id>
27
                    <project_id><project><projectname>$SiteName</projectname></project></project_id>
28
                    <obsenddate><_date><date><_dateRangeEnd><value>$ObservationDate</value></_dateRangeEnd></date></_date></obsenddate>
29
                    <obsstartdate><_date><date><_dateRangeStart><value>$ObservationDate</value></_dateRangeStart></date></_date></obsstartdate>
30
                    <taxonoccurrence>
31
                        <aggregateoccurrence>
32
                            <plantobservation>
33
                                <specimenreplicate><sourceaccessioncode>$ID</sourceaccessioncode></specimenreplicate>
34
                                <stemobservation>
35
                                    <diameterbreastheight>$dbh</diameterbreastheight>
36
                                    <stemtag>
37
                                        <iscurrent>true</iscurrent>
38
                                        <tag>$TreeNumber</tag>
39
                                    </stemtag>
40
                                    <xposition>$X_1haPlot</xposition>
41
                                    <yposition>$Y_1haPlot</yposition>
42
                                </stemobservation>
43
                            </plantobservation>
44
                        </aggregateoccurrence>
45
                        <taxondetermination>
46
                            <plantconcept_id>
47
                                <plantconcept>
48
                                    <plantname_id>
49
                                        <_simplifyPath>
50
                                            <next>parent_id</next>
51
                                            <path>
52 52
                                                <plantname>
53
                                                    <rank>authority</rank>
53
                                                    <rank>binomial</rank>
54 54
                                                    <parent_id>
55 55
                                                        <plantname>
56
                                                            <rank>subspecies</rank>
56
                                                            <rank>authority</rank>
57 57
                                                            <parent_id>
58 58
                                                                <plantname>
59
                                                                    <rank>species</rank>
60
                                                                    <plantname>$SpecificEpithet</plantname>
59
                                                                    <rank>subspecies</rank>
61 60
                                                                    <parent_id>
62 61
                                                                        <plantname>
63
                                                                            <rank>genus</rank>
64
                                                                            <plantname>$Genus</plantname>
62
                                                                            <rank>species</rank>
63
                                                                            <plantname>$SpecificEpithet</plantname>
65 64
                                                                            <parent_id>
66 65
                                                                                <plantname>
67
                                                                                    <rank>family</rank>
68
                                                                                    <plantname>$Family</plantname>
66
                                                                                    <rank>genus</rank>
67
                                                                                    <plantname>$Genus</plantname>
68
                                                                                    <parent_id>
69
                                                                                        <plantname>
70
                                                                                            <rank>family</rank>
71
                                                                                            <plantname>$Family</plantname>
72
                                                                                        </plantname>
73
                                                                                    </parent_id>
69 74
                                                                                </plantname>
70 75
                                                                            </parent_id>
71 76
                                                                        </plantname>
......
75 80
                                                        </plantname>
76 81
                                                    </parent_id>
77 82
                                                </plantname>
78
                                            </parent_id>
79
                                        </plantname>
80
                                    </path>
81
                                </_simplifyPath>
82
                            </plantname_id>
83
                        </plantconcept>
84
                    </plantconcept_id>
85
                </taxondetermination>
86
                <verbatimcollectorname>$Collectors</verbatimcollectorname>
87
            </taxonoccurrence>
88
        </locationevent>
89
    </location>
83
                                            </path>
84
                                        </_simplifyPath>
85
                                    </plantname_id>
86
                                </plantconcept>
87
                            </plantconcept_id>
88
                        </taxondetermination>
89
                        <verbatimcollectorname>$Collectors</verbatimcollectorname>
90
                    </taxonoccurrence>
91
                </locationevent>
92
            </location>
93
        </path>
94
    </_simplifyPath>
90 95
</VegBIEN>
91 96
Inserted 23 new rows into database

Also available in: Unified diff