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>$accession</1>
7
                <2>$herbarium</2>
8
            </_alt>
9
        </authorlocationcode>
10
        <locationdetermination>
11
            <namedplace_id>
12
                <_simplifyPath>
13
                    <next>parent_id</next>
14
                    <path>
15
                        <namedplace>
16
                            <rank>county</rank>
17
                            <placename>$county</placename>
18
                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_alt>
9
                        <1>$accession</1>
10
                        <2>$herbarium</2>
11
                    </_alt>
12
                </authorlocationcode>
13
                <locationdetermination>
14
                    <namedplace_id>
15
                        <_simplifyPath>
16
                            <next>parent_id</next>
17
                            <path>
19 18
                                <namedplace>
20
                                    <rank>stateProvince</rank>
21
                                    <placename>$state</placename>
19
                                    <rank>county</rank>
20
                                    <placename>$county</placename>
22 21
                                    <parent_id>
23 22
                                        <namedplace>
24
                                            <rank>country</rank>
25
                                            <placename>$country</placename>
23
                                            <rank>stateProvince</rank>
24
                                            <placename>$state</placename>
25
                                            <parent_id>
26
                                                <namedplace>
27
                                                    <rank>country</rank>
28
                                                    <placename>$country</placename>
29
                                                </namedplace>
30
                                            </parent_id>
26 31
                                        </namedplace>
27 32
                                    </parent_id>
28 33
                                </namedplace>
29
                            </parent_id>
30
                        </namedplace>
31
                    </path>
32
                </_simplifyPath>
33
            </namedplace_id>
34
        </locationdetermination>
35
        <locationevent>
36
            <taxonoccurrence>
37
                <aggregateoccurrence>
38
                    <collectiondate>
39
                        <_date>
40
                            <day>
41
                                <_nullIf>
42
                                    <null>0</null>
43
                                    <type>float</type>
44
                                    <value>$collday</value>
45
                                </_nullIf>
46
                            </day>
47
                            <month>
48
                                <_nullIf>
49
                                    <null>0</null>
50
                                    <type>float</type>
51
                                    <value>$collmonth</value>
52
                                </_nullIf>
53
                            </month>
54
                            <year>
55
                                <_nullIf>
56
                                    <null>0</null>
57
                                    <type>float</type>
58
                                    <value>$collyear</value>
59
                                </_nullIf>
60
                            </year>
61
                        </_date>
62
                    </collectiondate>
63
                    <notes>
64
                        <_merge>
65
                            <1>$comment1</1>
66
                            <2>$comment2</2>
67
                            <3>$comment3</3>
68
                            <4>$comment4</4>
69
                            <5>
70
                                <_label>
71
                                    <label>campus</label>
72
                                    <value>$campus</value>
73
                                </_label>
74
                            </5>
75
                            <6>
76
                                <_label>
77
                                    <label>loaned to</label>
78
                                    <value>$loanto</value>
79
                                </_label>
80
                            </6>
81
                            <7>
82
                                <_label>
83
                                    <label>in or out</label>
84
                                    <value>$inorout</value>
85
                                </_label>
86
                            </7>
87
                        </_merge>
88
                    </notes>
89
                    <plantobservation>
90
                        <collectionnumber>$collectno</collectionnumber>
91
                        <specimenreplicate>
92
                            <institution_id><party><organizationname>$herbarium</organizationname></party></institution_id>
93
                            <sourceaccessioncode>$accession</sourceaccessioncode>
94
                        </specimenreplicate>
95
                    </plantobservation>
96
                </aggregateoccurrence>
97
                <authortaxoncode>
98
                    <_alt>
99
                        <1>$collectno</1>
100
                        <2>$SciName</2>
101
                    </_alt>
102
                </authortaxoncode>
103
                <iscultivated>$cultivated</iscultivated>
104
                <taxondetermination>
105
                    <plantconcept_id>
106
                        <plantconcept>
107
                            <plantname_id>
108
                                <_simplifyPath>
109
                                    <next>parent_id</next>
110
                                    <path>
111
                                        <plantname>
112
                                            <rank>binomial</rank>
113
                                            <plantname>$SciName</plantname>
114
                                            <parent_id>
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>$collday</value>
48
                                        </_nullIf>
49
                                    </day>
50
                                    <month>
51
                                        <_nullIf>
52
                                            <null>0</null>
53
                                            <type>float</type>
54
                                            <value>$collmonth</value>
55
                                        </_nullIf>
56
                                    </month>
57
                                    <year>
58
                                        <_nullIf>
59
                                            <null>0</null>
60
                                            <type>float</type>
61
                                            <value>$collyear</value>
62
                                        </_nullIf>
63
                                    </year>
64
                                </_date>
65
                            </collectiondate>
66
                            <notes>
67
                                <_merge>
68
                                    <1>$comment1</1>
69
                                    <2>$comment2</2>
70
                                    <3>$comment3</3>
71
                                    <4>$comment4</4>
72
                                    <5>
73
                                        <_label>
74
                                            <label>campus</label>
75
                                            <value>$campus</value>
76
                                        </_label>
77
                                    </5>
78
                                    <6>
79
                                        <_label>
80
                                            <label>loaned to</label>
81
                                            <value>$loanto</value>
82
                                        </_label>
83
                                    </6>
84
                                    <7>
85
                                        <_label>
