Project

General

Profile

« Previous | Next » 

Revision 7471

mappings/Makefile: Veg+-VegCore.csv: Generate dynamically from VegCore.htm, which allows the VegCore thesaurus to be automatically kept up to date. More importantly, it allows terms in all map spreadsheets to be updated simultaneously when a term is renamed (e.g. by replacing a term with one of its synonyms).

View differences:

mappings/Makefile
8 8

  
9 9
# Paths
10 10
bin := ../bin
11
inputCoreMaps := Veg+-VegCore.csv VegCore-VegBIEN.csv VegX-VegCore.csv
11
inputCoreMaps := VegCore-VegBIEN.csv VegX-VegCore.csv
12 12
vocab := VegCore.csv
13 13
dict := Veg+-VegCore.csv
14 14

  
15 15
##### General targets
16 16

  
17
all: _always VegCore.csv VegCore.tables.redmine $(inputCoreMaps) ;
17
all: _always VegCore.csv Veg+-VegCore.csv VegCore.tables.redmine\
18
$(inputCoreMaps) ;
18 19

  
19 20
clean: _always
20 21
	$(RM) $(all)
......
30 31
	(echo VegCore; $(sed) -n 's/^.*<a name="([a-z][^"]*|[A-Z]+)">.*$$/\1/p')\
31 32
<$< >$@
32 33

  
33
#Veg+-VegCore.csv: VegCore.htm
34
#	(echo "Veg+,VegCore"; $(bin)/redmine_synonyms|grep -vE '^\??[A-Z][a-z]')\
35
#<$< >$@
36
#	# Canonicalize alternatives of ambiguous terms using unambiguous mappings
37
#	$(bin)/in_place $@ $(bin)/translate 1 <(grep -vE '^\?' $(dict))
38
#	$(bin)/in_place $@ $(bin)/collapse_multimap
39
#	# Replace ambiguous terms with alternatives lists
40
#	$(bin)/in_place $@ $(bin)/translate 1 $(dict)
34
Veg+-VegCore.csv: VegCore.htm
35
	(echo "Veg+,VegCore"; $(bin)/redmine_synonyms|grep -vE '^\??[A-Z][a-z]')\
36
<$< >$@
37
	# Canonicalize alternatives of ambiguous terms using unambiguous mappings
38
	$(bin)/in_place $@ $(bin)/translate 1 <(grep -vE '^\?' $(dict))
39
	$(bin)/in_place $@ $(bin)/collapse_multimap
40
	# Replace ambiguous terms with alternatives lists
41
	$(bin)/in_place $@ $(bin)/translate 1 $(dict)
41 42

  
42 43
VegCore.tables.csv: VegCore.htm
43 44
	<$< $(sed) -n 's/^.*<h1 *><a href="#[^>]+>([^?<][^<]*).*$$/\1/p' >$@
......
54 55

  
55 56
ifneq ($(filter .%.last_cleanup,$(MAKECMDGOALS)),)
56 57

  
57
.Veg+-VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
58
	$(bin)/in_place $< $(bin)/translate_ci 1 $(dict)
59
	$(bin)/in_place $< $(bin)/canon 1 $(vocab)
60
	touch $@
61
.PRECIOUS: .Veg+-VegCore.csv.last_cleanup
62

  
63 58
.VegX-VegCore.csv.last_cleanup: .%.last_cleanup: % $(dict)
64 59
	$(bin)/in_place $< $(bin)/translate_ci 1 $(dict)
65 60
	$(bin)/in_place $< $(bin)/sort 0 1
