Project

General

Profile

« Previous | Next » 

Revision 501

Moved inputs files into subdirs for maps, verify, and test operations

View differences:

inputs/SALVIAS/map.VegBIEN.organisms.csv
1
SALVIAS:plotObservations,VegBIEN:/taxonoccurrence,Comments
2
PlotID,/*_id/plotevent/authorcode/_alt/1,"Brad: Not sure why this is repeated? This field and plotCode, as the same as above."
3
PlotCode,"/*_id/plotevent/{*_id/plot:[confidentialitystatus=0]/authorcode/_alt/2,authorcode/_alt/2}","Brad: Same as plotCode, above"
4
NoInd,/aggregateoccurrence/count/_alt/1,"Brad: Incorrect for VegX. This is a count of number of indiiduals for an *aggregate* observation. For VegBank, I'm not sure. Not exactly the same as stemCount. An individual tree could have 3 stems but would still only count as 1. We need to check with Bob on this."
5
cover_percent,/aggregateoccurrence/cover,
6
intercept_cm,"/aggregateoccurrence/definedvalue[*_id/userdefined[tablename=aggregateoccurrence,userdefinedname=interceptCm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Incorrect for VegBank This is an aggregate observation. Used in line-intercept methodology only, describes the point along centerline at which an individual intercepts the center line of the plot. Used to determin relative abundance."
7
temp_dbh,/aggregateoccurrence/individualplant/diameter,
8
height_m,/aggregateoccurrence/individualplant/height,Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
9
coll_number,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/catalognumber_dwc,Brad: Incorrect. Map instead as for voucher_string
10
census_date,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collectiondate/_date/date,
11
coll_firstname,"/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collector_id/party/{givenname/_namePart/first,middlename/_namePart/last}",Brad: See comment above
12
coll_lastname,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collector_id/party/{surname},"Brad: Correct for VegBank. This is the collector of a separate specimen which vouchers this tree or species. I worry that vouchers are not properly accommodated in VegX. Again, we need to check with Nick."
13
tag2,/aggregateoccurrence/individualplant/stem/authorcode/_alt/1,"Brad: See commend for tag1. Your mapping for tag2 looks correct. Probably both values would go here, only nested, with one superceding the other."
14
tag1,/aggregateoccurrence/individualplant/stem/authorcode/_alt/2,"Brad: Another type of code, typically a number, used by the original data provider to indicate an individual tree. These are numbers on physical tags attached to the tree. Tag2 Is the same thing, only used if the first tag was lost. Obviously not a good system as it's possible a tree tag could be lost and changed more than once."
15
ht_first_branch_m,"/aggregateoccurrence/individualplant/stem/definedvalue[*_id/userdefined[tablename=stem,userdefinedname=heightFirstBranchM]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
16
x_position,/aggregateoccurrence/individualplant/stem/xposition,"Brad: Correct for VegBank. I'm not so sure for VegX. Let's ask Nick about this. These are important, fundamental values of many tree plots, and should be accommodated within VegX."
17
y_position,/aggregateoccurrence/individualplant/stem/yposition,Brad: See comment above for x_position
18
census_no,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=censusNo]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Assigned by SALVIAS. 1 for first plot, then 2, 3, etc. I can't recall if we even have repeat censuses in SALVIAS. Probably not."
19
cfaff,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=cfAff]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Not sure where this goes. Indicator of identification uncertainty. 'cf.'=similar to the species listed, 'aff.'=related to the species list, but not the same. You'll need to check with Bob and with Nick where these go in VegX and VegBank."
20
DetType,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=determinationType]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: A SALVIAS value referring to the relationship between the voucher specimen and the observation. Affect how the identification of the specimen(latin name) is transferred to the observation. 'direct'=voucher specimen was collected from this same tree; they are one and the same individual. 'indirect'=voucher specimen was collected for a different individual, but the original data provider confirmed that this is the same species. 'default'=basically same as 'indirect'. 'uncollected'=no voucher specimen, data provider  asserted that this was the name but was unable to collect. The main different is that with 'direct', 'indirect', and 'default', the scientific name can be updated automatically based on the name attached to the specimen voucher (assuming you have a link to that data, presumably from a herbarium database. Whereas, if det_type='uncollected', the name can never change because there is no specimen."
21
Habit,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=habit]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Incorrect for VegBank, correct for VegX. This is growth form (tree, shrub, herb, etc.). It is an observation of a trait."
22
Ind,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=individualCode]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Code, if any, used by the data provider to indicate an individual tree. Scope is unknown, although typically this value is unique only within plot, or sometimes only within subplot."
23
Notes,/taxondetermination[role_id/aux_role/rolecode=collector]/notes,
24
Family,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Family]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
25
Genus,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Genus]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
26
auth,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Species]/*_id/plantconcept/*_id/plantname/reference_id/reference/shortname",Brad: Incorrect. This is the author of the scientificName. The should be a place for this in the taxonomic name elements of VegB and VegX. Let's discuss.
27
Species,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Species]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
28
infra_rank_1,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Subspecies]/{*_id/*/plantname/_name/first,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname/_name/first}",
29
infra_ep_1,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Subspecies]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname/_name/last,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname/_name/last}",
30
OrigFamily,"/taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Family]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",Brad: OMIT
31
OrigSpecies,"/{taxondetermination[role_id/aux_role/rolecode=collector]/*_id/*/plantname/_alt/2,taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Species]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}}",Brad: OMIT
32
PlotObsID,":[aggregateoccurrence/count/_alt/2=1]/{taxondetermination[role_id/aux_role/rolecode=collector]:[determinationtype=Author,originaldetermination=true,currentdetermination=false,determinationdate=epoch,*_id/party]/museumaccessionnumber,*_id/plotevent/authorcode/_alt/2,*_id/plotevent/*_id/plot:[confidentialitystatus=0]/authorcode/_alt/3}","Brad: Neither is correct; this is just an internal ID for table plotObservations. However, it has the important property of uniquely identifying an ""observation"", which is an individual tree, in the case of an individual observation, or a records of a species with an associated count of individuals or measurement of percent cover, in the case of aggregate observations. Not sure where to store this. Main point is that it is not part of the original data, but an auto_increment added later."
inputs/SALVIAS/verify.plots.ref
1
___
2
# projects
3
count
4
23
5
___
6
projects
7
project
8
1
9
10
10
11
11
12
12
13
13
14
14
16
15
17
16
18
17
19
18
2
19
21
20
22
21
23
22
24
23
25
24
26
25
3
26
5
27
6
28
7
29
8
30
9
31
___
32
each project's # plots
33
project	plots_count
34
1	228
35
10	22
36
11	12962
37
12	28
38
13	2
39
14	99
40
16	2
41
17	6
42
18	3
43
19	4
44
2	37
45
21	3
46
22	1
47
23	70
48
24	4
49
25	28
50
3	20
51
5	102
52
6	29
53
7	9
54
8	1
55
9	1
56
___
57
# plots
58
count
59
13661
60
___
61
# plot observations
62
count
63
13661
64
___
65
1st methods
66
project	method
67
1	species (stems)
68
10	individuals
69
11	species (percent cover)
70
12	individuals
71
13	individuals
72
14	individuals
73
17	individuals
74
18	individuals
75
19	individuals
76
2	individuals
77
___
78
1st method narratives
79
project	method_narrative
80
1	0.1 ha  transect, stems >= 2.5 cm dbh
81
10	NULL
82
10	"Pseudotransect": collection of leaf samples from species recorded in previous 0.1 ha transect. Species sampled  from same location as previous transect "c2750-1" (project "Boyle Transects"); do not necessarily correspond to same individuals.
83
10	"Pseudotransect": collection of leaf samples from species recorded in previous 0.1 ha transect. Species sampled  from same location as previous transect "Savegre1" (project "OTS Transects"); do not necessarily correspond to same individuals.
84
10	0.1 ha  transect, stems >= 2.5 cm dbh
85
11	20 m x 20 cover plots, all vascular plants
86
12	0.01 ha, stems >= 10 cm dbh; 16 subplots of 10 x 10 m per plot, 4 rows (UU, U, S, SS), 4 columns (BB, B, T, TT)
87
13	1 ha, stems >= 10 cm dbh
88
14	0.1 ha  transect, stems >= 2.5 cm dbh
89
16	NULL
inputs/SALVIAS/map.VegX.stems.csv
1
"SALVIAS:stems","VegX:/*s/individualOrganismObservation[relatedItem/relationshipType=stemParent]","Comments"
2
"stem_id",,
3
"origrecord_id_stems",,
4
"PlotObsID","/relatedItem[relationshipType=stemParent]/relatedItemID->/*s/individualOrganismObservation/*ID->/*s/individualOrganism/*sID->/*s/taxonNameUsageConcept/voucher",
5
"NoInd","/simpleUserdefined[name=count]/value",
6
"basal_diam","/diameterBaseDistance[baseDistance=0]/diameter",
7
"stem_dbh","/diameterBaseDistance[baseDistance=1.37]/diameter",
8
"gentry_dbh","/diameterBaseDistance[baseDistance=1.37]/diameter",
9
"stem_notes","/*ID->/*s/individualOrganism/*sID->/*s/taxonNameUsageConcept/note/text",
10
"stem_tag1","/*ID->/*s/individualOrganism/identificationLabel",
11
"stem_tag2","/*ID->/*s/individualOrganism/identificationLabel",
12
"stem_height_m","/simpleUserdefined[name=stemHeightM]/value",
13
"stem_height_first_branch_m","/simpleUserdefined[name=stemHeightFirstBranchM]/value",
14
"stem_canopy_form","/simpleUserdefined[name=stemCanopyForm]/value",
15
"stem_canopy_position","/simpleUserdefined[name=stemCanopyPosition]/value",
16
"stem_liana_infestation","/simpleUserdefined[name=stemLianaInfestation]/value",
17
"tmp_del",,
inputs/SALVIAS/test.stems.ref
1
Processed 2 input rows
2
Inserted 0 new rows into database
inputs/SALVIAS/map.VegX.plots.csv
1
link ../../mappings/SALVIAS_db-VegX.plots.csv
2 0

  
inputs/SALVIAS/map.VegX.organisms.csv
1
link ../../mappings/SALVIAS_db-VegX.organisms.csv
2 0

  
inputs/SALVIAS/test.plots.ref
1
Processed 2 input rows
2
Inserted 28 new rows into database
inputs/SALVIAS/test.organisms.ref
1
Processed 2 input rows
2
Inserted 124 new rows into database
inputs/SALVIAS/verify.plots.ref.sql
1
SELECT '# projects' AS ___;
2
SELECT count(*) AS count FROM projects;
3

  
4
SELECT 'projects' AS ___;
5
SELECT CAST(project_id AS char) AS project FROM projects ORDER BY project;
6

  
7
SELECT 'each project\'s # plots' AS ___;
8
SELECT
9
    CAST(projects.project_id AS char) AS project
