Project

General

Profile

« Previous | Next » 

Revision 6002

mappings/VegCore-VegBIEN.csv: subplot locationevent: Only populate parent locationevent's location unique IDs if a subplot #/subplotID is actually specified. (The lack of a location unique ID will cause the parent locationevent's location to be removed, as well as the parent locationevent itself if there is no parent locationevent unique ID.) This fixes a bug where top-level plots in datasources that provide a nullable subplot #/subplotID were incorrectly getting connected to parent locationevents.

View differences:

inputs/VegBank/plot_/VegBIEN.csv
7 7
area,/location/area_m2,"""Total area of the plot in m2"" (area definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=plot&entity=dba_tabledescription&where=where_tablename>)"
8 8
elevation,/location/elevation_m/_alt/1,"""The elevation of the plot origin in meters above sea level"" (elevation definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=plot&entity=dba_tabledescription&where=where_tablename>)"
9 9
landform,/location/landform,
10
authorplotcode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
11
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
10
authorplotcode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
11
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
12 12
authorplotcode,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
13 13
plot_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
14 14
locationnarrative,/location/locationnarrative/_merge/1,
mappings/for_review/VegCore-VegBIEN.csv
40 40
eventID,"//location/locationevent/_if[@name=""if has event""]/cond/_exists",
41 41
fieldNumber,"//location/locationevent/_if[@name=""if has event""]/cond/_exists",
42 42
startDate,"//location/locationevent/_if[@name=""if has event""]/cond/_exists",
43
plotName,"//location/locationevent/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
44
locationID,"//location/locationevent/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
43
subplotID,"//location/locationevent/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond",
44
subplot,"//location/locationevent/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond",
45
plotName,"//location/locationevent/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
46
subplotID,"//location/locationevent/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond",
47
subplot,"//location/locationevent/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond",
48
locationID,"//location/locationevent/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
45 49
fieldNumber,"//location/locationevent/_if[@name=""if has event""]/then/parent_id/locationevent/authorlocationcode",
46 50
endDate,"//location/locationevent/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date",
47 51
eventDate,"//location/locationevent/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date",
inputs/TEAM/VL/VegBIEN.csv
8 8
Site Name,/location/locationevent/*_id/project/projectname,
9 9
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",
10 10
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
1ha Plot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
11
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
12
1ha Plot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
13
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
12 14
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value",
13 15
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/2/_dateRangeStart/value",
14 16
Observation Date,/location/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value,
inputs/TEAM/VL/test.xml.ref
11 11
                    <project_id><project><projectname>$Site Name</projectname></project></project_id>
12 12
                    <parent_id>
13 13
                        <locationevent>
14
                            <location_id><location><authorlocationcode>$1ha Plot Number</authorlocationcode></location></location_id>
14
                            <location_id>
15
                                <location>
16
                                    <authorlocationcode>
17
                                        <_if name="if subplot">
18
                                            <cond>$Subplot Number</cond>
19
                                            <then>$1ha Plot Number</then>
20
                                        </_if>
21
                                    </authorlocationcode>
22
                                </location>
23
                            </location_id>
15 24
                            <obsenddate><_date><date><_dateRangeEnd><value>$Observation Date</value></_dateRangeEnd></date></_date></obsenddate>
16 25
                            <obsstartdate><_date><date><_dateRangeStart><value>$Observation Date</value></_dateRangeStart></date></_date></obsstartdate>
17 26
                        </locationevent>
inputs/TEAM/VT/VegBIEN.csv
8 8
Site Name,/location/locationevent/*_id/project/projectname,
9 9
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",
10 10
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
1ha Plot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
11
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
12
1ha Plot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
13
Subplot Number,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
12 14
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value",
13 15
Observation Date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/2/_dateRangeStart/value",
14 16
Observation Date,/location/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value,
inputs/TEAM/VT/test.xml.ref
11 11
                    <project_id><project><projectname>$Site Name</projectname></project></project_id>
12 12
                    <parent_id>
13 13
                        <locationevent>
14
                            <location_id><location><authorlocationcode>$1ha Plot Number</authorlocationcode></location></location_id>
14
                            <location_id>
15
                                <location>
16
                                    <authorlocationcode>
17
                                        <_if name="if subplot">
18
                                            <cond>$Subplot Number</cond>
19
                                            <then>$1ha Plot Number</then>
20
                                        </_if>
21
                                    </authorlocationcode>
22
                                </location>
23
                            </location_id>
15 24
                            <obsenddate><_date><date><_dateRangeEnd><value>$Observation Date</value></_dateRangeEnd></date></_date></obsenddate>
16 25
                            <obsstartdate><_date><date><_dateRangeStart><value>$Observation Date</value></_dateRangeStart></date></_date></obsstartdate>
17 26
                        </locationevent>
inputs/TEAM/TEAM_Sites/VegBIEN.csv
3 3
Name,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
4 4
Site Name,/location/locationevent/*_id/project/projectname,
5 5
CollectionDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
6
Name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
6
Name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
7 7
CollectionDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value",
8 8
CollectionDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/2/_dateRangeStart/value",
9 9
CollectionDate,/location/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value,
inputs/.geoscrub/geoscrub_cleaned_unique/VegBIEN.csv
3 3
isInCountry,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode/_if[@name=""if geovalidation""]/cond/_exists",
4 4
geoscrubID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode/_if[@name=""if geovalidation""]/else",
5 5
geoscrubID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
geoscrubID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
6
geoscrubID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
7 7
geoscrubID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
8 8
latitudeDecimalVerbatim,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
9 9
longitudeDecimalVerbatim,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
inputs/CTFS/StemObservation/VegBIEN.csv
7 7
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
8 8
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
9 9
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
10
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
10
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
11
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
11 13
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
12 14
MeasureID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/sourceaccessioncode,
13 15
StemID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/authorstemcode,
inputs/CTFS/StemObservation/test.xml.ref
9 9
                <locationevent>
10 10
                    <parent_id>
11 11
                        <locationevent>
12
                            <location_id><location><sourceaccessioncode>$PlotID</sourceaccessioncode></location></location_id>
12
                            <location_id>
13
                                <location>
14
                                    <sourceaccessioncode>
15
                                        <_if name="if subplot">
16
                                            <cond>$QuadratID</cond>
17
                                            <then>$PlotID</then>
18
                                        </_if>
19
                                    </sourceaccessioncode>
20
                                </location>
21
                            </location_id>
13 22
                            <sourceaccessioncode>$CensusID</sourceaccessioncode>
14 23
                        </locationevent>
15 24
                    </parent_id>
inputs/CTFS/Subplot/VegBIEN.csv
5 5
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6 6
QuadratID,/location/authorlocationcode,Not globally unique; unique only within Site
7 7
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
8
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
8
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
9
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
10
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
9 11
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
10 12
PlotID,"/location/locationplace/*_id/place/placecode/_if[@name=""if geovalidation""]/then",
11 13
QuadratID,"/location/sourceaccessioncode/_join/1/_if[@name=""if subplot and unique only within parent""]/cond/_exists",Not globally unique; unique only within Site
inputs/CTFS/PlotObservation/VegBIEN.csv
9 9
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
10 10
PlotCensusNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11 11
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
13 13
PlotCensusNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authorlocationcode",
14 14
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/1",
15 15
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/1",
inputs/CTFS/TaxonOccurrence/VegBIEN.csv
4 4
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
5 5
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
6 6
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
7
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
7
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
8 8
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
9 9
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
10 10
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
inputs/CTFS/SubplotObservation/VegBIEN.csv
7 7
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
8 8
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
9 9
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
10
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
10
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
11
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
11 13
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
12 14
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
13 15
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
inputs/CTFS/SubplotObservation/test.xml.ref
9 9
                <locationevent>
10 10
                    <parent_id>
11 11
                        <locationevent>
12
                            <location_id><location><sourceaccessioncode>$PlotID</sourceaccessioncode></location></location_id>
12
                            <location_id>
13
                                <location>
14
                                    <sourceaccessioncode>
15
                                        <_if name="if subplot">
16
                                            <cond>$QuadratID</cond>
17
                                            <then>$PlotID</then>
18
                                        </_if>
19
                                    </sourceaccessioncode>
20
                                </location>
21
                            </location_id>
13 22
                            <sourceaccessioncode>$CensusID</sourceaccessioncode>
14 23
                        </locationevent>
15 24
                    </parent_id>
inputs/CTFS/Plot/VegBIEN.csv
14 14
GROUP BY ""Elevation""::real , ""LocationName""
15 15
ORDER BY ""Elevation""::real DESC
16 16
-----"
17
PlotName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
18
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
17
PlotName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
18
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
19 19
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
20 20
PlotName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
21 21
DescriptionOfSite,/location/locationnarrative/_merge/1,
inputs/SALVIAS/plotMetadata/VegBIEN.csv
12 12
project_id,/location/locationevent/*_id/project/sourceaccessioncode,
13 13
date_finish,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
14 14
date_start,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
15
SiteCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
16
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode","Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
15
SiteCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
16
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then","Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
17 17
date_finish,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/1",
18 18
date_start,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/1",
19 19
life_zone_code,/location/locationevent/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
inputs/SALVIAS/plotObservations/VegBIEN.csv
20 20
GROUP BY ""PlotID"", ""Line""
21 21
HAVING count(DISTINCT census_date) > 1
22 22
-----"
23
PlotCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
24
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
23
Line,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
24
PlotCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
25
Line,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
26
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
25 27
census_date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value","This is for the subplot, not the organism, as all organisms in a subplot have the same value for it. The following query returns no rows:
26 28
-----
27 29
SELECT ""PlotID"", ""Line"", count(DISTINCT census_date) AS census_date_count
inputs/SALVIAS/plotObservations/test.xml.ref
16 16
                        <locationevent>
17 17
                            <location_id>
18 18
                                <location>
19
                                    <authorlocationcode>$PlotCode</authorlocationcode>
20
                                    <sourceaccessioncode>$PlotID</sourceaccessioncode>
19
                                    <authorlocationcode>
20
                                        <_if name="if subplot">
21
                                            <cond>$Line</cond>
22
                                            <then>$PlotCode</then>
23
                                        </_if>
24
                                    </authorlocationcode>
25
                                    <sourceaccessioncode>
26
                                        <_if name="if subplot">
27
                                            <cond>$Line</cond>
28
                                            <then>$PlotID</then>
29
                                        </_if>
30
                                    </sourceaccessioncode>
21 31
                                </location>
22 32
                            </location_id>
23 33
                            <obsenddate><_date><date><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></date></_date></obsenddate>
inputs/bien_web/observation/VegBIEN.csv
5 5
plotAreaHa,/location/area_m2/_ha_to_m2/value,
6 6
elevation_m,/location/elevation_m/_alt/1,
7 7
plotMethod,/location/locationevent/*_id/method/name,
8
plotCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
8
plotCode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
9 9
observationDate,/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/1/_*/date,
10 10
pctCover,/location/locationevent/taxonoccurrence/aggregateoccurrence/cover_fraction/_percent_to_fraction/value,
11 11
collectionNumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/collectionnumber,
inputs/Madidi/Organism/VegBIEN.csv
10 10
Number of subplot,/location/authorlocationcode,
11 11
Expedition,/location/locationevent/*_id/project/projectname,
12 12
Number of subplot,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",
13
Inventory name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
14
Inventory code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
13
Number of subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
14
Inventory name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
15
Number of subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
16
Inventory code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
15 17
Observations,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes,
16 18
Tree number,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/collectionnumber,
17 19
Specimen,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
inputs/Madidi/Plot/VegBIEN.csv
60 60
Expedition name,/location/locationevent/*_id/project/projectname,Consistent (globally unique) between PPM and PT data
61 61
Expedition number,/location/locationevent/*_id/project/sourceaccessioncode,Consistent (globally unique) between PPM and PT data
62 62
First evaluation,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
63
Inventory name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
64
Inventory code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
63
Inventory name,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
64
Inventory code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
65 65
First evaluation,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value",
66 66
First evaluation,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/2/_dateRangeStart/value",
67 67
Vegetation type,/location/locationevent/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
inputs/SALVIAS-CSV/Organism/VegBIEN.csv
20 20
GROUP BY ""PLOT_ID"", subplot
21 21
HAVING count(DISTINCT census_date) > 1
22 22
-----"
23
plot_code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
24
PLOT_ID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
23
subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
24
plot_code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
25
subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
26
PLOT_ID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
25 27
census_date,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value","This is for the subplot, not the organism, as all organisms in a subplot have the same value for it. The following query returns no rows:
26 28
-----
27 29
SELECT ""PLOT_ID"", subplot, count(DISTINCT census_date) AS census_date_count
inputs/SALVIAS-CSV/Organism/test.xml.ref
16 16
                        <locationevent>
17 17
                            <location_id>
18 18
                                <location>
19
                                    <authorlocationcode>$plot_code</authorlocationcode>
20
                                    <sourceaccessioncode>$PLOT_ID</sourceaccessioncode>
19
                                    <authorlocationcode>
20
                                        <_if name="if subplot">
21
                                            <cond>$subplot</cond>
22
                                            <then>$plot_code</then>
23
                                        </_if>
24
                                    </authorlocationcode>
25
                                    <sourceaccessioncode>
26
                                        <_if name="if subplot">
27
                                            <cond>$subplot</cond>
28
                                            <then>$PLOT_ID</then>
29
                                        </_if>
30
                                    </sourceaccessioncode>
21 31
                                </location>
22 32
                            </location_id>
23 33
                            <obsenddate><_date><date><_dateRangeEnd><value>$census_date</value></_dateRangeEnd></date></_date></obsenddate>
inputs/SALVIAS-CSV/Plot/VegBIEN.csv
12 12
project,/location/locationevent/*_id/project/projectname,
13 13
date_finish,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
14 14
date_start,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
15
plot_code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
16
PLOT_ID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode","Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
15
plot_code,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
16
PLOT_ID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then","Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
17 17
date_finish,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/1",
18 18
date_start,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/1",
19 19
holdridge_life_zone,/location/locationevent/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
inputs/FIA/Organism/VegBIEN.csv
2 2
PlotCD,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3 3
PlotCD,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode/_if[@name=""if geovalidation""]/else",
4 4
PlotCD,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
5
PlotCD,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
5
PlotCD,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
6 6
MeasDay,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/day/_nullIf:[null=0,type=float]/value",
7 7
MeasMon,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/month/_nullIf:[null=0,type=float]/value",
8 8
MeasYear,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/year/_nullIf:[null=0,type=float]/value",
inputs/VegBank/observation_/VegBIEN.csv
11 11
obsenddate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
12 12
observation_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
13 13
obsstartdate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
14
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
14
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
15 15
authorobscode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authorlocationcode",
16 16
obsenddate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/1",
17 17
obsstartdate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_*/date/_alt/1",
mappings/VegCore-VegBIEN.csv
40 40
eventID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
41 41
fieldNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
42 42
startDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
43
plotName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode",
44
locationID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode",
43
subplotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/1",
44
subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",
45
plotName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
46
subplotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/1",
47
subplot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",
48
locationID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
45 49
fieldNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authorlocationcode",
46 50
endDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/1",
47 51
eventDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_*/date/_alt/2/_dateRangeEnd/value",

Also available in: Unified diff