Project

General

Profile

« Previous | Next » 

Revision 123

Added human-readable versions of mappings and scripts to generate them

View differences:

scripts/util/format_for_review
1
#!/usr/bin/env python
2
# Converts a map spreadsheet to human-readable (but machine unusable) form
3
# Usage: self <in_map >out_ma
4

  
5
import csv
6
import re
7
import sys
8

  
9
def sub_nested(regex, repl, str_):
10
    while True:
11
        str_, n = re.subn(regex, repl, str_)
12
        if n == 0: return str_
13

  
14
def cleanup(xpath):
15
    truncated = False
16
    
17
    # Remove attrs
18
    xpath = sub_nested(r':\[[^\[\]]*?\]', r'', xpath)
19
    
20
    # Remove lookahead assertions
21
    xpath = sub_nested(r'\((/[^\)]*?)\)(?=/)', r'\1', xpath)
22
    
23
    # Remove pointers
24
    xpath, n = re.subn(r'^.*->', r'', xpath)
25
    if n > 0: truncated = True
26
    
27
    # Remove part of path before first key list, XML function, or path end
28
    # Leave enough to include the table of a user-defined value
29
    xpath, n = re.subn(r'^(?:/(?!_)[\w*]+)*(?=(?:/(?!_)[\w*]+){2}(?:\[|/_|$))',
30
        r'', xpath)
31
    # Prepend / to show truncation
32
    if n > 0: truncated = True
33
    
34
    # Remove backward (child-to-parent) pointer's target ID attr
35
    xpath = re.sub(r'\[[\w*]+\]|(?<=\[)[\w*]+,', r'', xpath)
36
    
37
    # Remove negative keys
38
    xpath = re.sub(r',?!(?:[\w*]+/)*@?[\w*]+', r'', xpath)
39
    
40
    # Remove path before key
41
    xpath = re.sub(r'(?:[\w*]+/)*(@?[\w*]+)(?==)', r'\1', xpath)
42
    
43
    # Prepend / to show truncation
44
    if truncated: xpath = '/'+xpath
45
    
46
    return xpath
47

  
48
def main():
49
    # Convert map
50
    reader = csv.reader(sys.stdin)
51
    writer = csv.writer(sys.stdout)
52
    writer.writerow(reader.next())
53
    for row in reader: writer.writerow(map(cleanup, row))