10
    , count(PlotID) AS plots_count
11
FROM projects
12
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
13
GROUP BY project
14
ORDER BY project
15
;
16

  
17
SELECT '# plots' AS ___;
18
SELECT count(*) AS count FROM plotMetadata;
19

  
20
SELECT '# plot observations' AS ___;
21
SELECT count(*) AS count FROM plotMetadata;
22

  
23
SELECT '1st methods' AS ___;
24
SELECT DISTINCT
25
    CAST(projects.project_id AS char) AS project
26
    , lookup_MethodCode.Description AS method
27
FROM projects
28
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
29
JOIN lookup_MethodCode ON lookup_MethodCode.MethodCode = plotMetadata.MethodCode
30
ORDER BY project, method
31
LIMIT 10;
32

  
33
SELECT '1st method narratives' AS ___;
34
SELECT DISTINCT
35
    CAST(projects.project_id AS char) AS project
36
    , PlotMethod AS method_narrative
37
FROM projects
38
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
39
ORDER BY project, method_narrative
40
LIMIT 10;
41

  
42
/*
43
SELECT p.PlotID, p.SiteCode, COUNT(*)
44
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
45
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
46
WHERE p.project_id=2
47
GROUP BY p.PlotID, p.SiteCode;
48

  
49
SELECT NoInd, COUNT(*) AS observations
50
FROM plotObservations o JOIN plotMetadata p 
51
ON o.PlotID=p.PlotID
52
WHERE project_id=2
53
GROUP BY NoInd;
54

  
55
SELECT p.PlotID, p.SiteCode, SUM(NoInd) AS Individuals
56
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
57
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
58
WHERE p.project_id=2
59
GROUP BY p.PlotID, p.SiteCode;
60

  
61
SELECT DISTINCT pr.project_id, project_name, PlotMethod, m.MethodCode, m.Description
62
FROM projects pr JOIN plotMetadata p JOIN lookup_MethodCode m
63
ON pr.project_id=p.project_id AND p.MethodCode=m.MethodCode
64
WHERE m.MethodCode=8;
65

  
66
SELECT NoInd, COUNT(*) AS observations
67
FROM plotObservations o JOIN plotMetadata p JOIN lookup_MethodCode m
68
ON o.PlotID=p.PlotID AND p.MethodCode=m.MethodCode
69
WHERE project_id=2
70
GROUP BY NoInd;
71

  
72
SELECT p.PlotID, p.SiteCode, SUM(NoInd) AS Individuals
73
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
74
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
75
WHERE p.project_id=1
76
GROUP BY p.PlotID, p.SiteCode
77
LIMIT 10;
78

  
79
SELECT PlotMethod, MethodCode, Description, COUNT(project_id) as projects
80
FROM (
81
SELECT DISTINCT p.PlotMethod, p.MethodCode, p.Description, p.project_id
82
FROM (
83
SELECT project_id, PlotID, PlotMethod, m.MethodCode, m.Description
84
FROM plotMetadata p JOIN lookup_MethodCode m
85
ON p.MethodCode=m.MethodCode
86
) p JOIN plotObservations o JOIN stems s
87
ON p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
88
GROUP BY project_id
89
) AS a
90
GROUP BY PlotMethod, MethodCode, Description;
91

  
92
SELECT DISTINCT pr.project_id, project_name
93
FROM projects pr JOIN plotMetadata p JOIN plotObservations o JOIN stems s
94
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
95
WHERE p.MethodCode=3;
96

  
97
SELECT p.PlotID, SiteName as plot, COUNT(*) AS stems
98
FROM plotMetadata p JOIN plotObservations o JOIN stems s
99
ON p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
100
WHERE p.project_id=2
101
GROUP BY p.PlotID, SiteName
102
LIMIT 10;
103

  
104
SELECT p.PlotID, SiteName AS plot, COUNT(DISTINCT Family, Genus, Species) AS SpeciesCount
105
FROM plotMetadata p JOIN plotObservations o
106
ON p.PlotID=o.PlotID
107
WHERE project_id=2
108
GROUP BY p.PlotID, SiteName;
109

  
110
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName
111
FROM plotMetadata p JOIN plotObservations o
112
ON p.PlotID=o.PlotID
113
WHERE p.PlotID=298;
114

  
115
SELECT name_status, count(*) FROM plotObservations GROUP BY name_status;
116

  
117
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, 
118
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, name_status
119
FROM plotMetadata p JOIN plotObservations o
120
ON p.PlotID=o.PlotID
121
WHERE p.PlotID=298;
122

  
123
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, 
124
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, name_status
125
FROM plotMetadata p JOIN plotObservations o
126
ON p.PlotID=o.PlotID
127
WHERE p.PlotID=298 AND name_status=1;
128

  
129
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, COUNT(*) AS individuals
130
FROM plotMetadata p JOIN plotObservations o
131
ON p.PlotID=o.PlotID
132
WHERE p.PlotID=298 
133
GROUP BY p.PlotID, plot, subplot;
134

  
135
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, SUM(NoInd) AS individuals
136
FROM plotMetadata p JOIN plotObservations o
137
ON p.PlotID=o.PlotID
138
WHERE p.PlotID=298
139
GROUP BY p.PlotID, plot, subplot;
140

  
141
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, SUM(NoInd) AS individuals
142
FROM plotMetadata p JOIN plotObservations o
143
ON p.PlotID=o.PlotID
144
WHERE p.PlotID=1
145
GROUP BY p.PlotID, plot, subplot;
146

  
147
SELECT COUNT(*) FROM plotMetadata WHERE MethodCode=1;
148

  
149
SELECT PlotID FROM plotMetadata WHERE MethodCode=1 LIMIT 1;
150

  
151
SELECT p.PlotID, SiteCode AS plot, Family, 
152
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, cover_percent
153
FROM plotMetadata p JOIN plotObservations o
154
ON p.PlotID=o.PlotID
155
WHERE p.PlotID=24589;
156

  
157
SELECT p.PlotID, p.SiteCode as plot, Country, PolDiv1 AS stateProvince, pol2 AS countyParish, 
158
LatDec as latitude, LongDec as longitude, Elev as elevation
159
FROM projects pr JOIN plotMetadata p
160
ON pr.project_id=p.project_id
161
WHERE pr.project_id=1
162
LIMIT 20;
163

  
164
SELECT AccessCode, COUNT(*)
165
FROM plotMetadata
166
GROUP BY AccessCode;
167

  
168
SELECT pr.project_id, project_name, project_pi, allow_download_all, PlotID, SiteCode, Country
169
FROM projects pr JOIN plotMetadata p
170
ON pr.project_id=p.project_id
171
WHERE p.AccessCode=1;
172
*/
inputs/SALVIAS/verify.plots.sql
1
SELECT '# projects' AS ___;
2
SELECT count(*) AS count FROM project;
3

  
4
SELECT 'projects' AS ___;
5
SELECT projectname AS project FROM project ORDER BY project;
6

  
7
SELECT E'each project\'s # plots' AS ___;
8
SELECT projectname AS project, count(*) AS plots_count
9
FROM project
10
JOIN plotevent USING (project_id)
11
GROUP BY project
12
ORDER BY project
13
;
14

  
15
SELECT '# plots' AS ___;
16
SELECT count(*) AS count FROM plot;
17

  
18
SELECT '# plot observations' AS ___;
19
SELECT count(*) AS count FROM plotevent;
20

  
21
SELECT '1st methods' AS ___;
22
SELECT DISTINCT
23
    projectname AS project
