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_number</1>
7
                <2>$acronym</2>
8
            </_alt>
9
        </authorlocationcode>
10
        <locationdetermination>
11
            <latitude>
12
                <_nullIf>
13
                    <null>0</null>
14
                    <type>float</type>
15
                    <value>$lat_deg</value>
16
                </_nullIf>
17
            </latitude>
18
            <longitude>
19
                <_nullIf>
20
                    <null>0</null>
21
                    <type>float</type>
22
                    <value>$long_deg</value>
23
                </_nullIf>
24
            </longitude>
25
            <namedplace_id>
26
                <_simplifyPath>
27
                    <next>parent_id</next>
28
                    <path>
29
                        <namedplace>
30
                            <rank>county</rank>
31
                            <placename>$county</placename>
32
                            <parent_id>
3
    <_simplifyPath id="-1">
4
        <next>parent_id</next>
5
        <path>
6
            <location>
7
                <authorlocationcode>
8
                    <_alt>
9
                        <1>$accession_number</1>
10
                        <2>$acronym</2>
11
                    </_alt>
12
                </authorlocationcode>
13
                <locationdetermination>
14
                    <latitude>
15
                        <_nullIf>
16
                            <null>0</null>
17
                            <type>float</type>
18
                            <value>$lat_deg</value>
19
                        </_nullIf>
20
                    </latitude>
21
                    <longitude>
22
                        <_nullIf>
23
                            <null>0</null>
24
                            <type>float</type>
25
                            <value>$long_deg</value>
26
                        </_nullIf>
27
                    </longitude>
28
                    <namedplace_id>
29
                        <_simplifyPath>
30
                            <next>parent_id</next>
31
                            <path>
33 32
                                <namedplace>
34
                                    <rank>stateProvince</rank>
35
                                    <placename>$state</placename>
33
                                    <rank>county</rank>
34
                                    <placename>$county</placename>
36 35
                                    <parent_id>
37 36
                                        <namedplace>
38
                                            <rank>country</rank>
39
                                            <placename>$country</placename>
37
                                            <rank>stateProvince</rank>
38
                                            <placename>$state</placename>
39
                                            <parent_id>
40
                                                <namedplace>
41
                                                    <rank>country</rank>
42
                                                    <placename>$country</placename>
43
                                                </namedplace>
44
                                            </parent_id>
40 45
                                        </namedplace>
41 46
                                    </parent_id>
42 47
                                </namedplace>
43
                            </parent_id>
44
                        </namedplace>
45
                    </path>
46
                </_simplifyPath>
47
            </namedplace_id>
48
        </locationdetermination>
49
        <locationevent>
50
            <taxonoccurrence>
51
                <aggregateoccurrence>
52
                    <collectiondate>
53
                        <_date>
54
                            <day>
55
                                <_nullIf>
56
                                    <null>0</null>
57
                                    <type>float</type>
58
                                    <value>$coll_day</value>
59
                                </_nullIf>
60
                            </day>
61
                            <month>
62
                                <_nullIf>
63
                                    <null>0</null>
64
                                    <type>float</type>
65
                                    <value>$coll_month</value>
66
                                </_nullIf>
67
                            </month>
68
                            <year>
69
                                <_nullIf>
70
                                    <null>0</null>
71
                                    <type>float</type>
72
                                    <value>$coll_year</value>
73
                                </_nullIf>
74
                            </year>
75
                        </_date>
76
                    </collectiondate>
77
                    <plantobservation>
78
                        <specimenreplicate>
79
                            <collectioncode_dwc>$acronym</collectioncode_dwc>
80
                            <sourceaccessioncode>$accession_number</sourceaccessioncode>
81
                        </specimenreplicate>
82
                    </plantobservation>
83
                </aggregateoccurrence>
84
                <taxondetermination>
85
                    <plantconcept_id>
86
                        <plantconcept>
87
                            <plantname_id>
88
                                <_simplifyPath>
89
                                    <next>parent_id</next>
90
                                    <path>
91
                                        <plantname>
92
                                            <rank>binomial</rank>
93
                                            <parent_id>
48
                            </path>
49
                        </_simplifyPath>
50
                    </namedplace_id>
51
                </locationdetermination>
52
                <locationevent>
53
                    <taxonoccurrence>
54
                        <aggregateoccurrence>
55
                            <collectiondate>