54

  
55
main()
0 56

  
mappings/for_review/VegX-VegBank.organisms.csv
1
VegX:/*s/individualOrganismObservation,VegBank:/taxonObservation
2
//*s/taxonConcept[@code=TaxonomicRankBelowSubspeciesEnum]/Name,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName/_name/last"
3
//*s/taxonDetermination[role=collector]/groupType,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=determinationType]]/definedValue"
4
//individualName/givenName,//stemLocation/taxonInterpretation[roleCode=collector]/collector_ID/party/givenName
5
//individualName/surName,//stemLocation/taxonInterpretation[roleCode=collector]/collector_ID/party/surName
6
//*s/taxonConcept[@code=fam]/Name,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Family]/*_ID/plantConcept/*_ID/*/plantName"
7
//*s/taxonConcept[@code=gen]/Name,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Genus]/*_ID/plantConcept/*_ID/*/plantName"
8
//*s/taxonConcept[@code=sp]/AccordingTo/Simple,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Species]/*_ID/plantConcept/*_ID/plantName/reference_ID/reference/shortName"
9
//*s/taxonConcept[@code=sp]/Name,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Species]/*_ID/plantConcept/*_ID/*/plantName"
10
//*s/taxonConcept[@code=TaxonomicRankBelowSubspeciesEnum]/Rank,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName/_name/first"
11
//*s/taxonDetermination[role=computer]/note,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=cfAff]]/definedValue"
12
//*s/taxonConcept[@code=cl]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Class]/*_ID/plantConcept/*_ID/*/plantName"
13
//*s/taxonConcept[@code=fam]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Family]/*_ID/plantConcept/*_ID/*/plantName"
14
//*s/taxonConcept[@code=gen]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Genus]/*_ID/plantConcept/*_ID/*/plantName"
15
//*s/taxonConcept[@code=ord]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Order]/*_ID/plantConcept/*_ID/*/plantName"
16
//*s/taxonConcept[@code=phyl_div]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Subkingdom]/*_ID/plantConcept/*_ID/*/plantName"
17
//*s/taxonConcept[@code=reg]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Kingdom]/*_ID/plantConcept/*_ID/*/plantName"
18
//*s/taxonConcept[@code=sp]/AccordingTo/Simple,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Species]/*_ID/plantConcept/*_ID/reference/referenceContributor/*_ID/referenceParty/{givenName,surname}"
19
//*s/taxonConcept[@code=sp]/Name,"/taxonImportance/stemCount/stemLocation/{taxonInterpretation[roleCode=identifier,plantLevel=Species]/*_ID/plantConcept/*_ID/*/plantName,taxonInterpretation[roleCode=collector]/*_ID/plantConcept/*_ID/*/plantName/_alt/2}"
20
//*s/taxonConcept[@code=ssp]/Name,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName"
21
//taxonName/Simple,"/taxonImportance/stemCount/stemLocation/{taxonInterpretation[roleCode=identifier]/*_ID/plantConcept/*_ID/*/plantName,taxonInterpretation[roleCode=collector]/*_ID/plantConcept/*_ID/*/plantName/_alt/1}"
22
//*s/taxonDetermination[role=identifier]/date/_date/day,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/day
23
//*s/taxonDetermination[role=identifier]/date/_date/month,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/month
24
//*s/taxonDetermination[role=identifier]/date/_date/year,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/year
25
"//parties/party/individualName/{givenName/_namePart/{first,middle},surName/_namePart/last}","//stemLocation/taxonInterpretation[roleCode=collector]/collector_ID/party/{givenName/_namePart/first,middleName/_namePart/middle,surName/_namePart/last}"
26
"//parties/party/individualName/{givenName/_namePart/{first,middle},surName/_namePart/last}","//stemLocation/taxonInterpretation[roleCode=identifier]/*_ID/party/{givenName/_namePart/first,middleName/_namePart/middle,surName/_namePart/last}"
27
//taxonNameUsageConcept/authorCode,//stemLocation/taxonInterpretation[roleCode=collector]/collectionNumber
28
//note/text,//stemLocation/taxonInterpretation[roleCode=collector]/notes
29
//party/organizationName/_name/first,//stemLocation/taxonInterpretation[roleCode=collector]/museum_ID/party/OrganizationName/_name/first
30
//party/organizationName/_name/last,//stemLocation/taxonInterpretation[roleCode=collector]/museum_ID/party/OrganizationName/_name/last
31
//taxonNameUsageConcept/voucher,"/{taxonImportance/stemCount/stemLocation/taxonInterpretation[roleCode=collector]/museumAccessionNumber,*_ID/observation/*_ID/plot/authorPlotCode/_alt/3}"
32
//individualOrganism/identificationLabel,//stemLocation/stemCode
33
//individualOrganism/simpleUserdefined[name=sex]/value,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=sex]]/definedValue"
34
//*s/abioticObservation/magnesium,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilMagnesium]]/definedValue"
35
//*s/abioticObservation/nitrogen,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilNitrogen]]/definedValue"
36
//*s/abioticObservation/ph,//soilObs/soilPH
37
//*s/abioticObservation/phosphorus,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPhosphorus]]/definedValue"
38
//*s/abioticObservation/pottasium,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPotassium]]/definedValue"
39
//*s/abioticObservation/simpleUserdefined[name=acidity]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilAcidity]]/definedValue"
40
//*s/abioticObservation/simpleUserdefined[name=base]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilBase]]/definedValue"
41
//*s/abioticObservation/simpleUserdefined[name=calcium]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCalcium]]/definedValue"
42
//*s/abioticObservation/simpleUserdefined[name=carbon]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCarbon]]/definedValue"
43
//*s/abioticObservation/simpleUserdefined[name=cationCap]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCationCap]]/definedValue"
44
//*s/abioticObservation/simpleUserdefined[name=clayPercent]/value,//soilObs/soilClay
45
//*s/abioticObservation/simpleUserdefined[name=conductivity]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilConductivity]]/definedValue"
46
//*s/abioticObservation/simpleUserdefined[name=organicPercent]/value,//soilObs/soilOrganic
47
//*s/abioticObservation/simpleUserdefined[name=sandPercent]/value,//soilObs/soilSand
48
//*s/abioticObservation/simpleUserdefined[name=siltPercent]/value,//soilObs/soilSilt
49
//*s/abioticObservation/simpleUserdefined[name=sodium]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilSodium]]/definedValue"
50
//*s/abioticObservation/simpleUserdefined[name=texture]/value,//soilObs/soilTexture
51
//*s/communityDetermination/communityConcepts/communityConcept/commonName,//*/commName
52
//*s/communityDetermination/communityConcepts/communityConcept/name,//commConcept/commDescription
53
//project/title,//project/projectName
54
//plot/area,//plot/area
55
//plot/country,"//*_ID/namedPlace[placeSystem=""area|country|territory""]/placeName"
56
//plot/county,"//*_ID/namedPlace[placeSystem=""Geographic Name]/placeName"
57
//plot/county,//*_ID/namedPlace[placeSystem=county]/placeName
58
//geospatial/CoordinateUncertaintyInMeters,//plot/locationAccuracy
59
//geospatial/DecimalLatitude,//plot/realLatitude
60
//geospatial/DecimalLongitude,//plot/realLongitude
61
//geospatial/FootprintWKT,//plot/dsgpoly
62
//geospatial/maximumDepthInMeters,//waterDepth/max
63
//geospatial/maximumElevationInMeters,"/*_ID/observation/*_ID/plot/{elevation/_avg/max,elevationRange/_range/to}"
64
//geospatial/minimumDepthInMeters,//waterDepth/min
65
//geospatial/minimumElevationInMeters,"/*_ID/observation/*_ID/plot/{elevation/_avg/min,elevationRange/_range/from}"
66
//geospatial/verbatimElevation,//plot/elevation
67
//plot/plotUniqueIdentifier,"/*_ID/observation/{*_ID/plot/authorPlotCode/_alt/2,authorObsCode}"
68
//plot/plotUniqueIdentifier,//plot/authorPlotCode/_alt/1
69
//plot/simpleUserdefined[name=locality]/value,//namedPlace/placeDescription
70
//plot/simpleUserdefined[name=localityDescription]/value,//namedPlace/placeDescription
71
//plot/simpleUserdefined[name=majorGeo]/value,//*_ID/namedPlace[placeSystem=continent]/placeName
72
//plot/slopeAspect,//plot/slopeAspect
73
//plot/slopeGradient,//plot/slopeGradient
74
//plot/state,"//*_ID/namedPlace[placeSystem=""region|state|province""]/placeName"
75
//plotObservation/obsEndDate/_date/year,//observation/obsEndDate/_date/year
76
//plotObservation/obsStartDate/_date/day,//observation/obsStartDate/_date/day
77
//plotObservation/obsStartDate/_date/month,//observation/obsStartDate/_date/month
78
//plotObservation/obsStartDate/_date/year,//observation/obsStartDate/_date/year
79
//plotObservation/simpleUserdefined[name=plotMethodology]/value,//observation/methodNarrative
80
//plotObservation/simpleUserdefined[name=precipMm]/value,"//observation/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=precipitationMm]]/definedValue"
81
//plotObservation/temperature,"//observation/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=temperatureC]]/definedValue"
82
/diameterBaseDistance[baseDistance=0]/diameter,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemBasalDiameter]]/definedValue"
83
/diameterBaseDistance[baseDistance=1.37]/diameter,//stemCount/stemDiameter
84
/height,//stemCount/stemHeight
85
/simpleUserdefined[name=censusNo]/value,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=censusNo]]/definedValue"
86
/simpleUserdefined[name=count]/value,//*/stemCount
87
/simpleUserdefined[name=coverPercent]/value,//taxonImportance/cover
88
/simpleUserdefined[name=habit]/value,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=habit]]/definedValue"
89
/simpleUserdefined[name=habitat]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=habitat]]/definedValue"
90
/simpleUserdefined[name=htFirstBranchM]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=heightFirstBranchM]]/definedValue"
91
/simpleUserdefined[name=individualCode]/value,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=individualCode]]/definedValue"
92
/simpleUserdefined[name=interceptCm]/value,"//taxonImportance/definedValue[*_ID/userDefined[tableName=taxonImportance,userDefinedName=interceptCm]]/definedValue"
93
/simpleUserdefined[name=plantFungusDescription]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=plantFungusDescription]]/definedValue"
94
/simpleUserdefined[name=stemCanopyForm]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemCanopyForm]]/definedValue"
95
/simpleUserdefined[name=stemCanopyPosition]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemCanopyPosition]]/definedValue"
96
/simpleUserdefined[name=stemHeightFirstBranchM]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemHeightFirstBranchM]]/definedValue"
97
/simpleUserdefined[name=stemHeightM]/value,//stemCount/stemHeight
98
/simpleUserdefined[name=stemLianaInfestation]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemLianaInfestation]]/definedValue"
99
/simpleUserdefined[name=substrate]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=substrate]]/definedValue"
100
/simpleUserdefined[name=vegetation]/value,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=vegetation]]/definedValue"
101
/simpleUserdefined[name=xPosition]/value,//stemLocation/stemXPosition
102
/simpleUserdefined[name=yPosition]/value,//stemLocation/stemYPosition
mappings/for_review/NYBG-VegX.organisms.csv
1
NYBG,VegX:/*s/individualOrganismObservation,Comments
2
:1,/simpleUserdefined[name=count]/value,
3
key,,Brad: OMIT; I'm pretty sure this is a temporary artificial ID generated at time of export.
4
DateLastModified,,"Brad: Mapping to VegX is incorrect. I think is this merely an internal timestamp indicated when record last modified, not necessarily when determination (taxon name) last modified. Probably we should omit this field, although might be useful for updating changed records from this source."
5
InstitutionCode,//party/organizationName/_name/first,
6
CollectionCode,//party/organizationName/_name/last,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name
7
CatalogNumber,,"Brad: Not sure if mapping correct. Nick, is there an element for institutional accession codes in VegX?; Aaron: This can't be used as the accession code (primary key) because some rows don't have a value for it"
8
ScientificName,//taxonName/Simple,"Brad: Bob, Nick, please is this mapping OK?"
9
BasisOfRecord,,Brad: OMIT? See http://rs.tdwg.org/dwc/terms/index.htm#basisOfRecord for definition of this term.
10
Kingdom,//*s/taxonConcept[@code=reg]/Name,
11
Phylum,//*s/taxonConcept[@code=phyl_div]/Name,
12
Class,//*s/taxonConcept[@code=cl]/Name,
13
Order,//*s/taxonConcept[@code=ord]/Name,
14
Family,//*s/taxonConcept[@code=fam]/Name,
15
Genus,//*s/taxonConcept[@code=gen]/Name,
16
Species,//*s/taxonConcept[@code=sp]/Name,
17
Subspecies,//*s/taxonConcept[@code=ssp]/Name,
18
ScientificNameAuthor,//*s/taxonConcept[@code=sp]/AccordingTo/Simple,"Brad: Mapping probably incorrect. This DwC element refers to scientific name author; does not correspond to the VegBank and VegX elements you have listed (Bob, Nick�where does name author belong in VegBank and VegX?); Aaron: The mapped VegX element is the author linked to the taxon name, so it seems like this is the scientific name author"
19
IdentifiedBy,"//parties/party/individualName/{givenName/_namePart/{first,middle},surName/_namePart/last}",Brad: Bob: does this look correct for VegBank?
20
YearIdentified,//*s/taxonDetermination[role=identifier]/date/_date/year,
21
MonthIdentified,//*s/taxonDetermination[role=identifier]/date/_date/month,
22
DayIdentified,//*s/taxonDetermination[role=identifier]/date/_date/day,
23
TypeStatus,,Brad: OMIT (?). Indicates whether this specimen served as type for taxon name. Probably not relevant for BIEN
24
CollectorNumber,,"Brad: OMIT; db-specific element, not relevant to VB/VX"
25
FieldNumber,//taxonNameUsageConcept/authorCode,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?"
26
Collector,"//parties/party/individualName/{givenName/_namePart/{first,middle},surName/_namePart/last}",Brad: Correct for VB. Nick: is there a way to specifically identify this party as collector of a specimen?
27
YearCollected,//plotObservation/obsStartDate/_date/year,
28
MonthCollected,//plotObservation/obsStartDate/_date/month,
29
DayCollected,//plotObservation/obsStartDate/_date/day,
30
JulianDay,,Brad: OMIT
31
TimeOfDay,,Brad: OMIT
32
ContinentOcean,,Brad: OMIT
33
Country,//plot/country,Brad: Required; reject record if this field NULL
34
StateProvince,//plot/state,
35
County,//plot/county,
36
Locality,//plot/simpleUserdefined[name=locality]/value,"Brad: Correct for VB; Nick, is there no specific element for locality description in VegX? Definitely need one."
37
Longitude,//geospatial/DecimalLongitude,
38
Latitude,//geospatial/DecimalLatitude,
39
CoordinatePrecision,//geospatial/CoordinateUncertaintyInMeters,
40
BoundingBox,//geospatial/FootprintWKT,
41
MinimumElevation,//geospatial/minimumElevationInMeters,
42
MaximumElevation,//geospatial/maximumElevationInMeters,
43
MinimumDepth,//geospatial/minimumDepthInMeters,
44
MaximumDepth,//geospatial/maximumDepthInMeters,
45
Sex,//individualOrganism/simpleUserdefined[name=sex]/value,"Brad: OMIT. Apparently not used by this institution and of uncertain applicability to plants. With other collections, *sometimes* used for phenological information (if specimen in flower, in fruit, sterile, etc.). If so, this is important information we should keep. Bob, Nick, anywhere for phenological information in VB and VX?; Aaron: Keeping it because it's useful for some collections"
46
PreparationType,,Brad: OMIT
47
IndividualCount,,Brad: OMIT; not relevant for DwC plant specimen data.
48
PreviousCatalogNumber,,Brad: OMIT
49
RelationshipType,,Brad: OMIT
50
RelatedCatalogItem,,Brad: OMIT
51
Notes,//note/text,"Brad: mapping OK; NY appears to be using this field for almost anything, but mostly internal collections notes"
52
Habitat,/simpleUserdefined[name=habitat]/value,"Brad: Free-text description of vegetation community where collected, frequently redundane wrt 'Vegetation'. Bob, Nick: keep as user defined or create special element?"
53
PlantFungusDescription,/simpleUserdefined[name=plantFungusDescription]/value,"Brad: Incorrect mapping to VB, also possibly to VX;  this is the specimenDescription field, as used by this institution (NOT a standard DwC element). Very important! Bob, Nick, where would this go in VB and VX?"
54
Substrate,/simpleUserdefined[name=substrate]/value,"Brad: Incorrect mapping to VB and VX; refers to geological substrate or soils where specimen collected. Often concatenated with habitat, or included with specimen description. Bob, Nick, is there an element for this in VB/VX, or shall we just use userDefined?"
55
Vegetation,/simpleUserdefined[name=vegetation]/value,"Brad: Free-text description of vegetation community where collected, frequently redundane wrt 'Habitat'. Bob, Nick: keep as user defined or create special element?"
56
UniqueNYInternalRecordNumber,//taxonNameUsageConcept/voucher,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key"
mappings/for_review/SALVIAS-VegX.plots.csv
1
SALVIAS,VegX:/*s/plotObservation,Comments
2
project,//project/title,
3
PLOT_ID,,"Brad: This is artificial internal database ID; a unique identifier within SALVIAS DB to each plot, within the table plotMetadata."
4
plot_code,//plot/plotUniqueIdentifier,Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
5
major_geo,//plot/simpleUserdefined[name=majorGeo]/value,
6
country,//plot/country,
7
pol1,//plot/state,Brad: No; pol1=stateProvince
8
pol2,//plot/county,Brad: No pol2=countyParish
9
locality_description,//plot/simpleUserdefined[name=localityDescription]/value,"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"
10
lat_decimal,//geospatial/DecimalLatitude,
11
long_decimal,//geospatial/DecimalLongitude,
12
elev_m,//geospatial/verbatimElevation,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.
13
elev_max_m,//geospatial/maximumElevationInMeters,
14
elev_min_m,//geospatial/minimumElevationInMeters,
15
temp_c,/temperature,
16
precip_mm,/simpleUserdefined[name=precipMm]/value,
17
slope_aspect,//plot/slopeAspect,
18
slope_gradient,//plot/slopeGradient,
19
clay_percent,//*s/abioticObservation/simpleUserdefined[name=clayPercent]/value,
20
silt_percent,//*s/abioticObservation/simpleUserdefined[name=siltPercent]/value,
21
sand_percent,//*s/abioticObservation/simpleUserdefined[name=sandPercent]/value,
22
organic_percent,//*s/abioticObservation/simpleUserdefined[name=organicPercent]/value,
23
pH,//*s/abioticObservation/ph,"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."
24
soil_N,//*s/abioticObservation/nitrogen,
25
soil_P,//*s/abioticObservation/phosphorus,
26
soil_C,//*s/abioticObservation/simpleUserdefined[name=carbon]/value,
27
soil_K,//*s/abioticObservation/pottasium,
28
soil_Mg,//*s/abioticObservation/magnesium,
29
soil_Ca,//*s/abioticObservation/simpleUserdefined[name=calcium]/value,
30
soil_Na,//*s/abioticObservation/simpleUserdefined[name=sodium]/value,
31
soil_acidity,//*s/abioticObservation/simpleUserdefined[name=acidity]/value,
32
soil_base,//*s/abioticObservation/simpleUserdefined[name=base]/value,
33
soil_cation_cap,//*s/abioticObservation/simpleUserdefined[name=cationCap]/value,
34
soil_conductivity,//*s/abioticObservation/simpleUserdefined[name=conductivity]/value,
35
soil_texture,//*s/abioticObservation/simpleUserdefined[name=texture]/value,
36
holdridge_life_zone,//*s/communityDetermination/communityConcepts/communityConcept/name,
37
life_zone_code,//*s/communityDetermination/communityConcepts/communityConcept/commonName,
38
observation_type,,"Brad: SALVIAS internal metadata indicating whether the record represents an individual or aggregate observation. Rather than storing, use to decide where to store in VegX.; Aaron: VegX aggregateOrganismObservation table is missing many fields available in individualOrganismObservation, so we're mapping to individualOrganismObservation regardless of observation type"
39
plot_methodology,/simpleUserdefined[name=plotMethodology]/value,
40
plot_area_ha,//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"
41
recensused,,"Brad: This is a 0/1 value, internal to SALVIAS. 1 indicates that a  plot has >1 set of values, from different census events.; Aaron: Different censuses are distinguished in organisms data by different census_no values"
42
date_start,/obsStartDate/_date/year,
43
date_finish,/obsEndDate/_date/year,
mappings/for_review/SALVIAS-VegX.organisms.csv
1
SALVIAS,VegX:/*s/individualOrganismObservation,Comments
2
OBSERVATION_ID,//taxonNameUsageConcept/voucher,"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."
3
PLOT_ID,,"Brad: Not sure why this is repeated? This field and plotCode, as the same as above."
4
plot_code,//plot/plotUniqueIdentifier,"Brad: Same as plotCode, above"
5
census_no,/simpleUserdefined[name=censusNo]/value,"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."
6
census_date,//plotObservation/obsStartDate/_date/year,
7
subplot,//plot/plotUniqueIdentifier,
8
individual_code,/simpleUserdefined[name=individualCode]/value,"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."
9
ind_id,,Brad: OMIT
10
tag1,//individualOrganism/identificationLabel,"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."
11
tag2,//individualOrganism/identificationLabel,"Brad: See commend for tag1. Your mapping for tag2 looks correct. Probably both values would go here, only nested, with one superceding the other."
12
x_position,/simpleUserdefined[name=xPosition]/value,"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."
13
y_position,/simpleUserdefined[name=yPosition]/value,Brad: See comment above for x_position
14
voucher_string,,"Brad: OMIT. This is the verbatim text, which includes both collectors name and collection number. I would use coll_number, below."
15
coll_number,//taxonNameUsageConcept/authorCode,Brad: Incorrect. Map instead as for voucher_string
16
collector_code,,Brad: OMIT
17
coll_lastname,//individualName/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."
18
coll_firstname,//individualName/givenName,Brad: See comment above
19
det_type,//*s/taxonDetermination[role=collector]/groupType,"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."
20
fam_status,,Brad: OMIT. This will be determined later by using TNRS.
21
gen_status,,Brad: OMIT. This will be determined later by using TNRS.
22
species_status,,"Brad: OMIT. Except, note that if species_status=3, this indicate that name is a morphospecies and not a standard latin name. Not exactly sure how to use this in BIEN, but could be useful during the name-scrubbing process with TNRS."
23
family,//*s/taxonConcept[@code=fam]/Name,
24
genus,//*s/taxonConcept[@code=gen]/Name,
25
specific_epithet,//*s/taxonConcept[@code=sp]/Name,
26
specific_authority,//*s/taxonConcept[@code=sp]/AccordingTo/Simple,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
infra_rank_1,//*s/taxonConcept[@code=TaxonomicRankBelowSubspeciesEnum]/Rank,
28
infra_ep_1,//*s/taxonConcept[@code=TaxonomicRankBelowSubspeciesEnum]/Name,
29
cf_aff,//*s/taxonDetermination[role=computer]/note,"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."
30
comments,,Brad: OMIT
31
habit,/simpleUserdefined[name=habit]/value,"Brad: Incorrect for VegBank, correct for VegX. This is growth form (tree, shrub, herb, etc.). It is an observation of a trait."
32
no_of_individuals,/simpleUserdefined[name=count]/value,"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."
33
cover_percent,/simpleUserdefined[name=coverPercent]/value,
34
intercept_cm,/simpleUserdefined[name=interceptCm]/value,"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."
35
height_m,/height,Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
36
ht_first_branch_m,/simpleUserdefined[name=htFirstBranchM]/value,Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
37
stem_tag1,//individualOrganism/identificationLabel,"Brad: Same as tag1 & tag2, but applied to individual stems. I'm still not clear how to distinguish between methods which tag only individuals trees, and those which tag individual stems."
38
stem_tag2,//individualOrganism/identificationLabel,Brad: see above
39
stem_dbh,/diameterBaseDistance[baseDistance=1.37]/diameter,
40
basal_diam,/diameterBaseDistance[baseDistance=0]/diameter,
41
stem_height_m,/simpleUserdefined[name=stemHeightM]/value,"Brad: Same as for height, but applies to individuals stems, not trees. Rare."
42
stem_height_first_branch_m,/simpleUserdefined[name=stemHeightFirstBranchM]/value,"Brad: Should also be userDefined for VegBank. Same as for ht_first_branch_m, but applies to individuals stems, not trees. Rare."
43
stem_canopy_form,/simpleUserdefined[name=stemCanopyForm]/value,Brad: Should also be userDefined for VegBank. 
44
stem_canopy_position,/simpleUserdefined[name=stemCanopyPosition]/value,Brad: Should also be userDefined for VegBank. 
45
stem_liana_infestation,/simpleUserdefined[name=stemLianaInfestation]/value,Brad: Should also be userDefined for VegBank. 
46
notes,//note/text,
47
orig_family,//*s/taxonConcept[@code=fam]/Name,Brad: OMIT
48
orig_species,//*s/taxonConcept[@code=sp]/Name,Brad: OMIT
mappings/for_review/NYBG-VegBank.organisms.csv
1
NYBG,VegBank:/taxonObservation,Comments
2
:1,//*/stemCount,
3
InstitutionCode,//stemLocation/taxonInterpretation[roleCode=collector]/museum_ID/party/OrganizationName/_name/first,
4
CollectionCode,//stemLocation/taxonInterpretation[roleCode=collector]/museum_ID/party/OrganizationName/_name/last,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name
5
ScientificName,"/taxonImportance/stemCount/stemLocation/{taxonInterpretation[roleCode=identifier]/*_ID/plantConcept/*_ID/*/plantName,taxonInterpretation[roleCode=collector]/*_ID/plantConcept/*_ID/*/plantName/_alt/1}","Brad: Bob, Nick, please is this mapping OK?"
6
Kingdom,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Kingdom]/*_ID/plantConcept/*_ID/*/plantName",
7
Phylum,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Subkingdom]/*_ID/plantConcept/*_ID/*/plantName",
8
Class,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Class]/*_ID/plantConcept/*_ID/*/plantName",
9
Order,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Order]/*_ID/plantConcept/*_ID/*/plantName",
10
Family,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Family]/*_ID/plantConcept/*_ID/*/plantName",
11
Genus,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Genus]/*_ID/plantConcept/*_ID/*/plantName",
12
Species,"/taxonImportance/stemCount/stemLocation/{taxonInterpretation[roleCode=identifier,plantLevel=Species]/*_ID/plantConcept/*_ID/*/plantName,taxonInterpretation[roleCode=collector]/*_ID/plantConcept/*_ID/*/plantName/_alt/2}",
13
Subspecies,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName",
14
ScientificNameAuthor,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Species]/*_ID/plantConcept/*_ID/reference/referenceContributor/*_ID/referenceParty/{givenName,surname}","Brad: Mapping probably incorrect. This DwC element refers to scientific name author; does not correspond to the VegBank and VegX elements you have listed (Bob, Nick�where does name author belong in VegBank and VegX?); Aaron: The mapped VegX element is the author linked to the taxon name, so it seems like this is the scientific name author"
15
IdentifiedBy,"//stemLocation/taxonInterpretation[roleCode=identifier]/*_ID/party/{givenName/_namePart/first,middleName/_namePart/middle,surName/_namePart/last}",Brad: Bob: does this look correct for VegBank?
16
YearIdentified,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/year,
17
MonthIdentified,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/month,
18
DayIdentified,//stemLocation/taxonInterpretation[roleCode=identifier]/interpretationDate/_date/day,
19
FieldNumber,//stemLocation/taxonInterpretation[roleCode=collector]/collectionNumber,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?"
20
Collector,"//stemLocation/taxonInterpretation[roleCode=collector]/collector_ID/party/{givenName/_namePart/first,middleName/_namePart/middle,surName/_namePart/last}",Brad: Correct for VB. Nick: is there a way to specifically identify this party as collector of a specimen?
21
YearCollected,//observation/obsStartDate/_date/year,
22
MonthCollected,//observation/obsStartDate/_date/month,
23
DayCollected,//observation/obsStartDate/_date/day,
24
Country,"//*_ID/namedPlace[placeSystem=""area|country|territory""]/placeName",Brad: Required; reject record if this field NULL
25
StateProvince,"//*_ID/namedPlace[placeSystem=""region|state|province""]/placeName",
26
County,//*_ID/namedPlace[placeSystem=county]/placeName,
27
Locality,//namedPlace/placeDescription,"Brad: Correct for VB; Nick, is there no specific element for locality description in VegX? Definitely need one."
28
Longitude,//plot/realLongitude,
29
Latitude,//plot/realLatitude,
30
CoordinatePrecision,//plot/locationAccuracy,
31
BoundingBox,//plot/dsgpoly,
32
MinimumElevation,"/*_ID/observation/*_ID/plot/{elevation/_avg/min,elevationRange/_range/from}",
33
MaximumElevation,"/*_ID/observation/*_ID/plot/{elevation/_avg/max,elevationRange/_range/to}",
34
MinimumDepth,//waterDepth/min,
35
MaximumDepth,//waterDepth/max,
36
Sex,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=sex]]/definedValue","Brad: OMIT. Apparently not used by this institution and of uncertain applicability to plants. With other collections, *sometimes* used for phenological information (if specimen in flower, in fruit, sterile, etc.). If so, this is important information we should keep. Bob, Nick, anywhere for phenological information in VB and VX?; Aaron: Keeping it because it's useful for some collections"
37
Notes,//stemLocation/taxonInterpretation[roleCode=collector]/notes,"Brad: mapping OK; NY appears to be using this field for almost anything, but mostly internal collections notes"
38
Habitat,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=habitat]]/definedValue","Brad: Free-text description of vegetation community where collected, frequently redundane wrt 'Vegetation'. Bob, Nick: keep as user defined or create special element?"
39
PlantFungusDescription,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=plantFungusDescription]]/definedValue","Brad: Incorrect mapping to VB, also possibly to VX;  this is the specimenDescription field, as used by this institution (NOT a standard DwC element). Very important! Bob, Nick, where would this go in VB and VX?"
40
Substrate,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=substrate]]/definedValue","Brad: Incorrect mapping to VB and VX; refers to geological substrate or soils where specimen collected. Often concatenated with habitat, or included with specimen description. Bob, Nick, is there an element for this in VB/VX, or shall we just use userDefined?"
41
Vegetation,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=vegetation]]/definedValue","Brad: Free-text description of vegetation community where collected, frequently redundane wrt 'Habitat'. Bob, Nick: keep as user defined or create special element?"
42
UniqueNYInternalRecordNumber,"/{taxonImportance/stemCount/stemLocation/taxonInterpretation[roleCode=collector]/museumAccessionNumber,*_ID/observation/*_ID/plot/authorPlotCode/_alt/3}",Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row
mappings/for_review/SALVIAS-VegBank.plots.csv
1
SALVIAS,VegBank:/observation,Comments
2
project,//project/projectName,
3
plot_code,"/{*_ID/plot/authorPlotCode/_alt/2,authorObsCode}",Brad: plotCode is as-assigned by data provider; guranteed to be unique only within dataset (=project)
4
major_geo,//*_ID/namedPlace[placeSystem=continent]/placeName,
5
country,"//*_ID/namedPlace[placeSystem=""area|country|territory""]/placeName",
6
pol1,"//*_ID/namedPlace[placeSystem=""region|state|province""]/placeName",Brad: No; pol1=stateProvince
7
pol2,//*_ID/namedPlace[placeSystem=county]/placeName,Brad: No pol2=countyParish
8
locality_description,//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
lat_decimal,//plot/realLatitude,
10
long_decimal,//plot/realLongitude,
11
elev_m,//plot/elevation,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.
12
elev_max_m,"/*_ID/plot/{elevation/_avg/max,elevationRange/_range/to}",
13
elev_min_m,"/*_ID/plot/{elevation/_avg/min,elevationRange/_range/from}",
14
temp_c,"/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=temperatureC]]/definedValue",
15
precip_mm,"/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=precipitationMm]]/definedValue",
16
slope_aspect,//plot/slopeAspect,
17
slope_gradient,//plot/slopeGradient,
18
clay_percent,//soilObs/soilClay,
19
silt_percent,//soilObs/soilSilt,
20
sand_percent,//soilObs/soilSand,
21
organic_percent,//soilObs/soilOrganic,
22
pH,//soilObs/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."
23
soil_N,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilNitrogen]]/definedValue",
24
soil_P,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPhosphorus]]/definedValue",
25
soil_C,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCarbon]]/definedValue",
26
soil_K,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPotassium]]/definedValue",
27
soil_Mg,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilMagnesium]]/definedValue",
28
soil_Ca,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCalcium]]/definedValue",
29
soil_Na,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilSodium]]/definedValue",
30
soil_acidity,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilAcidity]]/definedValue",
31
soil_base,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilBase]]/definedValue",
32
soil_cation_cap,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCationCap]]/definedValue",
33
soil_conductivity,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilConductivity]]/definedValue",
34
soil_texture,//soilObs/soilTexture,
35
holdridge_life_zone,//commConcept/commDescription,
36
life_zone_code,//*/commName,
37
plot_methodology,/methodNarrative,
38
plot_area_ha,//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"
39
date_start,/obsStartDate/_date/year,
40
date_finish,/obsEndDate/_date/year,
mappings/for_review/SALVIAS-VegBank.organisms.csv
1
SALVIAS,VegBank:/taxonObservation,Comments
2
OBSERVATION_ID,"/{taxonImportance/stemCount/stemLocation/taxonInterpretation[roleCode=collector]/museumAccessionNumber,*_ID/observation/*_ID/plot/authorPlotCode/_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."
3
plot_code,//plot/authorPlotCode/_alt/1,"Brad: Same as plotCode, above"
4
census_no,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=censusNo]]/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."
5
census_date,//observation/obsStartDate/_date/year,
6
subplot,"/*_ID/observation/{*_ID/plot/authorPlotCode/_alt/2,authorObsCode}",
7
individual_code,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=individualCode]]/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."
8
tag1,//stemLocation/stemCode,"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."
9
tag2,//stemLocation/stemCode,"Brad: See commend for tag1. Your mapping for tag2 looks correct. Probably both values would go here, only nested, with one superceding the other."
10
x_position,//stemLocation/stemXPosition,"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."
11
y_position,//stemLocation/stemYPosition,Brad: See comment above for x_position
12
coll_number,//stemLocation/taxonInterpretation[roleCode=collector]/collectionNumber,Brad: Incorrect. Map instead as for voucher_string
13
coll_lastname,//stemLocation/taxonInterpretation[roleCode=collector]/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."
14
coll_firstname,//stemLocation/taxonInterpretation[roleCode=collector]/collector_ID/party/givenName,Brad: See comment above
15
det_type,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=determinationType]]/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."
16
family,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Family]/*_ID/plantConcept/*_ID/*/plantName",
17
genus,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Genus]/*_ID/plantConcept/*_ID/*/plantName",
18
specific_epithet,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Species]/*_ID/plantConcept/*_ID/*/plantName",
19
specific_authority,"//stemLocation/taxonInterpretation[roleCode=computer,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.
20
infra_rank_1,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName/_name/first",
21
infra_ep_1,"//stemLocation/taxonInterpretation[roleCode=computer,plantLevel=Subspecies]/*_ID/plantConcept/*_ID/*/plantName/_name/last",
22
cf_aff,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=cfAff]]/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."
23
habit,"//stemLocation/taxonInterpretation[roleCode=collector]/definedValue[*_ID/userDefined[tableName=taxonInterpretation,userDefinedName=habit]]/definedValue","Brad: Incorrect for VegBank, correct for VegX. This is growth form (tree, shrub, herb, etc.). It is an observation of a trait."
24
no_of_individuals,//*/stemCount,"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."
25
cover_percent,//taxonImportance/cover,
26
intercept_cm,"//taxonImportance/definedValue[*_ID/userDefined[tableName=taxonImportance,userDefinedName=interceptCm]]/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."
27
height_m,//stemCount/stemHeight,Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
28
ht_first_branch_m,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=heightFirstBranchM]]/definedValue",Brad: Incorrect for VegBank. This is a measurement applied to a single tree. Check with Bob
29
stem_tag1,//stemLocation/stemCode,"Brad: Same as tag1 & tag2, but applied to individual stems. I'm still not clear how to distinguish between methods which tag only individuals trees, and those which tag individual stems."
30
stem_tag2,//stemLocation/stemCode,Brad: see above
31
stem_dbh,//stemCount/stemDiameter,
32
basal_diam,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemBasalDiameter]]/definedValue",
33
stem_height_m,//stemCount/stemHeight,"Brad: Same as for height, but applies to individuals stems, not trees. Rare."
34
stem_height_first_branch_m,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemHeightFirstBranchM]]/definedValue","Brad: Should also be userDefined for VegBank. Same as for ht_first_branch_m, but applies to individuals stems, not trees. Rare."
35
stem_canopy_form,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemCanopyForm]]/definedValue",Brad: Should also be userDefined for VegBank. 
36
stem_canopy_position,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemCanopyPosition]]/definedValue",Brad: Should also be userDefined for VegBank. 
37
stem_liana_infestation,"//stemLocation/definedValue[*_ID/userDefined[tableName=stemLocation,userDefinedName=stemLianaInfestation]]/definedValue",Brad: Should also be userDefined for VegBank. 
38
notes,//stemLocation/taxonInterpretation[roleCode=collector]/notes,
39
orig_family,"//stemLocation/taxonInterpretation[roleCode=identifier,plantLevel=Family]/*_ID/plantConcept/*_ID/*/plantName",Brad: OMIT
40
orig_species,"/taxonImportance/stemCount/stemLocation/{taxonInterpretation[roleCode=identifier,plantLevel=Species]/*_ID/plantConcept/*_ID/*/plantName,taxonInterpretation[roleCode=collector]/*_ID/plantConcept/*_ID/*/plantName/_alt/2}",Brad: OMIT
mappings/for_review/VegX-VegBank.plots.csv
1
VegX:/*s/plotObservation,VegBank:/observation
2
//*s/abioticObservation/magnesium,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilMagnesium]]/definedValue"
3
//*s/abioticObservation/nitrogen,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilNitrogen]]/definedValue"
4
//*s/abioticObservation/ph,//soilObs/soilPH
5
//*s/abioticObservation/phosphorus,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPhosphorus]]/definedValue"
6
//*s/abioticObservation/pottasium,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilPotassium]]/definedValue"
7
//*s/abioticObservation/simpleUserdefined[name=acidity]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilAcidity]]/definedValue"
8
//*s/abioticObservation/simpleUserdefined[name=base]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilBase]]/definedValue"
9
//*s/abioticObservation/simpleUserdefined[name=calcium]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCalcium]]/definedValue"
10
//*s/abioticObservation/simpleUserdefined[name=carbon]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCarbon]]/definedValue"
11
//*s/abioticObservation/simpleUserdefined[name=cationCap]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilCationCap]]/definedValue"
12
//*s/abioticObservation/simpleUserdefined[name=clayPercent]/value,//soilObs/soilClay
13
//*s/abioticObservation/simpleUserdefined[name=conductivity]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilConductivity]]/definedValue"
14
//*s/abioticObservation/simpleUserdefined[name=organicPercent]/value,//soilObs/soilOrganic
15
//*s/abioticObservation/simpleUserdefined[name=sandPercent]/value,//soilObs/soilSand
16
//*s/abioticObservation/simpleUserdefined[name=siltPercent]/value,//soilObs/soilSilt
17
//*s/abioticObservation/simpleUserdefined[name=sodium]/value,"//soilObs/definedValue[*_ID/userDefined[tableName=soilObs,userDefinedName=soilSodium]]/definedValue"
18
//*s/abioticObservation/simpleUserdefined[name=texture]/value,//soilObs/soilTexture
19
//*s/communityDetermination/communityConcepts/communityConcept/commonName,//*/commName
20
//*s/communityDetermination/communityConcepts/communityConcept/name,//commConcept/commDescription
21
//project/title,//project/projectName
22
//plot/area,//plot/area
23
//plot/country,"//*_ID/namedPlace[placeSystem=""area|country|territory""]/placeName"
24
//plot/county,"//*_ID/namedPlace[placeSystem=""Geographic Name]/placeName"
25
//plot/county,//*_ID/namedPlace[placeSystem=county]/placeName
26
//geospatial/CoordinateUncertaintyInMeters,//plot/locationAccuracy
27
//geospatial/DecimalLatitude,//plot/realLatitude
28
//geospatial/DecimalLongitude,//plot/realLongitude
29
//geospatial/FootprintWKT,//plot/dsgpoly
30
//geospatial/maximumDepthInMeters,//waterDepth/max
31
//geospatial/maximumElevationInMeters,"/*_ID/plot/{elevation/_avg/max,elevationRange/_range/to}"
32
//geospatial/minimumDepthInMeters,//waterDepth/min
33
//geospatial/minimumElevationInMeters,"/*_ID/plot/{elevation/_avg/min,elevationRange/_range/from}"
34
//geospatial/verbatimElevation,//plot/elevation
35
//plot/plotUniqueIdentifier,"/{*_ID/plot/authorPlotCode/_alt/2,authorObsCode}"
36
//plot/plotUniqueIdentifier,//plot/authorPlotCode/_alt/1
37
//plot/simpleUserdefined[name=locality]/value,//namedPlace/placeDescription
38
//plot/simpleUserdefined[name=localityDescription]/value,//namedPlace/placeDescription
39
//plot/simpleUserdefined[name=majorGeo]/value,//*_ID/namedPlace[placeSystem=continent]/placeName
40
//plot/slopeAspect,//plot/slopeAspect
41
//plot/slopeGradient,//plot/slopeGradient
42
//plot/state,"//*_ID/namedPlace[placeSystem=""Geographic Name""]/placeName"
43
//plot/state,"//*_ID/namedPlace[placeSystem=""region|state|province""]/placeName"
44
/obsEndDate/_date/year,/obsEndDate/_date/year
45
/obsStartDate/_date/day,/obsStartDate/_date/day
46
/obsStartDate/_date/month,/obsStartDate/_date/month
47
/obsStartDate/_date/year,/obsStartDate/_date/year
48
/simpleUserdefined[name=plotMethodology]/value,/methodNarrative
49
/simpleUserdefined[name=precipMm]/value,"/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=precipitationMm]]/definedValue"
50
/temperature,"/definedValue[*_ID/userDefined[tableName=observation,userDefinedName=temperatureC]]/definedValue"
mappings/format_all_for_review
1
#!/bin/bash
2
# Converts all *.csv to human-readable (but machine unusable) form in for_review
3

  
4
selfDir="$(dirname -- "$0")"
5
cd "$selfDir"
6

  
7
for in in *.csv; do
8
    ../scripts/util/format_for_review <"$in" >"for_review/$in"
9
done
0 10

  

Also available in: Unified diff