24
    , stemSampleMethod AS method -- placeholder until we have a method field
25
FROM project
26
JOIN plotevent USING (project_id)
27
ORDER BY project, method
28
LIMIT 10;
29

  
30
SELECT '1st method narratives' AS ___;
31
SELECT DISTINCT
32
    projectname AS project
33
    , methodNarrative AS method_narrative
34
FROM project
35
JOIN plotevent USING (project_id)
36
ORDER BY project, method_narrative
37
LIMIT 10;
inputs/SALVIAS/map.VegBIEN.stems.csv
1
SALVIAS:stems,VegBIEN:/stemobservation,Comments
inputs/SALVIAS/map.VegBIEN.plots.csv
1
SALVIAS:plotMetadata,VegBIEN:/plotevent,Comments
2
plot_area_ha,/*_id/plot/area,"Brad: Area in hectares. Is there any way to store units?; Aaron: VegX plot area annotation says ""Total area of the plot in square meters."" so units are fixed"
3
Elev,/*_id/plot/elevation/_alt/1,Brad: Mean elevation in meters. This is a constrained decimal value; is there no place for this in VegX other than verbatimElevation? Check with Nick.
4
Country,"/*_id/plot/place(/*_id/namedplace[placesystem=""area|country|territory""])/placename",
5
PolDiv1,"/*_id/plot/place(/*_id/namedplace[placesystem=""region|state|province""])/placename",Brad: No; pol1=stateProvince
6
MajorGeo,/*_id/plot/place(/*_id/namedplace[placesystem=continent])/placename,
7
pol2,/*_id/plot/place(/*_id/namedplace[placesystem=county])/placename,Brad: No pol2=countyParish
8
Locality_Description,/*_id/plot/place/*_id/namedplace/placedescription,"Brad: No; this is free text description of locality where plot was situated, same as for DwC. Not a description of vegetation. Most likely='namedPlace.placeDescription' in VB; not sure about VX, again need to ask Nick where locality descriptions live in VX"
9
LatDec,/*_id/plot/reallatitude,
10
LongDec,/*_id/plot/reallongitude,
11
slope_aspect,/*_id/plot/slopeaspect,
12
slope_gradient,/*_id/plot/slopegradient,
13
elev_max_m,"/*_id/plot/{elevation/_alt/2/_avg/max,elevationrange/_range/to}",
14
elev_min_m,"/*_id/plot/{elevation/_alt/2/_avg/min,elevationrange/_range/from}",
15
project_id,/*_id/project/projectname,
16
PlotID,/authorcode/_alt/1,"Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
17
life_zone_code,/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
18
life_zone,/commclass/commdetermination/*_id/commconcept/commdescription,
19
Precip,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=precipitationMm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
20
Temp,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=temperatureC]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
21
PlotMethod,/methodnarrative,
22
date_finish,/obsenddate/_date/date,
23
date_start,/obsstartdate/_date/date,
24
soil_acidity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilAcidity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
25
soil_base,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilBase]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
26
soil_Ca,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCalcium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
27
soil_C,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCarbon]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
28
soil_cation_cap,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCationCap]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
29
soil_conductivity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilConductivity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
30
soil_Mg,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilMagnesium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
31
soil_N,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilNitrogen]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
32
soil_P,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPhosphorus]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
33
soil_K,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPotassium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
34
soil_Na,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilSodium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
35
clay_percent,/soilobs:[soilhorizon=unknown]/soilclay,
36
organic_percent,/soilobs:[soilhorizon=unknown]/soilorganic,
37
pH,/soilobs:[soilhorizon=unknown]/soilph,"Brad: For all these soil variables, how do we store information on method, units. Seems like an ontological structure would be more appropriate (measurementName, measurementValue, measurementUnits, measurementMethod). Same as BIEN traits table. Something to discuss."
38
sand_percent,/soilobs:[soilhorizon=unknown]/soilsand,
39
silt_percent,/soilobs:[soilhorizon=unknown]/soilsilt,
40
soil_texture,/soilobs:[soilhorizon=unknown]/soiltexture,
41
SiteCode,"/{*_id/plot:[confidentialitystatus=0]/authorcode/_alt/2,authorcode/_alt/2}",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
inputs/SALVIAS/test/stems.ref
1
Processed 2 input rows
2
Inserted 0 new rows into database
inputs/SALVIAS/test/plots.ref
1
Processed 2 input rows
2
Inserted 28 new rows into database
inputs/SALVIAS/test/organisms.ref
1
Processed 2 input rows
2
Inserted 124 new rows into database
inputs/SALVIAS/maps/VegBIEN.stems.csv
1
SALVIAS:stems,VegBIEN:/stemobservation,Comments
inputs/SALVIAS/maps/VegX.plots.csv
1
link ../../../mappings/SALVIAS_db-VegX.plots.csv
0 2

  
inputs/SALVIAS/maps/VegX.organisms.csv
1
link ../../../mappings/SALVIAS_db-VegX.organisms.csv
0 2

  
inputs/SALVIAS/maps/VegBIEN.plots.csv
1
SALVIAS:plotMetadata,VegBIEN:/plotevent,Comments
2
plot_area_ha,/*_id/plot/area,"Brad: Area in hectares. Is there any way to store units?; Aaron: VegX plot area annotation says ""Total area of the plot in square meters."" so units are fixed"
3
Elev,/*_id/plot/elevation/_alt/1,Brad: Mean elevation in meters. This is a constrained decimal value; is there no place for this in VegX other than verbatimElevation? Check with Nick.
4
Country,"/*_id/plot/place(/*_id/namedplace[placesystem=""area|country|territory""])/placename",
5
PolDiv1,"/*_id/plot/place(/*_id/namedplace[placesystem=""region|state|province""])/placename",Brad: No; pol1=stateProvince
6
MajorGeo,/*_id/plot/place(/*_id/namedplace[placesystem=continent])/placename,
7
pol2,/*_id/plot/place(/*_id/namedplace[placesystem=county])/placename,Brad: No pol2=countyParish
8
Locality_Description,/*_id/plot/place/*_id/namedplace/placedescription,"Brad: No; this is free text description of locality where plot was situated, same as for DwC. Not a description of vegetation. Most likely='namedPlace.placeDescription' in VB; not sure about VX, again need to ask Nick where locality descriptions live in VX"
9
LatDec,/*_id/plot/reallatitude,
10
LongDec,/*_id/plot/reallongitude,
11
slope_aspect,/*_id/plot/slopeaspect,
12
slope_gradient,/*_id/plot/slopegradient,
13
elev_max_m,"/*_id/plot/{elevation/_alt/2/_avg/max,elevationrange/_range/to}",
14
elev_min_m,"/*_id/plot/{elevation/_alt/2/_avg/min,elevationrange/_range/from}",
15
project_id,/*_id/project/projectname,
16
PlotID,/authorcode/_alt/1,"Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
17
life_zone_code,/commclass/commdetermination/*_id/commconcept/*_id/*/commname,
18
life_zone,/commclass/commdetermination/*_id/commconcept/commdescription,
19
Precip,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=precipitationMm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
20
Temp,"/definedvalue[*_id/userdefined[tablename=plotevent,userdefinedname=temperatureC]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
21
PlotMethod,/methodnarrative,
22
date_finish,/obsenddate/_date/date,
23
date_start,/obsstartdate/_date/date,
24
soil_acidity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilAcidity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
25
soil_base,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilBase]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
26
soil_Ca,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCalcium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
27
soil_C,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCarbon]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
28
soil_cation_cap,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilCationCap]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
29
soil_conductivity,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilConductivity]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
30
soil_Mg,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilMagnesium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
31
soil_N,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilNitrogen]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
32
soil_P,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPhosphorus]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
33
soil_K,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilPotassium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
34
soil_Na,"/soilobs:[soilhorizon=unknown]/definedvalue[*_id/userdefined[tablename=soilObs,userdefinedname=soilSodium]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",
35
clay_percent,/soilobs:[soilhorizon=unknown]/soilclay,
36
organic_percent,/soilobs:[soilhorizon=unknown]/soilorganic,
37
pH,/soilobs:[soilhorizon=unknown]/soilph,"Brad: For all these soil variables, how do we store information on method, units. Seems like an ontological structure would be more appropriate (measurementName, measurementValue, measurementUnits, measurementMethod). Same as BIEN traits table. Something to discuss."
38
sand_percent,/soilobs:[soilhorizon=unknown]/soilsand,
39
silt_percent,/soilobs:[soilhorizon=unknown]/soilsilt,
40
soil_texture,/soilobs:[soilhorizon=unknown]/soiltexture,
41
SiteCode,"/{*_id/plot:[confidentialitystatus=0]/authorcode/_alt/2,authorcode/_alt/2}",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
inputs/SALVIAS/maps/VegBIEN.organisms.csv
1
SALVIAS:plotObservations,VegBIEN:/taxonoccurrence,Comments
2
PlotID,/*_id/plotevent/authorcode/_alt/1,"Brad: Not sure why this is repeated? This field and plotCode, as the same as above."
3
PlotCode,"/*_id/plotevent/{*_id/plot:[confidentialitystatus=0]/authorcode/_alt/2,authorcode/_alt/2}","Brad: Same as plotCode, above"
4
NoInd,/aggregateoccurrence/count/_alt/1,"Brad: Incorrect for VegX. This is a count of number of indiiduals for an *aggregate* observation. For VegBank, I'm not sure. Not exactly the same as stemCount. An individual tree could have 3 stems but would still only count as 1. We need to check with Bob on this."
5
cover_percent,/aggregateoccurrence/cover,
6
intercept_cm,"/aggregateoccurrence/definedvalue[*_id/userdefined[tablename=aggregateoccurrence,userdefinedname=interceptCm]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Incorrect for VegBank This is an aggregate observation. Used in line-intercept methodology only, describes the point along centerline at which an individual intercepts the center line of the plot. Used to determin relative abundance."
7
temp_dbh,/aggregateoccurrence/individualplant/diameter,
8
height_m,/aggregateoccurrence/individualplant/height,Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
9
coll_number,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/catalognumber_dwc,Brad: Incorrect. Map instead as for voucher_string
10
census_date,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collectiondate/_date/date,
11
coll_firstname,"/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collector_id/party/{givenname/_namePart/first,middlename/_namePart/last}",Brad: See comment above
12
coll_lastname,/aggregateoccurrence/individualplant/specimen:[*_id/reference]/collector_id/party/{surname},"Brad: Correct for VegBank. This is the collector of a separate specimen which vouchers this tree or species. I worry that vouchers are not properly accommodated in VegX. Again, we need to check with Nick."
13
tag2,/aggregateoccurrence/individualplant/stem/authorcode/_alt/1,"Brad: See commend for tag1. Your mapping for tag2 looks correct. Probably both values would go here, only nested, with one superceding the other."
14
tag1,/aggregateoccurrence/individualplant/stem/authorcode/_alt/2,"Brad: Another type of code, typically a number, used by the original data provider to indicate an individual tree. These are numbers on physical tags attached to the tree. Tag2 Is the same thing, only used if the first tag was lost. Obviously not a good system as it's possible a tree tag could be lost and changed more than once."
15
ht_first_branch_m,"/aggregateoccurrence/individualplant/stem/definedvalue[*_id/userdefined[tablename=stem,userdefinedname=heightFirstBranchM]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue",Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
16
x_position,/aggregateoccurrence/individualplant/stem/xposition,"Brad: Correct for VegBank. I'm not so sure for VegX. Let's ask Nick about this. These are important, fundamental values of many tree plots, and should be accommodated within VegX."
17
y_position,/aggregateoccurrence/individualplant/stem/yposition,Brad: See comment above for x_position
18
census_no,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=censusNo]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Assigned by SALVIAS. 1 for first plot, then 2, 3, etc. I can't recall if we even have repeat censuses in SALVIAS. Probably not."
19
cfaff,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=cfAff]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Not sure where this goes. Indicator of identification uncertainty. 'cf.'=similar to the species listed, 'aff.'=related to the species list, but not the same. You'll need to check with Bob and with Nick where these go in VegX and VegBank."
20
DetType,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=determinationType]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: A SALVIAS value referring to the relationship between the voucher specimen and the observation. Affect how the identification of the specimen(latin name) is transferred to the observation. 'direct'=voucher specimen was collected from this same tree; they are one and the same individual. 'indirect'=voucher specimen was collected for a different individual, but the original data provider confirmed that this is the same species. 'default'=basically same as 'indirect'. 'uncollected'=no voucher specimen, data provider  asserted that this was the name but was unable to collect. The main different is that with 'direct', 'indirect', and 'default', the scientific name can be updated automatically based on the name attached to the specimen voucher (assuming you have a link to that data, presumably from a herbarium database. Whereas, if det_type='uncollected', the name can never change because there is no specimen."
21
Habit,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=habit]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Incorrect for VegBank, correct for VegX. This is growth form (tree, shrub, herb, etc.). It is an observation of a trait."
22
Ind,"/taxondetermination[role_id/aux_role/rolecode=collector]/definedvalue[*_id/userdefined[tablename=taxondetermination,userdefinedname=individualCode]:[userdefinedtype=varchar]]:[@fkey=tableRecord_ID]/definedvalue","Brad: Code, if any, used by the data provider to indicate an individual tree. Scope is unknown, although typically this value is unique only within plot, or sometimes only within subplot."
23
Notes,/taxondetermination[role_id/aux_role/rolecode=collector]/notes,
24
Family,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Family]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
25
Genus,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Genus]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
26
auth,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Species]/*_id/plantconcept/*_id/plantname/reference_id/reference/shortname",Brad: Incorrect. This is the author of the scientificName. The should be a place for this in the taxonomic name elements of VegB and VegX. Let's discuss.
27
Species,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Species]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",
28
infra_rank_1,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Subspecies]/{*_id/*/plantname/_name/first,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname/_name/first}",
29
infra_ep_1,"/taxondetermination[role_id/aux_role/rolecode=computer,*_id/plantconcept/plantstatus/plantlevel=Subspecies]:[determinationtype=""Computer (automated)"",originaldetermination=false,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname/_name/last,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname/_name/last}",
30
OrigFamily,"/taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Family]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}",Brad: OMIT
31
OrigSpecies,"/{taxondetermination[role_id/aux_role/rolecode=collector]/*_id/*/plantname/_alt/2,taxondetermination[role_id/aux_role/rolecode=identifier,*_id/plantconcept/plantstatus/plantlevel=Species]:[determinationtype=Author,originaldetermination=true,currentdetermination=true,determinationdate=epoch,*_id/party]/{*_id/*/plantname,*_id/plantconcept:[plantstatus:[plantconceptstatus=accepted,startdate=epoch,*_id/party],*_id/reference]/*_id/*/plantname}}",Brad: OMIT
32
PlotObsID,":[aggregateoccurrence/count/_alt/2=1]/{taxondetermination[role_id/aux_role/rolecode=collector]:[determinationtype=Author,originaldetermination=true,currentdetermination=false,determinationdate=epoch,*_id/party]/museumaccessionnumber,*_id/plotevent/authorcode/_alt/2,*_id/plotevent/*_id/plot:[confidentialitystatus=0]/authorcode/_alt/3}","Brad: Neither is correct; this is just an internal ID for table plotObservations. However, it has the important property of uniquely identifying an ""observation"", which is an individual tree, in the case of an individual observation, or a records of a species with an associated count of individuals or measurement of percent cover, in the case of aggregate observations. Not sure where to store this. Main point is that it is not part of the original data, but an auto_increment added later."
inputs/SALVIAS/maps/VegX.stems.csv
1
"SALVIAS:stems","VegX:/*s/individualOrganismObservation[relatedItem/relationshipType=stemParent]","Comments"
2
"stem_id",,
3
"origrecord_id_stems",,
4
"PlotObsID","/relatedItem[relationshipType=stemParent]/relatedItemID->/*s/individualOrganismObservation/*ID->/*s/individualOrganism/*sID->/*s/taxonNameUsageConcept/voucher",
5
"NoInd","/simpleUserdefined[name=count]/value",
6
"basal_diam","/diameterBaseDistance[baseDistance=0]/diameter",
7
"stem_dbh","/diameterBaseDistance[baseDistance=1.37]/diameter",
8
"gentry_dbh","/diameterBaseDistance[baseDistance=1.37]/diameter",
9
"stem_notes","/*ID->/*s/individualOrganism/*sID->/*s/taxonNameUsageConcept/note/text",
10
"stem_tag1","/*ID->/*s/individualOrganism/identificationLabel",
11
"stem_tag2","/*ID->/*s/individualOrganism/identificationLabel",
12
"stem_height_m","/simpleUserdefined[name=stemHeightM]/value",
13
"stem_height_first_branch_m","/simpleUserdefined[name=stemHeightFirstBranchM]/value",
14
"stem_canopy_form","/simpleUserdefined[name=stemCanopyForm]/value",
15
"stem_canopy_position","/simpleUserdefined[name=stemCanopyPosition]/value",
16
"stem_liana_infestation","/simpleUserdefined[name=stemLianaInfestation]/value",
17
"tmp_del",,
inputs/SALVIAS/verify/plots.sql
1
SELECT '# projects' AS ___;
2
SELECT count(*) AS count FROM project;
3

  
4
SELECT 'projects' AS ___;
5
SELECT projectname AS project FROM project ORDER BY project;
6

  
7
SELECT E'each project\'s # plots' AS ___;
8
SELECT projectname AS project, count(*) AS plots_count
9
FROM project
10
JOIN plotevent USING (project_id)
11
GROUP BY project
12
ORDER BY project
13
;
14

  
15
SELECT '# plots' AS ___;
16
SELECT count(*) AS count FROM plot;
17

  
18
SELECT '# plot observations' AS ___;
19
SELECT count(*) AS count FROM plotevent;
20

  
21
SELECT '1st methods' AS ___;
22
SELECT DISTINCT
23
    projectname AS project