mappings/Veg+-VegCore.csv
1 1
Veg+,VegCore
2
datasourceName,datasource
2 3
dcterms_type,type
4
aggregatorOrPrimary,referenceType
3 5
dcterms_modified,modified
6
dateLastModified,modified
4 7
dcterms_language,language
5 8
dcterms_rights,rights
6 9
dcterms_rightsHolder,rightsHolder
7 10
dcterms_accessRights,accessRights
8 11
dcterms_bibliographicCitation,bibliographicCitation
9 12
dcterms_references,references
10
dateLastModified,modified
11
collector,recordedBy
12
collectorNumber,recordNumber
13
julianDay,day
14
continentOcean,continent
15
boundingBox,footprintWKT
16
scientificNameAuthor,scientificNameAuthorship
17
remarks,taxonRemarks
18
species,specificEpithet
13
dataset,datasetName
14
method,samplingProtocol
15
methodology,samplingProtocol
16
plotMethodology,samplingProtocol
17
observationType_BIEN2,observationGranularity
18
observationType_SALVIAS,observationMeasure
19
?observationType,"?observationMeasure,observationGranularity"
20
projectTitle,projectName
21
censusID,eventID
22
obsStartDate,startDate
23
obsEndDate,endDate
19 24
timeOfDay,eventTime
25
julianDay,startDayOfYear
26
authorObsCode,authorEventCode
27
plotCensusNumber,authorEventCode
28
fieldNumber_DwC_terms,authorEventCode
29
fieldNotes_DwC_terms,eventRemarks
30
latitude,decimalLatitude
20 31
longitude,decimalLongitude
21
latitude,decimalLatitude
22
minimumElevation,minimumElevationInMeters
23
maximumElevation,maximumElevationInMeters
24
minimumDepth,minimumDepthInMeters
25
maximumDepth,maximumDepthInMeters
26
preparationType,preparations
27
previousCatalogNumber,otherCatalogNumbers
28
relationshipType,relationshipOfResource
29
relatedCatalogItem,relatedResourceID
30
notes,fieldNotes
31
globalUniqueIdentifier,occurrenceID
32
coordinateSource_bien,coordinateSource
33
?realLatitude,PRIVATE
34
?realLongitude,PRIVATE
35
boundingBox,footprintWKT
36
shapeOfSite,footprintWKT
37
continentOcean,continent
38
countryName,country
39
state,stateProvince
40
locationNarrative,locality
41
descriptionOfSite,locality
42
isGeovalid,geovalid
43
isValidLatLong,latLongDomainValid
44
isBadLatLong,latLongDomainInvalid
45
isInCountry,latLongInCountry
46
?distErrCountry,"?distanceToCountry_m,distanceToCountry_km"
47
?distanceToCountry,"?distanceToCountry_m,distanceToCountry_km"
48
isInStateProvince,latLongInStateProvince
49
?distErrStateProvince,"?distanceToStateProvince_m,distanceToStateProvince_km"
50
?distanceToStateProvince,"?distanceToStateProvince_m,distanceToStateProvince_km"
51
isInCountyParish,latLongInCounty
52
isNewWorld_bien,isNewWorld
53
georeferenceProtocol_bien,georeferenceProtocol
32 54
plotID,locationID
55
plotUniqueIdentifierID,locationID
33 56
plotName,locationName
34
locationNarrative,locality
35
height,"?height_m,height_ft"
36
phosphorus,"?phosphorus_percent,phosphorus_fraction"
37
potassium,"?potassium_percent,potassium_fraction"
38
magnesium,"?magnesium_percent,magnesium_fraction"
39
nitrogen,"?nitrogen_percent,nitrogen_fraction"
40
authorObsCode,fieldNumber
41
realLatitude,PRIVATE
42
realLongitude,PRIVATE
43
organic,"?organic_percent,organic_fraction"
44
sand,"?sand_percent,sand_fraction"
45
silt,"?silt_percent,silt_fraction"
46
clay,"?clay_percent,clay_fraction"
47
cationExchangeCapacity,cationExchangeCapacity_cmol_kg
48
baseSaturation,"?baseSaturation_percent,baseSaturation_fraction"
49
taxonFit,identificationQualifier
50
habit,growthForm
51
stemTag,tag
52
DBH,"?diameterBreastHeight_cm,diameterBreastHeight_in"
53
carbon,"?carbon_percent,carbon_fraction"
54
calcium,"?calcium_percent,calcium_fraction"
55
sodium,"?sodium_percent,sodium_fraction"
56
acidity,"?acidity_percent,acidity_fraction"
57
identifiedDate,dateIdentified
58
collectedDate,dateCollected
59
authorPlantCode,recordNumber
60
ID,occurrenceID
61
censusID,eventID
62
plotCensusNumber,fieldNumber
63
countryName,country
57
authorPlotCode,locationName
58
locationNumber,locationName
59
plotNotes,locationRemarks
60
plotNote,locationRemarks
61
notes_Madidi,locationRemarks
62
?elevation,"?elevationInMeters,verbatimElevation,verbatimElevation_m"
63
?minimumElevation,"?minimumElevationInMeters,minimumElevation_verbatim"
64
?maximumElevation,"?maximumElevationInMeters,maximumElevation_verbatim"
65
?depth,verbatimDepth
66
?minimumDepth,"?minimumDepthInMeters,minimumDepth_verbatim"
67
?maximumDepth,"?maximumDepthInMeters,maximumDepth_verbatim"
68
?area,"?plotArea_m2,plotArea_ha"
69
?plotArea,"?plotArea_m2,plotArea_ha"
70
?temperature,"?temperature_C,temperature_F"
71
temp_C,temperature_C
72
?precipitation,"?precipitation_m,precipitation_mm"
73
precip_mm,precipitation_mm
74
?phosphorus,"?phosphorus_fraction,phosphorus_percent"
75
pottasium,"?potassium_fraction,potassium_percent"
76
?potassium,"?potassium_fraction,potassium_percent"
77
?magnesium,"?magnesium_fraction,magnesium_percent"
78
?nitrogen,"?nitrogen_fraction,nitrogen_percent"
79
?soilC,"?carbon_fraction,carbon_percent"
80
?carbon,"?carbon_fraction,carbon_percent"
81
?soilCa,"?calcium_fraction,calcium_percent"
82
?calcium,"?calcium_fraction,calcium_percent"
83
?soilNa,"?sodium_fraction,sodium_percent"
84
?sodium,"?sodium_fraction,sodium_percent"
85
?soilAcidity,"?acidity_fraction,acidity_percent"
86
?acidity,"?acidity_fraction,acidity_percent"
87
?soilOrganic,"?organic_fraction,organic_percent"
88
?organic,"?organic_fraction,organic_percent"
89
soilTexture,texture
90
?soilSand,"?sand_fraction,sand_percent"
91
?sand,"?sand_fraction,sand_percent"
92
?soilSilt,"?silt_fraction,silt_percent"
93
?silt,"?silt_fraction,silt_percent"
94
?soilClay,"?clay_fraction,clay_percent"
95
?clay,"?clay_fraction,clay_percent"
96
?exchangeCapacity,"?cationExchangeCapacity_cmol_kg,cationExchangeCapacity_meq_100g"
97
?soilCationCap,"?cationExchangeCapacity_cmol_kg,cationExchangeCapacity_meq_100g"
98
?cationExchangeCapacity,"?cationExchangeCapacity_cmol_kg,cationExchangeCapacity_meq_100g"
99
?baseSaturation,"?baseSaturation_fraction,baseSaturation_percent"
100
soilConductivity,conductivity
64 101
quadratID,subplotID
65 102
quadratName,subplot
103
plotRelativeX,subplotX
66 104
startX,subplotX
105
plotRelativeY,subplotY
67 106
startY,subplotY
68
descriptionOfSite,locality
69
elevation,verbatimElevation
70
shapeOfSite,footprintWKT
107
communityConceptName,communityName
108
globalUniqueIdentifier_DwC,occurrenceID
109
?globalUniqueIdentifier,"?occurrenceID,datasourceRecordID"
110
ID,datasourceRecordID
111
globalUniqueIdentifier_SpeciesLink,datasourceRecordID
112
collectorNumber,recordNumber
113
fieldNumber_DwC_curatorial,recordNumber
114
?fieldNumber,"?recordNumber,authorEventCode"
115
collector,recordedBy
116
species_VegBank,speciesBinomial
117
higherPlantGroup_bien,higherPlantGroup
118
species_DwC,specificEpithet
71 119
speciesName,specificEpithet
72
speciesInvID,taxonOccurrenceID
73
subSpeciesName,subspecies
74
state,stateProvince
120
?species,"?specificEpithet,speciesBinomial"
121
fm,forma
122
var,variety
123
cv,cultivar
124
ssp,subspecies
125
subspeciesName,subspecies
126
scientificNameAuthor,scientificNameAuthorship
127
taxonIsAccepted,taxonIsCanonical
128
accordingTo,nameAccordingTo
129
authorPlantName,authorTaxonCode
130
taxonNameUsageConceptID,taxonOccurrenceID
131
collectedDate,dateCollected
132
habit,growthForm
133
interpretationType,identificationType
134
identifiedDate,dateIdentified
135
taxonFit,identificationQualifier
136
overallScore,matchedTaxonFit_fraction
137
familyScore,matchedFamilyFit_fraction
138
genusScore,matchedGenusFit_fraction
139
specificEpithetScore,matchedSpeciesFit_fraction
140
speciesInvID,taxonObservationID
141
aggregateOccurrenceID,aggregateOrganismObservationID
142
?intercept,"?intercept_m,intercept_cm"
143
abund1cm,individualCount_1cm_or_more
144
abund2_5cm,individualCount_2_5cm_or_more
145
abund10cm,individualCount_10cm_or_more
146
identificationLabel,tag
147
tag2,tag
148
individualOrganismObservationID,individualObservationID
149
authorPlantCode,individualCode
150
individualOrganismObservationRelativeX,organismX_m
151
individualOrganismObservationRelativeY,organismY_m
152
censusNo,censusNumber
153
phenology,reproductiveCondition
154
cultivated_bien,cultivated
155
cultivatedBasis_bien,cultivatedBasis
156
stemCanopyForm,canopyForm
157
stemCanopyPosition,canopyPosition
158
stemLianaInfestation,lianaInfestation
159
fieldNotes_DwC_curatorial,organismNotes
160
remarks,organismNotes
161
notes_SALVIAS,organismNotes
162
?fieldNotes,"?organismNotes,eventRemarks"
163
?notes,"?organismNotes,locationRemarks"
164
stemTag2,stemTag
165
stemCode,authorStemCode
166
?stemHeight,"?height_m,height_ft"
167
?height,"?height_m,height_ft"
168
?heightFirstBranch,"?heightFirstBranch_m,heightFirstBranch_ft"
169
htFirstBranch_m,heightFirstBranch_m
170
?stemDbh,"?diameterBreastHeight_m,diameterBreastHeight_cm,diameterBreastHeight_in"
171
?DBH,"?diameterBreastHeight_m,diameterBreastHeight_cm,diameterBreastHeight_in"
172
?diameterBreastHeight,"?diameterBreastHeight_m,diameterBreastHeight_cm,diameterBreastHeight_in"
173
?gentryDbh,"?diameterBreastHeightGentry_m,diameterBreastHeightGentry_cm,diameterBreastHeightGentry_in"
174
?diameterBreastHeightGentry,"?diameterBreastHeightGentry_m,diameterBreastHeightGentry_cm,diameterBreastHeightGentry_in"
175
?basalDiam,"?basalDiameter_m,basalDiameter_cm,basalDiameter_in"
176
?basalDiameter,"?basalDiameter_m,basalDiameter_cm,basalDiameter_in"
177
museumAccessionNumber,catalogNumber
178
accessionNumber,catalogNumber
179
accession,catalogNumber
180
preparationType,preparations
75 181
preparation,preparations
182
previousCatalogNumber,otherCatalogNumbers
183
detType,voucherType
184
traitName,measurementType
185
traitValue,measurementValue
186
unit,measurementUnit
187
relatedCatalogItem,relatedResourceID
188
relationshipType,relationshipOfResource

Also available in: Unified diff