86
                                            <label>in or out</label>
87
                                            <value>$inorout</value>
88
                                        </_label>
89
                                    </7>
90
                                </_merge>
91
                            </notes>
92
                            <plantobservation>
93
                                <collectionnumber>$collectno</collectionnumber>
94
                                <specimenreplicate>
95
                                    <institution_id><party><organizationname>$herbarium</organizationname></party></institution_id>
96
                                    <sourceaccessioncode>$accession</sourceaccessioncode>
97
                                </specimenreplicate>
98
                            </plantobservation>
99
                        </aggregateoccurrence>
100
                        <authortaxoncode>
101
                            <_alt>
102
                                <1>$collectno</1>
103
                                <2>$SciName</2>
104
                            </_alt>
105
                        </authortaxoncode>
106
                        <iscultivated>$cultivated</iscultivated>
107
                        <taxondetermination>
108
                            <plantconcept_id>
109
                                <plantconcept>
110
                                    <plantname_id>
111
                                        <_simplifyPath>
112
                                            <next>parent_id</next>
113
                                            <path>
115 114
                                                <plantname>
116
                                                    <rank>authority</rank>
117
                                                    <plantname>$authors</plantname>
115
                                                    <rank>binomial</rank>
116
                                                    <plantname>$SciName</plantname>
118 117
                                                    <parent_id>
119 118
                                                        <plantname>
120
                                                            <rank>subspecies</rank>
121
                                                            <plantname>
122
                                                                <_name>
123
                                                                    <first>
124
                                                                        <_alt>
125
                                                                            <1>$usdaRank</1>
126
                                                                            <2>$infrarank</2>
127
                                                                        </_alt>
128
                                                                    </first>
129
                                                                    <last>$infraname</last>
130
                                                                </_name>
131
                                                            </plantname>
119
                                                            <rank>authority</rank>
120
                                                            <plantname>$authors</plantname>
132 121
                                                            <parent_id>
133 122
                                                                <plantname>
134
                                                                    <rank>species</rank>
135
                                                                    <plantname>$species</plantname>
123
                                                                    <rank>subspecies</rank>
124
                                                                    <plantname>
125
                                                                        <_name>
126
                                                                            <first>
127
                                                                                <_alt>
128
                                                                                    <1>$usdaRank</1>
129
                                                                                    <2>$infrarank</2>
130
                                                                                </_alt>
131
                                                                            </first>
132
                                                                            <last>$infraname</last>
133
                                                                        </_name>
134
                                                                    </plantname>
136 135
                                                                    <parent_id>
137 136
                                                                        <plantname>
138
                                                                            <rank>genus</rank>
139
                                                                            <plantname>$genus</plantname>
137
                                                                            <rank>species</rank>
138
                                                                            <plantname>$species</plantname>
140 139
                                                                            <parent_id>
141 140
                                                                                <plantname>
142
                                                                                    <rank>family</rank>
143
                                                                                    <plantname>$family</plantname>
141
                                                                                    <rank>genus</rank>
142
                                                                                    <plantname>$genus</plantname>
143
                                                                                    <parent_id>
144
                                                                                        <plantname>
145
                                                                                            <rank>family</rank>
146
                                                                                            <plantname>$family</plantname>
147
                                                                                        </plantname>
148
                                                                                    </parent_id>
144 149
                                                                                </plantname>
145 150
                                                                            </parent_id>
146 151
                                                                        </plantname>
......
150 155
                                                        </plantname>
151 156
                                                    </parent_id>
152 157
                                                </plantname>
153
                                            </parent_id>
154
                                        </plantname>
155
                                    </path>
156
                                </_simplifyPath>
157
                            </plantname_id>
158
                        </plantconcept>
159
                    </plantconcept_id>
160
                </taxondetermination>
161
                <verbatimcollectorname>
158
                                            </path>
159
                                        </_simplifyPath>
160
                                    </plantname_id>
161
                                </plantconcept>
162
                            </plantconcept_id>
163
                        </taxondetermination>
164
                        <verbatimcollectorname>
165
                            <_merge>
166
                                <1>$collector</1>
167
                                <2>$collector1</2>
168
                                <3>$collector2</3>
169
                                <4>$collector3</4>
170
                            </_merge>
171
                        </verbatimcollectorname>
172
                    </taxonoccurrence>
173
                </locationevent>
174
                <locationnarrative>
162 175
                    <_merge>
163
                        <1>$collector</1>
164
                        <2>$collector1</2>
165
                        <3>$collector2</3>
166
                        <4>$collector3</4>
176
                        <1>$locality</1>
177
                        <3>
178
                            <_label>
179
                                <label>habitat</label>
180
                                <value>$habitat</value>
181
                            </_label>
182
                        </3>
167 183
                    </_merge>
168
                </verbatimcollectorname>
169
            </taxonoccurrence>
170
        </locationevent>
171
        <locationnarrative>
172
            <_merge>
173
                <1>$locality</1>
174
                <3>
175
                    <_label>
176
                        <label>habitat</label>
177
                        <value>$habitat</value>
178
                    </_label>
179
                </3>
180
            </_merge>
181
        </locationnarrative>
182
    </location>
184
                </locationnarrative>
185
            </location>
186
        </path>
187
    </_simplifyPath>
183 188
</VegBIEN>
184 189
Inserted 22 new rows into database

Also available in: Unified diff