24
    , stemSampleMethod AS method -- placeholder until we have a method field
25
FROM project
26
JOIN plotevent USING (project_id)
27
ORDER BY project, method
28
LIMIT 10;
29

  
30
SELECT '1st method narratives' AS ___;
31
SELECT DISTINCT
32
    projectname AS project
33
    , methodNarrative AS method_narrative
34
FROM project
35
JOIN plotevent USING (project_id)
36
ORDER BY project, method_narrative
37
LIMIT 10;
inputs/SALVIAS/verify/plots.ref.sql
1
SELECT '# projects' AS ___;
2
SELECT count(*) AS count FROM projects;
3

  
4
SELECT 'projects' AS ___;
5
SELECT CAST(project_id AS char) AS project FROM projects ORDER BY project;
6

  
7
SELECT 'each project\'s # plots' AS ___;
8
SELECT
9
    CAST(projects.project_id AS char) AS project
10
    , count(PlotID) AS plots_count
11
FROM projects
12
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
13
GROUP BY project
14
ORDER BY project
15
;
16

  
17
SELECT '# plots' AS ___;
18
SELECT count(*) AS count FROM plotMetadata;
19

  
20
SELECT '# plot observations' AS ___;
21
SELECT count(*) AS count FROM plotMetadata;
22

  
23
SELECT '1st methods' AS ___;
24
SELECT DISTINCT
25
    CAST(projects.project_id AS char) AS project