56
                                <_date>
57
                                    <day>
58
                                        <_nullIf>
59
                                            <null>0</null>
60
                                            <type>float</type>
61
                                            <value>$coll_day</value>
62
                                        </_nullIf>
63
                                    </day>
64
                                    <month>
65
                                        <_nullIf>
66
                                            <null>0</null>
67
                                            <type>float</type>
68
                                            <value>$coll_month</value>
69
                                        </_nullIf>
70
                                    </month>
71
                                    <year>
72
                                        <_nullIf>
73
                                            <null>0</null>
74
                                            <type>float</type>
75
                                            <value>$coll_year</value>
76
                                        </_nullIf>
77
                                    </year>
78
                                </_date>
79
                            </collectiondate>
80
                            <plantobservation>
81
                                <specimenreplicate>
82
                                    <collectioncode_dwc>$acronym</collectioncode_dwc>
83
                                    <sourceaccessioncode>$accession_number</sourceaccessioncode>
84
                                </specimenreplicate>
85
                            </plantobservation>
86
                        </aggregateoccurrence>
87
                        <taxondetermination>
88
                            <plantconcept_id>
89
                                <plantconcept>
90
                                    <plantname_id>
91
                                        <_simplifyPath>
92
                                            <next>parent_id</next>
93
                                            <path>
94 94
                                                <plantname>
95
                                                    <rank>authority</rank>
95
                                                    <rank>binomial</rank>
96 96
                                                    <parent_id>
97 97
                                                        <plantname>
98
                                                            <rank>subspecies</rank>
98
                                                            <rank>authority</rank>
99 99
                                                            <parent_id>
100 100
                                                                <plantname>
101
                                                                    <rank>species</rank>
102
                                                                    <plantname>$specificEpithet</plantname>
101
                                                                    <rank>subspecies</rank>
103 102
                                                                    <parent_id>
104 103
                                                                        <plantname>
105
                                                                            <rank>genus</rank>
106
                                                                            <plantname>$genus</plantname>
104
                                                                            <rank>species</rank>
105
                                                                            <plantname>$specificEpithet</plantname>
107 106
                                                                            <parent_id>
108 107
                                                                                <plantname>
109
                                                                                    <rank>family</rank>
110
                                                                                    <plantname>$family</plantname>
108
                                                                                    <rank>genus</rank>
109
                                                                                    <plantname>$genus</plantname>
110
                                                                                    <parent_id>
111
                                                                                        <plantname>
112
                                                                                            <rank>family</rank>
113
                                                                                            <plantname>$family</plantname>
114
                                                                                        </plantname>
115
                                                                                    </parent_id>
111 116
                                                                                </plantname>
112 117
                                                                            </parent_id>
113 118
                                                                        </plantname>
......
117 122
                                                        </plantname>
118 123
                                                    </parent_id>
119 124
                                                </plantname>
120
                                            </parent_id>
121
                                        </plantname>
122
                                    </path>
123
                                </_simplifyPath>
124
                            </plantname_id>
125
                        </plantconcept>
126
                    </plantconcept_id>
127
                </taxondetermination>
128
                <verbatimcollectorname>$collector</verbatimcollectorname>
129
            </taxonoccurrence>
130
        </locationevent>
131
        <locationnarrative>
132
            <_merge>
133
                <1>$locality</1>
134
                <3>
135
                    <_label>
136
                        <label>habitat</label>
137
                        <value>$habitat</value>
138
                    </_label>
139
                </3>
140
            </_merge>
141
        </locationnarrative>
142
    </location>
125
                                            </path>
126
                                        </_simplifyPath>
127
                                    </plantname_id>
128
                                </plantconcept>
129
                            </plantconcept_id>
130
                        </taxondetermination>
131
                        <verbatimcollectorname>$collector</verbatimcollectorname>
132
                    </taxonoccurrence>
133
                </locationevent>
134
                <locationnarrative>
135
                    <_merge>
136
                        <1>$locality</1>
137
                        <3>
138
                            <_label>
139
                                <label>habitat</label>
140
                                <value>$habitat</value>
141
                            </_label>
142
                        </3>
143
                    </_merge>
144
                </locationnarrative>
145
            </location>
146
        </path>
147
    </_simplifyPath>
143 148
</VegBIEN>
144 149
Inserted 26 new rows into database

Also available in: Unified diff