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>
5
            <_alt>
6
                <1>$id</1>
7
                <2>
8
                    <_join>
9
                        <1>$institutionCode</1>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_alt>
9
                        <1>$id</1>
10 10
                        <2>
11 11
                            <_join>
12
                                <1>$collectionCode</1>
13
                                <2>$collectionID</2>
12
                                <1>$institutionCode</1>
13
                                <2>
14
                                    <_join>
15
                                        <1>$collectionCode</1>
16
                                        <2>$collectionID</2>
17
                                    </_join>
18
                                </2>
14 19
                            </_join>
15 20
                        </2>
16
                    </_join>
17
                </2>
18
            </_alt>
19
        </authorlocationcode>
20
        <locationdetermination>
21
            <namedplace_id>
22
                <_simplifyPath>
23
                    <next>parent_id</next>
24
                    <path>
25
                        <namedplace>
26
                            <rank>county</rank>
27
                            <parent_id>
21
                    </_alt>
22
                </authorlocationcode>
23
                <locationdetermination>
24
                    <namedplace_id>
25
                        <_simplifyPath>
26
                            <next>parent_id</next>
27
                            <path>
28 28
                                <namedplace>
29
                                    <rank>stateProvince</rank>
29
                                    <rank>county</rank>
30 30
                                    <parent_id>
31 31
                                        <namedplace>
32
                                            <rank>country</rank>
32
                                            <rank>stateProvince</rank>
33 33
                                            <parent_id>
34 34
                                                <namedplace>
35
                                                    <rank>continent</rank>
36
                                                    <placename>$continent</placename>
35
                                                    <rank>country</rank>
36
                                                    <parent_id>
37
                                                        <namedplace>
38
                                                            <rank>continent</rank>
39
                                                            <placename>$continent</placename>
40
                                                        </namedplace>
41
                                                    </parent_id>
37 42
                                                </namedplace>
38 43
                                            </parent_id>
39 44
                                        </namedplace>
40 45
                                    </parent_id>
41 46
                                </namedplace>
42
                            </parent_id>
43
                        </namedplace>
44
                    </path>
45
                </_simplifyPath>
46
            </namedplace_id>
47
        </locationdetermination>
48
        <locationevent>
49
            <taxonoccurrence>
50
                <aggregateoccurrence>
51
                    <count>$individualCount</count>
52
                    <plantobservation>
53
                        <specimenreplicate>
54
                            <collectioncode_dwc>
55
                                <_join>
56
                                    <1>$collectionCode</1>
57
                                    <2>$collectionID</2>
58
                                </_join>
59
                            </collectioncode_dwc>
60
                            <institution_id><party><organizationname>$institutionCode</organizationname></party></institution_id>
61
                            <sourceaccessioncode>$id</sourceaccessioncode>
62
                        </specimenreplicate>
63
                    </plantobservation>
64
                </aggregateoccurrence>
65
                <iscultivated>
66
                    <_map>
67
                        <cultivated>t</cultivated>
68
                        <wild>f</wild>
69
                        <*></*>
70
                        <value>$establishmentMeans</value>
71
                    </_map>
72
                </iscultivated>
73
                <isnative>
74
                    <_map>
75
                        <native>t</native>
76
                        <exotic>f</exotic>
77
                        <*></*>
78
                        <value>$establishmentMeans</value>
79
                    </_map>
80
                </isnative>
81
                <taxondetermination>
82
                    <plantconcept_id>
83
                        <plantconcept>
84
                            <plantname_id>
85
                                <_simplifyPath>
86
                                    <next>parent_id</next>
87
                                    <path>
88
                                        <plantname>
89
                                            <rank>binomial</rank>
90
                                            <parent_id>
47
                            </path>
48
                        </_simplifyPath>
49
                    </namedplace_id>
50
                </locationdetermination>
51
                <locationevent>
52
                    <taxonoccurrence>
53
                        <aggregateoccurrence>
54
                            <count>$individualCount</count>
55
                            <plantobservation>
56
                                <specimenreplicate>
57
                                    <collectioncode_dwc>
58
                                        <_join>
59
                                            <1>$collectionCode</1>
60
                                            <2>$collectionID</2>
61
                                        </_join>
62
                                    </collectioncode_dwc>
63
                                    <institution_id><party><organizationname>$institutionCode</organizationname></party></institution_id>
64
                                    <sourceaccessioncode>$id</sourceaccessioncode>
65
                                </specimenreplicate>
66
                            </plantobservation>
67
                        </aggregateoccurrence>
68
                        <iscultivated>
69
                            <_map>
70
                                <cultivated>t</cultivated>
71
                                <wild>f</wild>
72
                                <*></*>
73
                                <value>$establishmentMeans</value>
74
                            </_map>
75
                        </iscultivated>
76
                        <isnative>
77
                            <_map>
78
                                <native>t</native>
79
                                <exotic>f</exotic>
80
                                <*></*>
81
                                <value>$establishmentMeans</value>
82
                            </_map>
83
                        </isnative>
84
                        <taxondetermination>
85
                            <plantconcept_id>
86
                                <plantconcept>
87
                                    <plantname_id>
88
                                        <_simplifyPath>
89
                                            <next>parent_id</next>
90
                                            <path>
91 91
                                                <plantname>
92
                                                    <rank>authority</rank>
92
                                                    <rank>binomial</rank>
93 93
                                                    <parent_id>
94 94
                                                        <plantname>
95
                                                            <rank>subspecies</rank>
95
                                                            <rank>authority</rank>
96 96
                                                            <parent_id>
97 97
                                                                <plantname>
98
                                                                    <rank>species</rank>
98
                                                                    <rank>subspecies</rank>
99 99
                                                                    <parent_id>
100 100
                                                                        <plantname>
101
                                                                            <rank>genus</rank>
102
                                                                            <plantname>$genus</plantname>
101
                                                                            <rank>species</rank>
103 102
                                                                            <parent_id>
104 103
                                                                                <plantname>
105
                                                                                    <rank>family</rank>
106
                                                                                    <plantname>$family</plantname>
104
                                                                                    <rank>genus</rank>
105
                                                                                    <plantname>$genus</plantname>
106
                                                                                    <parent_id>
107
                                                                                        <plantname>
108
                                                                                            <rank>family</rank>
109
                                                                                            <plantname>$family</plantname>
110
                                                                                        </plantname>
111
                                                                                    </parent_id>
107 112
                                                                                </plantname>
108 113
                                                                            </parent_id>
109 114
                                                                        </plantname>
......
113 118
                                                        </plantname>
114 119
                                                    </parent_id>
115 120
                                                </plantname>
116
                                            </parent_id>
117
                                        </plantname>
118
                                    </path>
119
                                </_simplifyPath>
120
                            </plantname_id>
121
                        </plantconcept>
122
                    </plantconcept_id>
123
                </taxondetermination>
124
            </taxonoccurrence>
125
        </locationevent>
126
        <locationnarrative>$locality</locationnarrative>
127
    </location>
121
                                            </path>
122
                                        </_simplifyPath>
123
                                    </plantname_id>
124
                                </plantconcept>
125
                            </plantconcept_id>
126
                        </taxondetermination>
127
                    </taxonoccurrence>
128
                </locationevent>
129
                <locationnarrative>$locality</locationnarrative>
130
            </location>
131
        </path>
132
    </_simplifyPath>
128 133
</VegBIEN>
129 134
Inserted 22 new rows into database

Also available in: Unified diff