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>$museumaccessionnumber</authorlocationcode>
5
        <locationevent>
6
            <sourceaccessioncode>$observation_id</sourceaccessioncode>
7
            <taxonoccurrence>
8
                <aggregateoccurrence>
9
                    <collectiondate><_date><date>$collectiondate</date></_date></collectiondate>
10
                    <notes>$notes</notes>
11
                    <plantobservation><specimenreplicate><catalognumber_dwc>$museumaccessionnumber</catalognumber_dwc></specimenreplicate></plantobservation>
12
                </aggregateoccurrence>
13
                <authortaxoncode>$authorplantname</authortaxoncode>
14
                <sourceaccessioncode>$taxonobservation_id</sourceaccessioncode>
15
                <taxondetermination>
16
                    <plantconcept_id>
17
                        <plantconcept>
18
                            <plantname_id>
19
                                <_simplifyPath>
20
                                    <next>parent_id</next>
21
                                    <path>
22
                                        <plantname>
23
                                            <rank>binomial</rank>
24
                                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>$museumaccessionnumber</authorlocationcode>
8
                <locationevent>
9
                    <sourceaccessioncode>$observation_id</sourceaccessioncode>
10
                    <taxonoccurrence>
11
                        <aggregateoccurrence>
12
                            <collectiondate><_date><date>$collectiondate</date></_date></collectiondate>
13
                            <notes>$notes</notes>
14
                            <plantobservation><specimenreplicate><catalognumber_dwc>$museumaccessionnumber</catalognumber_dwc></specimenreplicate></plantobservation>
15
                        </aggregateoccurrence>
16
                        <authortaxoncode>$authorplantname</authortaxoncode>
17
                        <sourceaccessioncode>$taxonobservation_id</sourceaccessioncode>
18
                        <taxondetermination>
19
                            <plantconcept_id>
20
                                <plantconcept>
21
                                    <plantname_id>
22
                                        <_simplifyPath>
23
                                            <next>parent_id</next>
24
                                            <path>
25 25
                                                <plantname>
26
                                                    <rank>authority</rank>
26
                                                    <rank>binomial</rank>
27 27
                                                    <parent_id>
28 28
                                                        <plantname>
29
                                                            <rank>subspecies</rank>
30
                                                            <plantname>$Subspecies</plantname>
29
                                                            <rank>authority</rank>
31 30
                                                            <parent_id>
32 31
                                                                <plantname>
33
                                                                    <rank>species</rank>
34
                                                                    <plantname>$Species</plantname>
32
                                                                    <rank>subspecies</rank>
33
                                                                    <plantname>$Subspecies</plantname>
35 34
                                                                    <parent_id>
36 35
                                                                        <plantname>
37
                                                                            <rank>genus</rank>
38
                                                                            <plantname>$Genus</plantname>
36
                                                                            <rank>species</rank>
37
                                                                            <plantname>$Species</plantname>
39 38
                                                                            <parent_id>
40 39
                                                                                <plantname>
41
                                                                                    <rank>family</rank>
42
                                                                                    <plantname>$Family</plantname>
40
                                                                                    <rank>genus</rank>
41
                                                                                    <plantname>$Genus</plantname>
43 42
                                                                                    <parent_id>
44 43
                                                                                        <plantname>
45
                                                                                            <rank>order</rank>
46
                                                                                            <plantname>$Order</plantname>
44
                                                                                            <rank>family</rank>
45
                                                                                            <plantname>$Family</plantname>
47 46
                                                                                            <parent_id>
48 47
                                                                                                <plantname>
49
                                                                                                    <rank>class</rank>
50
                                                                                                    <plantname>$Class</plantname>
48
                                                                                                    <rank>order</rank>
49
                                                                                                    <plantname>$Order</plantname>
51 50
                                                                                                    <parent_id>
52 51
                                                                                                        <plantname>
53
                                                                                                            <rank>subkingdom</rank>
52
                                                                                                            <rank>class</rank>
53
                                                                                                            <plantname>$Class</plantname>
54 54
                                                                                                            <parent_id>
55 55
                                                                                                                <plantname>
56
                                                                                                                    <rank>kingdom</rank>
57
                                                                                                                    <plantname>$Kingdom</plantname>
56
                                                                                                                    <rank>subkingdom</rank>
57
                                                                                                                    <parent_id>
58
                                                                                                                        <plantname>
59
                                                                                                                            <rank>kingdom</rank>
60
                                                                                                                            <plantname>$Kingdom</plantname>
61
                                                                                                                        </plantname>
62
                                                                                                                    </parent_id>
58 63
                                                                                                                </plantname>
59 64
                                                                                                            </parent_id>
60 65
                                                                                                        </plantname>
......
72 77
                                                        </plantname>
73 78
                                                    </parent_id>
74 79
                                                </plantname>
75
                                            </parent_id>
76
                                        </plantname>
77
                                    </path>
78
                                </_simplifyPath>
79
                            </plantname_id>
80
                        </plantconcept>
81
                    </plantconcept_id>
82
                    <determinationdate><_date><date><_dateRangeStart><value>$interpretationdate</value></_dateRangeStart></date></_date></determinationdate>
83
                    <taxonfit>$taxonfit</taxonfit>
84
                </taxondetermination>
85
                <taxondetermination>
86
                    <isoriginal>true</isoriginal>
87
                    <plantconcept_id>
88
                        <plantconcept>
89
                            <plantname_id>
90
                                <_simplifyPath>
91
                                    <next>parent_id</next>
92
                                    <path>
93
                                        <plantname>
94
                                            <rank>binomial</rank>
95
                                            <plantname>$authorplantname</plantname>
96
                                        </plantname>
97
                                    </path>
98
                                </_simplifyPath>
99
                            </plantname_id>
100
                        </plantconcept>
101
                    </plantconcept_id>
102
                </taxondetermination>
103
            </taxonoccurrence>
104
        </locationevent>
105
    </location>
80
                                            </path>
81
                                        </_simplifyPath>
82
                                    </plantname_id>
83
                                </plantconcept>
84
                            </plantconcept_id>
85
                            <determinationdate><_date><date><_dateRangeStart><value>$interpretationdate</value></_dateRangeStart></date></_date></determinationdate>
86
                            <taxonfit>$taxonfit</taxonfit>
87
                        </taxondetermination>
88
                        <taxondetermination>
89
                            <isoriginal>true</isoriginal>
90
                            <plantconcept_id>
91
                                <plantconcept>
92
                                    <plantname_id>
93
                                        <_simplifyPath>
94
                                            <next>parent_id</next>
95
                                            <path>
96
                                                <plantname>
97
                                                    <rank>binomial</rank>
98
                                                    <plantname>$authorplantname</plantname>
99
                                                </plantname>
100
                                            </path>
101
                                        </_simplifyPath>
102
                                    </plantname_id>
103
                                </plantconcept>
104
                            </plantconcept_id>
105
                        </taxondetermination>
106
                    </taxonoccurrence>
107
                </locationevent>
108
            </location>
109
        </path>
110
    </_simplifyPath>
106 111
</VegBIEN>
107 112
Inserted 19 new rows into database

Also available in: Unified diff