26
    , lookup_MethodCode.Description AS method
27
FROM projects
28
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
29
JOIN lookup_MethodCode ON lookup_MethodCode.MethodCode = plotMetadata.MethodCode
30
ORDER BY project, method
31
LIMIT 10;
32

  
33
SELECT '1st method narratives' AS ___;
34
SELECT DISTINCT
35
    CAST(projects.project_id AS char) AS project
36
    , PlotMethod AS method_narrative
37
FROM projects
38
JOIN plotMetadata ON plotMetadata.project_id = projects.project_id
39
ORDER BY project, method_narrative
40
LIMIT 10;
41

  
42
/*
43
SELECT p.PlotID, p.SiteCode, COUNT(*)
44
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
45
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
46
WHERE p.project_id=2
47
GROUP BY p.PlotID, p.SiteCode;
48

  
49
SELECT NoInd, COUNT(*) AS observations
50
FROM plotObservations o JOIN plotMetadata p 
51
ON o.PlotID=p.PlotID
52
WHERE project_id=2
53
GROUP BY NoInd;
54

  
55
SELECT p.PlotID, p.SiteCode, SUM(NoInd) AS Individuals
56
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
57
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
58
WHERE p.project_id=2
59
GROUP BY p.PlotID, p.SiteCode;
60

  
61
SELECT DISTINCT pr.project_id, project_name, PlotMethod, m.MethodCode, m.Description
62
FROM projects pr JOIN plotMetadata p JOIN lookup_MethodCode m
63
ON pr.project_id=p.project_id AND p.MethodCode=m.MethodCode
64
WHERE m.MethodCode=8;
65

  
66
SELECT NoInd, COUNT(*) AS observations
67
FROM plotObservations o JOIN plotMetadata p JOIN lookup_MethodCode m
68
ON o.PlotID=p.PlotID AND p.MethodCode=m.MethodCode
69
WHERE project_id=2
70
GROUP BY NoInd;
71

  
72
SELECT p.PlotID, p.SiteCode, SUM(NoInd) AS Individuals
73
FROM projects pr JOIN plotMetadata p JOIN plotObservations o
74
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID
75
WHERE p.project_id=1
76
GROUP BY p.PlotID, p.SiteCode
77
LIMIT 10;
78

  
79
SELECT PlotMethod, MethodCode, Description, COUNT(project_id) as projects
80
FROM (
81
SELECT DISTINCT p.PlotMethod, p.MethodCode, p.Description, p.project_id
82
FROM (
83
SELECT project_id, PlotID, PlotMethod, m.MethodCode, m.Description
84
FROM plotMetadata p JOIN lookup_MethodCode m
85
ON p.MethodCode=m.MethodCode
86
) p JOIN plotObservations o JOIN stems s
87
ON p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
88
GROUP BY project_id
89
) AS a
90
GROUP BY PlotMethod, MethodCode, Description;
91

  
92
SELECT DISTINCT pr.project_id, project_name
93
FROM projects pr JOIN plotMetadata p JOIN plotObservations o JOIN stems s
94
ON pr.project_id=p.project_id AND p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
95
WHERE p.MethodCode=3;
96

  
97
SELECT p.PlotID, SiteName as plot, COUNT(*) AS stems
98
FROM plotMetadata p JOIN plotObservations o JOIN stems s
99
ON p.PlotID=o.PlotID AND o.PlotObsID=s.PlotObsID
100
WHERE p.project_id=2
101
GROUP BY p.PlotID, SiteName
102
LIMIT 10;
103

  
104
SELECT p.PlotID, SiteName AS plot, COUNT(DISTINCT Family, Genus, Species) AS SpeciesCount
105
FROM plotMetadata p JOIN plotObservations o
106
ON p.PlotID=o.PlotID
107
WHERE project_id=2
108
GROUP BY p.PlotID, SiteName;
109

  
110
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName
111
FROM plotMetadata p JOIN plotObservations o
112
ON p.PlotID=o.PlotID
113
WHERE p.PlotID=298;
114

  
115
SELECT name_status, count(*) FROM plotObservations GROUP BY name_status;
116

  
117
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, 
118
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, name_status
119
FROM plotMetadata p JOIN plotObservations o
120
ON p.PlotID=o.PlotID
121
WHERE p.PlotID=298;
122

  
123
SELECT DISTINCT p.PlotID, SiteName AS plot, Family, 
124
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, name_status
125
FROM plotMetadata p JOIN plotObservations o
126
ON p.PlotID=o.PlotID
127
WHERE p.PlotID=298 AND name_status=1;
128

  
129
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, COUNT(*) AS individuals
130
FROM plotMetadata p JOIN plotObservations o
131
ON p.PlotID=o.PlotID
132
WHERE p.PlotID=298 
133
GROUP BY p.PlotID, plot, subplot;
134

  
135
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, SUM(NoInd) AS individuals
136
FROM plotMetadata p JOIN plotObservations o
137
ON p.PlotID=o.PlotID
138
WHERE p.PlotID=298
139
GROUP BY p.PlotID, plot, subplot;
140

  
141
SELECT p.PlotID, SiteCode AS plot, o.Line as subplot, SUM(NoInd) AS individuals
142
FROM plotMetadata p JOIN plotObservations o
143
ON p.PlotID=o.PlotID
144
WHERE p.PlotID=1
145
GROUP BY p.PlotID, plot, subplot;
146

  
147
SELECT COUNT(*) FROM plotMetadata WHERE MethodCode=1;
148

  
149
SELECT PlotID FROM plotMetadata WHERE MethodCode=1 LIMIT 1;
150

  
151
SELECT p.PlotID, SiteCode AS plot, Family, 
152
CONCAT_WS(' ',IFNULL(Genus,''), IFNULL(Species,'')) AS SpeciesName, cover_percent
153
FROM plotMetadata p JOIN plotObservations o
154
ON p.PlotID=o.PlotID
155
WHERE p.PlotID=24589;
156

  
157
SELECT p.PlotID, p.SiteCode as plot, Country, PolDiv1 AS stateProvince, pol2 AS countyParish, 
158
LatDec as latitude, LongDec as longitude, Elev as elevation
159
FROM projects pr JOIN plotMetadata p
160
ON pr.project_id=p.project_id
161
WHERE pr.project_id=1
162
LIMIT 20;
163

  
164
SELECT AccessCode, COUNT(*)
165
FROM plotMetadata
166
GROUP BY AccessCode;
167

  
168
SELECT pr.project_id, project_name, project_pi, allow_download_all, PlotID, SiteCode, Country
169
FROM projects pr JOIN plotMetadata p
170
ON pr.project_id=p.project_id
171
WHERE p.AccessCode=1;
172
*/
inputs/SALVIAS/verify/plots.ref
1
___
2
# projects
3
count
4
23
5
___
6
projects
7
project
8
1
9
10
10
11
11
12
12
13
13
14
14
16
15
17
16
18
17
19
18
2
19
21
20
22
21
23
22
24
23
25
24
26
25
3
26
5
27
6
28
7
29
8
30
9
31
___
32
each project's # plots
33
project	plots_count
34
1	228
35
10	22
36
11	12962
37
12	28
38
13	2
39
14	99
40
16	2
41
17	6
42
18	3
43
19	4
44
2	37
45
21	3
46
22	1
47
23	70
48
24	4
49
25	28
50
3	20
51
5	102
52
6	29
53
7	9
54
8	1
55
9	1
56
___
57
# plots
58
count
59
13661
60
___
61
# plot observations
62
count
63
13661
64
___
65
1st methods
66
project	method
67
1	species (stems)
68
10	individuals
69
11	species (percent cover)
70
12	individuals
71
13	individuals
72
14	individuals
73
17	individuals
74
18	individuals
75
19	individuals
76
2	individuals
77
___
78
1st method narratives
79
project	method_narrative
80
1	0.1 ha  transect, stems >= 2.5 cm dbh
81
10	NULL
82
10	"Pseudotransect": collection of leaf samples from species recorded in previous 0.1 ha transect. Species sampled  from same location as previous transect "c2750-1" (project "Boyle Transects"); do not necessarily correspond to same individuals.
83
10	"Pseudotransect": collection of leaf samples from species recorded in previous 0.1 ha transect. Species sampled  from same location as previous transect "Savegre1" (project "OTS Transects"); do not necessarily correspond to same individuals.
84
10	0.1 ha  transect, stems >= 2.5 cm dbh
85
11	20 m x 20 cover plots, all vascular plants
86
12	0.01 ha, stems >= 10 cm dbh; 16 subplots of 10 x 10 m per plot, 4 rows (UU, U, S, SS), 4 columns (BB, B, T, TT)
87
13	1 ha, stems >= 10 cm dbh
88
14	0.1 ha  transect, stems >= 2.5 cm dbh
89
16	NULL

Also available in: Unified diff