Project

General

Profile

« Previous | Next » 

Revision 10943

inputs/VegBank/: switched to new-style import, using the steps at http://wiki.vegpath.org/Adding_new-style_import_to_a_datasource

View differences:

inputs/VegBank/plot_/VegBIEN.csv
1
VegBank,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
authorplotcode,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/1",
3
plot_id,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
plot_id,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
authorplotcode,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
6
plot_id,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
7
accessRights,/location/accesslevel,
8
area,/location/area_m2,"""Total area of the plot in m2"" (area definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=plot&entity=dba_tabledescription&where=where_tablename>)"
9
elevation,/location/elevation_m/_alt/1,"has only 5 decimal places of precision, with only 9s and random #s after that. ""The elevation of the plot origin in meters above sea level"" (elevation definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=plot&entity=dba_tabledescription&where=where_tablename>)"
10
locationnarrative,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/1,
11
landform,/location/landform,
12
authorplotcode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
13
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
14
authorplotcode,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
15
plot_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
locationnarrative,/location/locationnarrative/_merge/1,
17
coordinateUncertaintyInMeters,/location/locationplace/*_id/place/*_id/coordinates/coordsaccuracy_m/_noCV/value,
18
shape,/location/locationplace/*_id/place/*_id/coordinates/footprintgeometry_dwc,
19
latitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
20
longitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
21
continent,/location/locationplace/*_id/place/continent,
22
country,/location/locationplace/*_id/place/country,
23
county,/location/locationplace/*_id/place/county,
24
latitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/latitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
25
longitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/longitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
26
country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
27
county,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
28
stateprovince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
29
stateprovince,/location/locationplace/*_id/place/stateprovince,
30
parent_id,/location/parent_id/location/sourceaccessioncode,
31
slopeaspect,/location/slopeaspect_deg/_alt/1/_compass/value,
32
minslopeaspect,/location/slopeaspect_deg/_alt/2/_avg/1,
33
maxslopeaspect,/location/slopeaspect_deg/_alt/2/_avg/2,
34
slopegradient,/location/slopegradient_fraction/_alt/1,
35
minslopegradient,/location/slopegradient_fraction/_alt/2/_avg/1,
36
maxslopegradient,/location/slopegradient_fraction/_alt/2/_avg/2,
37
plot_id,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
38
plot_id,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
39
Geographic Name,,** No join mapping for *Geographic Name ** 
40
accessioncode,,** No join mapping for *accessioncode ** 
41
area|country|territory,,** No non-empty join mapping for DUPLICATE#of:country#area|country|territory ** 
42
authordatum,,** No join mapping for *authordatum ** 
43
authore,,** No join mapping for *authore ** 
44
authorlocation,,** No join mapping for *authorlocation ** 
45
authorn,,** No join mapping for *authorn ** 
46
authorzone,,** No join mapping for *authorzone ** 
47
azimuth,,** No join mapping for *azimuth ** 
48
confidentialityreason,,** No join mapping for *confidentialityreason ** 
49
confidentialitystatus,,** No join mapping for accessRights_verbatim ** 
50
dateentered,,** No join mapping for *dateentered ** 
51
dsgpoly,,** No join mapping for *dsgpoly ** 
52
elevationaccuracy,,** No join mapping for *elevationaccuracy ** 
53
elevationrange,,** No non-empty join mapping for UNUSED#elevationrange ** 
54
emb_plot,,** No join mapping for *emb_plot ** 
55
layoutnarrative,,** No join mapping for *layoutnarrative ** 
56
locationaccuracy,,** No join mapping for coordinateUncertaintyInMeters__from_coords ** 
57
notesmgt,,** No join mapping for *notesmgt ** 
58
notespublic,,** No join mapping for *notespublic ** 
59
permanence,,** No join mapping for *permanence ** 
60
placementmethod,,** No join mapping for *placementmethod ** 
61
plotrationalenarrative,,** No join mapping for *plotrationalenarrative ** 
62
quadrangle,,** No join mapping for *quadrangle ** 
63
reference_id,,** No join mapping for *reference_id ** 
64
region|state|province,,** No non-empty join mapping for DUPLICATE#of:stateprovince#region|state|province ** 
65
revisions,,** No join mapping for *revisions ** 
66
rocktype,,** No join mapping for *rocktype ** 
67
standsize,,** No join mapping for *standsize ** 
68
submitter_email,,** No join mapping for *submitter_email ** 
69
submitter_givenname,,** No join mapping for *submitter_givenname ** 
70
submitter_surname,,** No join mapping for *submitter_surname ** 
71
surficialdeposits,,** No join mapping for *surficialdeposits ** 
72
topoposition,,** No join mapping for *topoposition ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
73 2

  
inputs/VegBank/stemcount_/postprocess.sql
2 2

  
3 3

  
4 4
SELECT mk_derived_col((:table_str, 'aggregateOrganismObservationID'),
5
$$_join("taxonimportance_id"::text, "stemcount_id"::text)$$)
5
$$_join("aggregateOrganismObservationID__taxon_presence"::text, "aggregateOrganismObservationID__individual_count"::text)$$)
6 6
; -- runtime: 15 s ("Time: 15805.876 ms") @starscream
inputs/VegBank/stemcount_/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/stemcount_/map.csv
26 26
stemcount,individualCount,,
27 27
stemtaxonarea,*stemtaxonarea,,
28 28
emb_stemcount,*emb_stemcount,,
29
aggregateOrganismObservationID,aggregateOrganismObservationID,,
inputs/VegBank/stemcount_/test.xml.ref
10 10
                        <locationevent>
11 11
                            <taxonoccurrence>
12 12
                                <aggregateoccurrence>
13
                                    <count>$stemcount</count>
14
                                    <cover_fraction><_percent_to_fraction><value>$cover</value></_percent_to_fraction></cover_fraction>
13
                                    <count>$individualCount</count>
14
                                    <cover_fraction><_percent_to_fraction><value>$coverPercent</value></_percent_to_fraction></cover_fraction>
15 15
                                    <plantobservation>
16 16
                                        <stemobservation>
17
                                            <diameterbreastheight_m><_cm_to_m><value>$stemdiameter</value></_cm_to_m></diameterbreastheight_m>
18
                                            <height_m>$stemheight</height_m>
17
                                            <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
18
                                            <height_m>$height_m</height_m>
19 19
                                        </stemobservation>
20 20
                                    </plantobservation>
21 21
                                    <sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode>
22 22
                                </aggregateoccurrence>
23
                                <sourceaccessioncode>$taxonobservation_id</sourceaccessioncode>
23
                                <sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode>
24 24
                            </taxonoccurrence>
25 25
                        </locationevent>
26 26
                    </location>
inputs/VegBank/stemcount_/VegBIEN.csv
1
VegBank,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
taxonobservation_id,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists","Note that taxonimportance is not 1:1 with taxonobservation [1].
3

  
4
[1] The following query returns rows:
5
-----
6
SELECT taxonobservation_id, count(distinct taxonimportance_id)
7
FROM ""VegBank"".taxonimportance
8
GROUP BY taxonobservation_id
9
HAVING count(distinct taxonimportance_id) > 1
10
-----"
11
stemcount,/location/locationevent/taxonoccurrence/aggregateoccurrence/count,
12
cover,/location/locationevent/taxonoccurrence/aggregateoccurrence/cover_fraction/_percent_to_fraction/value,
13
stemdiameter,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value,"""The diameter of the stem in centimeters"" (stemDiameter definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemcount&entity=dba_tabledescription&where=where_tablename>)"
14
stemheight,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m,"""The measured height of the stem in meters"" (stemHeight definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemcount&entity=dba_tabledescription&where=where_tablename>)"
15
aggregateOrganismObservationID,/location/locationevent/taxonoccurrence/aggregateoccurrence/sourceaccessioncode,
16
taxonobservation_id,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists","Note that taxonimportance is not 1:1 with taxonobservation [1].
17

  
18
[1] The following query returns rows:
19
-----
20
SELECT taxonobservation_id, count(distinct taxonimportance_id)
21
FROM ""VegBank"".taxonimportance
22
GROUP BY taxonobservation_id
23
HAVING count(distinct taxonimportance_id) > 1
24
-----"
25
taxonobservation_id,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/1,"Note that taxonimportance is not 1:1 with taxonobservation [1].
26

  
27
[1] The following query returns rows:
28
-----
29
SELECT taxonobservation_id, count(distinct taxonimportance_id)
30
FROM ""VegBank"".taxonimportance
31
GROUP BY taxonobservation_id
32
HAVING count(distinct taxonimportance_id) > 1
33
-----"
34
aggregateOrganismObservationID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/cond/_exists",
35
taxonobservation_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/_if[@name=""if has taxondetermination""]/cond/_exists","Note that taxonimportance is not 1:1 with taxonobservation [1].
36

  
37
[1] The following query returns rows:
38
-----
39
SELECT taxonobservation_id, count(distinct taxonimportance_id)
40
FROM ""VegBank"".taxonimportance
41
GROUP BY taxonobservation_id
42
HAVING count(distinct taxonimportance_id) > 1
43
-----"
44
basalarea,,** No join mapping for *basalarea ** 
45
biomass,,** No join mapping for *biomass ** 
46
covercode,,** No join mapping for *covercode ** 
47
emb_stemcount,,** No join mapping for *emb_stemcount ** 
48
emb_taxonimportance,,** No join mapping for *emb_taxonimportance ** 
49
inferencearea,,** No join mapping for *inferencearea ** 
50
stemcount_id,,** No join mapping for aggregateOrganismObservationID__individual_count ** 
51
stemdiameteraccuracy,,** No join mapping for *stemdiameteraccuracy ** 
52
stemheightaccuracy,,** No join mapping for *stemheightaccuracy ** 
53
stemtaxonarea,,** No join mapping for *stemtaxonarea ** 
54
stratum_id,,** No join mapping for *stratum_id ** 
55
stratumbase,,** No join mapping for *stratumbase ** 
56
stratumheight,,** No join mapping for *stratumheight ** 
57
taxonimportance_id,,** No join mapping for aggregateOrganismObservationID__taxon_presence ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
58 2

  
inputs/VegBank/observation_/postprocess.sql
1 1
SELECT util.search_path_append('util');
2 2

  
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("observation_id")$$); -- runtime: ~0 ("Time: 1.838 ms") @starscream
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("eventID")$$); -- runtime: ~0 ("Time: 1.838 ms") @starscream
inputs/VegBank/observation_/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/observation_/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <sourceaccessioncode>$plot_id</sourceaccessioncode>
10
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
11 11
                        <locationevent>
12
                            <method_id><method><name>$methodnarrative</name></method></method_id>
13
                            <project_id><project><sourceaccessioncode>$project_id</sourceaccessioncode></project></project_id>
14
                            <authoreventcode>$authorobscode</authoreventcode>
15
                            <sourceaccessioncode>$observation_id</sourceaccessioncode>
16
                            <obsenddate>$obsenddate</obsenddate>
17
                            <obsstartdate>$obsstartdate</obsstartdate>
12
                            <method_id><method><name>$samplingProtocol</name></method></method_id>
13
                            <project_id><project><sourceaccessioncode>$projectID</sourceaccessioncode></project></project_id>
14
                            <authoreventcode>$authorEventCode</authoreventcode>
15
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
16
                            <obsenddate>$endDate</obsenddate>
17
                            <obsstartdate>$startDate</obsstartdate>
18 18
                            <soilsample>
19
                                <basesaturation_fraction><_percent_to_fraction><value>$basesaturation</value></_percent_to_fraction></basesaturation_fraction>
20
                                <cationexchangecapacity_cmol_kg>$exchangecapacity</cationexchangecapacity_cmol_kg>
21
                                <clay_fraction><_percent_to_fraction><value>$soilclay</value></_percent_to_fraction></clay_fraction>
22
                                <organic_fraction><_percent_to_fraction><value>$soilorganic</value></_percent_to_fraction></organic_fraction>
23
                                <ph>$soilph</ph>
24
                                <sand_fraction><_percent_to_fraction><value>$soilsand</value></_percent_to_fraction></sand_fraction>
25
                                <silt_fraction><_percent_to_fraction><value>$soilsilt</value></_percent_to_fraction></silt_fraction>
26
                                <texture>$soiltexture</texture>
19
                                <basesaturation_fraction><_percent_to_fraction><value>$baseSaturation_percent</value></_percent_to_fraction></basesaturation_fraction>
20
                                <cationexchangecapacity_cmol_kg>$cationExchangeCapacity_cmol_kg</cationexchangecapacity_cmol_kg>
21
                                <clay_fraction><_percent_to_fraction><value>$clay_percent</value></_percent_to_fraction></clay_fraction>
22
                                <organic_fraction><_percent_to_fraction><value>$organic_percent</value></_percent_to_fraction></organic_fraction>
23
                                <ph>$ph</ph>
24
                                <sand_fraction><_percent_to_fraction><value>$sand_percent</value></_percent_to_fraction></sand_fraction>
25
                                <silt_fraction><_percent_to_fraction><value>$silt_percent</value></_percent_to_fraction></silt_fraction>
26
                                <texture>$texture</texture>
27 27
                            </soilsample>
28 28
                        </locationevent>
29 29
                    </location>
inputs/VegBank/observation_/VegBIEN.csv
1
VegBank,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
plot_id,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3
authorobscode,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/else",
4
plot_id,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
plot_id,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
methodnarrative,/location/locationevent/*_id/method/name,
7
project_id,/location/locationevent/*_id/project/sourceaccessioncode,
8
authorobscode,"/location/locationevent/_if[@name=""if subplot""]/else/authoreventcode",
9
observation_id,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
10
authorobscode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
obsenddate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
12
observation_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
13
obsstartdate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
14
plot_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
15
authorobscode,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authoreventcode",
16
obsenddate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_alt/1",
17
obsstartdate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_alt/1",
18
observation_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
19
obsenddate,/location/locationevent/obsenddate/_alt/1,
20
obsstartdate,/location/locationevent/obsstartdate/_alt/1,
21
basesaturation,/location/locationevent/soilsample/basesaturation_fraction/_percent_to_fraction/value,"""Percent base saturation"" (baseSaturation definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
22
exchangecapacity,/location/locationevent/soilsample/cationexchangecapacity_cmol_kg,
23
soilclay,/location/locationevent/soilsample/clay_fraction/_percent_to_fraction/value,"""Percent clay in the soil horizon"" (soilClay definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
24
soilorganic,/location/locationevent/soilsample/organic_fraction/_percent_to_fraction/value,"""Percent organic content of the soil"" (soilOrganic definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
25
soilph,/location/locationevent/soilsample/ph,
26
soilsand,/location/locationevent/soilsample/sand_fraction/_percent_to_fraction/value,"""Percent sand in the soil horizon"" (soilSand definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
27
soilsilt,/location/locationevent/soilsample/silt_fraction/_percent_to_fraction/value,"""Percent silt in the soil horizon"" (soilSilt definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
28
soiltexture,/location/locationevent/soilsample/texture,
29
authorobscode,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
30
observation_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
31
plot_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
32
plot_id,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
33
plot_id,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
34
accessioncode,,** No join mapping for *accessioncode ** 
35
autotaxoncover,,** No join mapping for *autotaxoncover ** 
36
basalarea,,** No join mapping for *basalarea ** 
37
bryophytequality,,** No join mapping for *bryophytequality ** 
38
coverdispersion,,** No join mapping for *coverdispersion ** 
39
covermethod_id,,** No join mapping for *covermethod_id ** 
40
dateaccuracy,,** No join mapping for *dateaccuracy ** 
41
dateentered,,** No join mapping for *dateentered ** 
42
dominantstratum,,** No join mapping for *dominantstratum ** 
43
effortlevel,,** No join mapping for *effortlevel ** 
44
emb_observation,,** No join mapping for *emb_observation ** 
45
emb_soilobs,,** No join mapping for *emb_soilobs ** 
46
fieldcover,,** No join mapping for *fieldcover ** 
47
fieldht,,** No join mapping for *fieldht ** 
48
floatingcover,,** No join mapping for *floatingcover ** 
49
floristicquality,,** No join mapping for *floristicquality ** 
50
growthform1cover,,** No join mapping for *growthform1cover ** 
51
growthform1type,,** No join mapping for *growthform1type ** 
52
growthform2cover,,** No join mapping for *growthform2cover ** 
53
growthform2type,,** No join mapping for *growthform2type ** 
54
growthform3cover,,** No join mapping for *growthform3cover ** 
55
growthform3type,,** No join mapping for *growthform3type ** 
56
homogeneity,,** No join mapping for *homogeneity ** 
57
hydrologicregime,,** No join mapping for *hydrologicregime ** 
58
interp_bestfit_cc_id,,** No join mapping for *interp_bestfit_cc_id ** 
59
interp_bestfit_ci_id,,** No join mapping for *interp_bestfit_ci_id ** 
60
interp_bestfit_code,,** No join mapping for *interp_bestfit_code ** 
61
interp_bestfit_party_id,,** No join mapping for *interp_bestfit_party_id ** 
62
interp_bestfit_partyname,,** No join mapping for *interp_bestfit_partyname ** 
63
interp_bestfit_sciname,,** No join mapping for *interp_bestfit_sciname ** 
64
interp_current_cc_id,,** No join mapping for *interp_current_cc_id ** 
65
interp_current_ci_id,,** No join mapping for *interp_current_ci_id ** 
66
interp_current_code,,** No join mapping for *interp_current_code ** 
67
interp_current_party_id,,** No join mapping for *interp_current_party_id ** 
68
interp_current_partyname,,** No join mapping for *interp_current_partyname ** 
69
interp_current_sciname,,** No join mapping for *interp_current_sciname ** 
70
interp_orig_cc_id,,** No join mapping for *interp_orig_cc_id ** 
71
interp_orig_ci_id,,** No join mapping for *interp_orig_ci_id ** 
72
interp_orig_code,,** No join mapping for *interp_orig_code ** 
73
interp_orig_party_id,,** No join mapping for *interp_orig_party_id ** 
74
interp_orig_partyname,,** No join mapping for *interp_orig_partyname ** 
75
interp_orig_sciname,,** No join mapping for *interp_orig_sciname ** 
76
landscapenarrative,,** No join mapping for *landscapenarrative ** 
77
lichenquality,,** No join mapping for *lichenquality ** 
78
nameother,,** No join mapping for *nameother ** 
79
nonvascularcover,,** No join mapping for *nonvascularcover ** 
80
nonvascularht,,** No join mapping for *nonvascularht ** 
81
notesmgt,,** No join mapping for *notesmgt ** 
82
notespublic,,** No join mapping for *notespublic ** 
83
numberoftaxa,,** No join mapping for *numberoftaxa ** 
84
observationnarrative,,** No join mapping for *observationnarrative ** 
85
organicdepth,,** No join mapping for *organicdepth ** 
86
originaldata,,** No join mapping for *originaldata ** 
87
percentbaresoil,,** No join mapping for *percentbaresoil ** 
88
percentbedrock,,** No join mapping for *percentbedrock ** 
89
percentlitter,,** No join mapping for *percentlitter ** 
90
percentother,,** No join mapping for *percentother ** 
91
percentrockgravel,,** No join mapping for *percentrockgravel ** 
92
percentwater,,** No join mapping for *percentwater ** 
93
percentwood,,** No join mapping for *percentwood ** 
94
phenologicaspect,,** No join mapping for *phenologicaspect ** 
95
plotvalidationlevel,,** No join mapping for *plotvalidationlevel ** 
96
previousobs_id,,** No join mapping for *previousobs_id ** 
97
representativeness,,** No join mapping for *representativeness ** 
98
revisions,,** No join mapping for *revisions ** 
99
shoredistance,,** No join mapping for *shoredistance ** 
100
shrubcover,,** No join mapping for *shrubcover ** 
101
shrubht,,** No join mapping for *shrubht ** 
102
soilcoarse,,"** No join mapping for *soilcoarse ** ""percent coarse fragments in the soil"" (soilCoarse definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=soilobs&entity=dba_tabledescription&where=where_tablename>)"
103
soilcolor,,** No join mapping for *soilcolor ** 
104
soildepth,,** No join mapping for *soildepth ** 
105
soildepthbottom,,** No join mapping for *soildepthbottom ** 
106
soildepthtop,,** No join mapping for *soildepthtop ** 
107
soildescription,,** No join mapping for *soildescription ** 
108
soildrainage,,** No join mapping for *soildrainage ** 
109
soilhorizon,,** No join mapping for *soilhorizon ** 
110
soilmoistureregime,,** No join mapping for *soilmoistureregime ** 
111
soilobs_id,,** No join mapping for *soilobs_id ** 
112
soiltaxon_id,,** No join mapping for *soiltaxon_id ** 
113
soiltaxonsrc,,** No join mapping for *soiltaxonsrc ** 
114
standmaturity,,** No join mapping for *standmaturity ** 
115
stemobservationarea,,** No join mapping for *stemobservationarea ** 
116
stemsamplemethod,,** No join mapping for *stemsamplemethod ** 
117
stemsizelimit,,** No join mapping for *stemsizelimit ** 
118
stratummethod_id,,** No join mapping for *stratummethod_id ** 
119
submergedcover,,** No join mapping for *submergedcover ** 
120
submergedht,,** No join mapping for *submergedht ** 
121
successionalstatus,,** No join mapping for *successionalstatus ** 
122
taxonobservationarea,,** No join mapping for *taxonobservationarea ** 
123
toptaxon1name,,** No join mapping for *toptaxon1name ** 
124
toptaxon2name,,** No join mapping for *toptaxon2name ** 
125
toptaxon3name,,** No join mapping for *toptaxon3name ** 
126
toptaxon4name,,** No join mapping for *toptaxon4name ** 
127
toptaxon5name,,** No join mapping for *toptaxon5name ** 
128
totalcover,,** No join mapping for *totalcover ** 
129
treecover,,** No join mapping for *treecover ** 
130
treeht,,** No join mapping for *treeht ** 
131
waterdepth,,** No join mapping for *waterdepth ** 
132
watersalinity,,** No join mapping for *watersalinity ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
133 2

  
inputs/VegBank/stemlocation_/postprocess.sql
1 1
SELECT util.search_path_append('util');
2 2

  
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("stemlocation_id")$$); -- runtime: 0.1 s ("Time: 74.164 ms") @starscream
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("stemID")$$); -- runtime: 0.1 s ("Time: 74.164 ms") @starscream
4 4

  
5 5

  
6
SELECT mk_derived_col((:table_str, 'individualID'), $$stemlocation_id$$) ; -- runtime: ~0 ("Time: 1.562 ms") @starscream
6
SELECT mk_derived_col((:table_str, 'individualID'), $$"stemID"$$) ; -- runtime: ~0 ("Time: 1.562 ms") @starscream
7 7

  
8 8
SELECT mk_derived_col((:table_str, 'aggregateOrganismObservationID'),
9
$$_join("taxonimportance_id"::text, "stemcount_id"::text)$$)
9
$$_join("aggregateOrganismObservationID__taxon_presence"::text, "aggregateOrganismObservationID__individual_count"::text)$$)
10 10
; -- runtime: 0.5 s ("Time: 441.059 ms") @starscream
inputs/VegBank/stemlocation_/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/stemlocation_/map.csv
14 14
stemcount,individualCount,,
15 15
stemtaxonarea,*stemtaxonarea,,
16 16
emb_stemcount,*emb_stemcount,,
17
aggregateOrganismObservationID,aggregateOrganismObservationID,,
18
individualID,individualID,,
inputs/VegBank/stemlocation_/test.xml.ref
10 10
                        <locationevent>
11 11
                            <taxonoccurrence>
12 12
                                <aggregateoccurrence>
13
                                    <count>$stemcount</count>
13
                                    <count>$individualCount</count>
14 14
                                    <plantobservation>
15 15
                                        <sourceaccessioncode>$individualID</sourceaccessioncode>
16 16
                                        <stemobservation>
17
                                            <diameterbreastheight_m><_cm_to_m><value>$stemdiameter</value></_cm_to_m></diameterbreastheight_m>
18
                                            <height_m>$stemheight</height_m>
19
                                            <sourceaccessioncode>$stemlocation_id</sourceaccessioncode>
17
                                            <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
18
                                            <height_m>$height_m</height_m>
19
                                            <sourceaccessioncode>$stemID</sourceaccessioncode>
20 20
                                        </stemobservation>
21 21
                                    </plantobservation>
22 22
                                    <sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode>
inputs/VegBank/stemlocation_/VegBIEN.csv
1
VegBank,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
individualID,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
3
stemcount,/location/locationevent/taxonoccurrence/aggregateoccurrence/count,
4
individualID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/sourceaccessioncode/_first/2,
5
stemdiameter,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value,"""The diameter of the stem in centimeters"" (stemDiameter definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemcount&entity=dba_tabledescription&where=where_tablename>)"
6
stemheight,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m,"""The measured height of the stem in meters"" (stemHeight definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemcount&entity=dba_tabledescription&where=where_tablename>)"
7
stemlocation_id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/sourceaccessioncode,
8
aggregateOrganismObservationID,/location/locationevent/taxonoccurrence/aggregateoccurrence/sourceaccessioncode,
9
individualID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/1/_if[@name=""if individual""]/cond/_exists",
10
stemlocation_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/1/_if[@name=""if individual""]/cond/_exists",
11
individualID,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
12
aggregateOrganismObservationID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/cond/_exists",
13
individualID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/else/_first/2",
14
emb_stemcount,,** No join mapping for *emb_stemcount ** 
15
emb_stemlocation,,** No join mapping for *emb_stemlocation ** 
16
stemcode,,** No non-empty join mapping for UNUSED#stemcode ** 
17
stemcount_id,,** No join mapping for aggregateOrganismObservationID__individual_count ** 
18
stemdiameteraccuracy,,** No join mapping for *stemdiameteraccuracy ** 
19
stemhealth,,** No join mapping for *stemhealth ** this *is* populated
20
stemheightaccuracy,,** No join mapping for *stemheightaccuracy ** 
21
stemtaxonarea,,** No join mapping for *stemtaxonarea ** 
22
stemxposition,,"** No non-empty join mapping for UNUSED#stemxposition ** ""The X-coordinate of the stem position in m"" (stemXPosition definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemlocation&entity=dba_tabledescription&where=where_tablename>)"
23
stemyposition,,"** No non-empty join mapping for UNUSED#stemyposition ** ""The Y-coordinate of the stem position, as above"" (stemYPosition definition at <http://vegbank.org/vegbank/views/dba_tabledescription_detail.jsp?view=detail&wparam=stemlocation&entity=dba_tabledescription&where=where_tablename>)"
24
taxonimportance_id,,** No join mapping for aggregateOrganismObservationID__taxon_presence ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
25 2

  
inputs/VegBank/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/runscripts/datasrc_dir.run
0 3

  
inputs/VegBank/taxonobservation_/postprocess.sql
2 2

  
3 3

  
4 4
SELECT mk_derived_col((:table_str, 'scientificName'),
5
$$_alt("int_currplantscifull", "plantconcept_plantname")$$)
5
$$_alt("scientificName_verbatim", "scientificName__for_nearest_taxon_concept")$$)
6 6
; -- runtime: 15 s ("Time: 12334.893 ms") @starscream
inputs/VegBank/taxonobservation_/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/taxonobservation_/map.csv
42 42
collectiondate,dateCollected,,
43 43
emb_taxoninterpretation,*emb_taxoninterpretation,,
44 44
taxoninterpretation_accessioncode,*taxoninterpretation_accessioncode,,
45
plantname_id,*plantname_id,,
46 45
plantconcept_reference_id,*plantconcept_reference_id,,
47 46
plantconcept_plantname,scientificName__for_nearest_taxon_concept,,"when int_currplantscifull also provided, this often leaves out lower ranks. however, int_currplantscifull is not always provided when this is."
48 47
plantcode,*plantcode,,
......
68 67
plantname_reference_id,*plantname_reference_id,,
69 68
dateentered,*dateentered,,
70 69
:plot,observationGranularity,,
71
scientificName,scientificName,,
inputs/VegBank/taxonobservation_/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <authorlocationcode>
11
                            <_if name="if plot">
12
                                <cond>
13
                                    <_eq>
14
                                        <right>plot</right>
15
                                        <left>$observationGranularity</left>
16
                                    </_eq>
17
                                </cond>
18
                                <else>$accessionNumber</else>
19
                            </_if>
20
                        </authorlocationcode>
10 21
                        <locationevent>
11
                            <sourceaccessioncode>$observation_id</sourceaccessioncode>
22
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
12 23
                            <taxonoccurrence>
13 24
                                <aggregateoccurrence>
14
                                    <collectiondate>$collectiondate</collectiondate>
15
                                    <notes>$notes</notes>
25
                                    <collectiondate>$dateCollected</collectiondate>
26
                                    <notes>$occurrenceRemarks</notes>
16 27
                                    <plantobservation>
17
                                        <authorplantcode>$collectionnumber</authorplantcode>
28
                                        <authorplantcode>$collectorNumber</authorplantcode>
18 29
                                        <specimenreplicate>
19
                                            <catalognumber_dwc>$museumaccessionnumber</catalognumber_dwc>
20
                                            <collectionnumber>$collectionnumber</collectionnumber>
30
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
31
                                            <collectionnumber>$collectorNumber</collectionnumber>
21 32
                                        </specimenreplicate>
22 33
                                    </plantobservation>
23 34
                                </aggregateoccurrence>
24
                                <authortaxoncode>$collectionnumber</authortaxoncode>
25
                                <sourceaccessioncode>$taxonobservation_id</sourceaccessioncode>
35
                                <authortaxoncode>$collectorNumber</authortaxoncode>
36
                                <sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode>
26 37
                                <taxondetermination>
27 38
                                    <taxonverbatim_id>
28 39
                                        <taxonverbatim>
......
48 59
                                                                                                    <parent_id>
49 60
                                                                                                        <taxonlabel>
50 61
                                                                                                            <rank>genus</rank>
51
                                                                                                            <taxonepithet>$Genus</taxonepithet>
62
                                                                                                            <taxonepithet>$genus</taxonepithet>
52 63
                                                                                                            <parent_id>
53 64
                                                                                                                <taxonlabel>
54 65
                                                                                                                    <rank>family</rank>
55
                                                                                                                    <taxonepithet>$Family</taxonepithet>
66
                                                                                                                    <taxonepithet>$family</taxonepithet>
56 67
                                                                                                                    <parent_id>
57 68
                                                                                                                        <taxonlabel>
58 69
                                                                                                                            <rank>order</rank>
59
                                                                                                                            <taxonepithet>$Order</taxonepithet>
70
                                                                                                                            <taxonepithet>$order</taxonepithet>
60 71
                                                                                                                            <parent_id>
61 72
                                                                                                                                <taxonlabel>
62 73
                                                                                                                                    <rank>class</rank>
63
                                                                                                                                    <taxonepithet>$Class</taxonepithet>
74
                                                                                                                                    <taxonepithet>$class</taxonepithet>
64 75
                                                                                                                                    <parent_id>
65 76
                                                                                                                                        <taxonlabel>
66 77
                                                                                                                                            <rank>phylum</rank>
67 78
                                                                                                                                            <parent_id>
68 79
                                                                                                                                                <taxonlabel>
69 80
                                                                                                                                                    <rank>kingdom</rank>
70
                                                                                                                                                    <taxonepithet>$Kingdom</taxonepithet>
81
                                                                                                                                                    <taxonepithet>$kingdom</taxonepithet>
71 82
                                                                                                                                                </taxonlabel>
72 83
                                                                                                                                            </parent_id>
73 84
                                                                                                                                        </taxonlabel>
......
94 105
                                                    </parent_id>
95 106
                                                    <taxonomicname>
96 107
                                                        <_merge_prefix>
97
                                                            <prefix><_taxon_family_require_std><family>$Family</family></_taxon_family_require_std></prefix>
108
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
98 109
                                                            <value>
99 110
                                                                <_alt>
100 111
                                                                    <1>$scientificName</1>
101 112
                                                                    <2>
102 113
                                                                        <_alt>
103
                                                                            <1>$int_currplantscinamenoauth</1>
104
                                                                            <2><_filter_genus><value>$Genus</value></_filter_genus></2>
114
                                                                            <1>$taxonName</1>
115
                                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
105 116
                                                                        </_alt>
106 117
                                                                    </2>
107 118
                                                                </_alt>
......
110 121
                                                    </taxonomicname>
111 122
                                                </taxonlabel>
112 123
                                            </taxonlabel_id>
113
                                            <family>$Family</family>
114
                                            <genus>$Genus</genus>
115
                                            <taxonname>$int_currplantscinamenoauth</taxonname>
124
                                            <family>$family</family>
125
                                            <genus>$genus</genus>
126
                                            <taxonname>$taxonName</taxonname>
116 127
                                            <taxonomicname>$scientificName</taxonomicname>
117 128
                                        </taxonverbatim>
118 129
                                    </taxonverbatim_id>
119
                                    <determinationdate><_dateRangeStart><value>$interpretationdate</value></_dateRangeStart></determinationdate>
120
                                    <determinationtype>$interpretationtype</determinationtype>
121
                                    <taxonfit>$taxonfit</taxonfit>
130
                                    <determinationdate><_dateRangeStart><value>$dateIdentified</value></_dateRangeStart></determinationdate>
131
                                    <determinationtype>$identificationType</determinationtype>
132
                                    <taxonfit>$identificationQualifier</taxonfit>
122 133
                                </taxondetermination>
123 134
                                <taxondetermination>
124 135
                                    <isoriginal>true</isoriginal>
125 136
                                    <taxonverbatim_id>
126 137
                                        <taxonverbatim>
127
                                            <taxonname>$int_origplantscinamenoauth</taxonname>
128
                                            <taxonomicname>$authorplantname</taxonomicname>
138
                                            <taxonname>$originalTaxonName</taxonname>
139
                                            <taxonomicname>$originalScientificName</taxonomicname>
129 140
                                        </taxonverbatim>
130 141
                                    </taxonverbatim_id>
131 142
                                </taxondetermination>
inputs/VegBank/taxonobservation_/VegBIEN.csv
1
VegBank,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
museumaccessionnumber,"/_if[@name=""if specimen""]/cond/_exists",
3
:plot,"/_if[@name=""if specimen""]/else/source:[shortname/_first/2/_env:[name=source]]/observationtype",
4
:plot,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/cond/_eq:[right=plot]/left",
5
museumaccessionnumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/cond/_exists",
6
museumaccessionnumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/1/_if[@name=""if specimen""]/cond/_exists",
7
museumaccessionnumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/3/_if[@name=""if indirect voucher""]/else",
8
collectionnumber,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
9
taxonobservation_id,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
10
observation_id,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
11
observation_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
12
observation_id,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
13
interpretationdate,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/determinationdate/_alt/1/_dateRangeStart/value",
14
taxonfit,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/taxonfit",
15
collectiondate,/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/1,
16
notes,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
17
collectionnumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/authorplantcode/_first/2,
18
museumaccessionnumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
19
collectionnumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
20
museumaccessionnumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
21
observation_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
22
collectionnumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
23
int_origplantscinamenoauth,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/1",
24
scientificName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/2",
25
int_currplantscinamenoauth,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/3",
26
collectionnumber,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
27
taxonobservation_id,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
28
taxonobservation_id,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/1,
29
Genus,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=genus]/taxonepithet",includes genus author
30
Family,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=family]/taxonepithet",
31
Order,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=order]/taxonepithet",
32
Class,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=class]/taxonepithet",
33
Kingdom,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,phylum,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=kingdom]/taxonepithet",
34
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
35
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/1,
36
int_currplantscinamenoauth,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/1,
37
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/2/_filter_genus/value,includes genus author
38
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
39
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,includes genus author
40
int_currplantscinamenoauth,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonname,
41
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonomicname,
42
taxonobservation_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/_if[@name=""if has taxondetermination""]/cond/_exists",
43
interpretationdate,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/determinationdate/_alt/1/_dateRangeStart/value,
44
interpretationtype,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/determinationtype,
45
taxonfit,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/taxonfit,
46
int_origplantscinamenoauth,/location/locationevent/taxonoccurrence/taxondetermination[isoriginal=true]/*_id/taxonverbatim/taxonname,
47
authorplantname,/location/locationevent/taxonoccurrence/taxondetermination[isoriginal=true]/*_id/taxonverbatim/taxonomicname,
48
museumaccessionnumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/then",
49
collectionnumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/then",
50
Division,,** No join mapping for *Division ** 
51
Forma,,** No non-empty join mapping for EQUIV#to:plantname#Forma ** *full* taxonomic name at that rank
52
Species,,** No non-empty join mapping for EQUIV#to:plantname#Species ** *full* taxonomic name at that rank
53
Subclass,,** No join mapping for *Subclass ** 
54
Subdivision,,** No join mapping for *Subdivision ** 
55
Subkingdom,,** No join mapping for *Subkingdom ** 
56
Subspecies,,** No non-empty join mapping for EQUIV#to:plantname#Subspecies ** *full* taxonomic name at that rank
57
Superdivision,,** No join mapping for *Superdivision ** 
58
Variety,,** No non-empty join mapping for EQUIV#to:plantname#Variety ** *full* taxonomic name at that rank
59
collector_id,,** No non-empty join mapping for UNUSED#collector_id ** 
60
currentinterpretation,,** No join mapping for *currentinterpretation ** 
61
d_currentaccepted,,** No join mapping for *d_currentaccepted ** 
62
d_obscount,,** No join mapping for *d_obscount ** 
63
dateentered,,** No join mapping for *dateentered ** 
64
emb_taxoninterpretation,,** No join mapping for *emb_taxoninterpretation ** 
65
emb_taxonobservation,,** No join mapping for *emb_taxonobservation ** 
66
grouptype,,** No join mapping for *grouptype ** 
67
int_currplantcode,,** No join mapping for *int_currplantcode ** 
68
int_currplantcommon,,** No join mapping for vernacularName ** 
69
int_currplantconcept_id,,** No join mapping for *int_currplantconcept_id ** 
70
int_currplantscifull,,** No join mapping for scientificName_verbatim ** 
71
int_origplantcode,,** No join mapping for *int_origplantcode ** 
72
int_origplantcommon,,** No join mapping for originalVernacularName ** 
73
int_origplantconcept_id,,** No join mapping for *int_origplantconcept_id ** 
74
int_origplantscifull,,** No non-empty join mapping for EQUIV#to:authorplantname#int_origplantscifull **  = originalScientificName_scrubbed
75
museum_id,,** No join mapping for *museum_id ** 
76
notesmgt,,** No join mapping for *notesmgt ** 
77
notespublic,,** No join mapping for *notespublic ** 
78
originalinterpretation,,** No join mapping for *originalinterpretation ** 
79
plantcode,,** No join mapping for *plantcode ** 
80
plantconcept_accessioncode,,** No join mapping for *plantconcept_accessioncode ** 
81
plantconcept_id,,** No join mapping for *plantconcept_id ** 
82
plantconcept_plantname,,"** No join mapping for scientificName__for_nearest_taxon_concept ** when int_currplantscifull also provided, this often leaves out lower ranks. however, int_currplantscifull is not always provided when this is."
83
plantconcept_reference_id,,** No join mapping for *plantconcept_reference_id ** 
84
plantdescription,,** No join mapping for *plantdescription ** 
85
plantname,,** No non-empty join mapping for DUPLICATE#of:plantconcept_plantname#plantname ** exact duplicate
86
plantname_id,,** No join mapping for *plantname_id ** 
87
plantname_reference_id,,** No join mapping for *plantname_reference_id ** 
88
reference_id,,** No join mapping for *reference_id ** 
89
revisions,,** No join mapping for *revisions ** 
90
role_id,,** No join mapping for *role_id ** 
91
stemlocation_id,,** No join mapping for *stemlocation_id ** 
92
taxonconfidence,,** No join mapping for identificationVerificationStatus ** 
93
taxoninferencearea,,** No join mapping for *taxoninferencearea ** 
94
taxoninterpretation_accessioncode,,** No join mapping for *taxoninterpretation_accessioncode ** 
95
taxoninterpretation_id,,** No join mapping for *taxoninterpretation_id ** 
96
taxoninterpretation_party_id,,** No join mapping for *taxoninterpretation_party_id ** 
97
taxoninterpretation_plantname_id,,** No join mapping for *taxoninterpretation_plantname_id ** 
98
taxonobservation_accessioncode,,** No join mapping for *taxonobservation_accessioncode ** 
99
taxonobservation_reference_id,,** No join mapping for *taxonobservation_reference_id ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
100 2

  
inputs/VegBank/taxonobservation_/unmapped_terms.csv
1
*plantname_id
1 2
*plantconcept_id
2 3
*taxonobservation_reference_id
3 4
*taxoninferencearea
......
26 27
*revisions
27 28
*emb_taxoninterpretation
28 29
*taxoninterpretation_accessioncode
29
*plantname_id
30 30
*plantconcept_reference_id
31 31
scientificName__for_nearest_taxon_concept
32 32
*plantcode
inputs/VegBank/plot_/postprocess.sql
1 1
SELECT util.search_path_append('util');
2 2

  
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("plot_id")$$); -- runtime: 0.2 s ("Time: 238.474 ms") @starscream
3
SELECT create_if_not_exists($$ALTER TABLE $$||:table_str||$$ ADD PRIMARY KEY ("locationID")$$); -- runtime: 0.2 s ("Time: 238.474 ms") @starscream
4 4

  
5 5

  
6 6
-- map_*() derived cols
......
26 26
  LANGUAGE sql IMMUTABLE
27 27
  COST 100;
28 28

  
29
SELECT mk_derived_col((:table_str, 'accessRights'), $$map_access_rights("confidentialitystatus")$$); -- runtime: 1 s ("Time: 1270.464 ms") @starscream
29
SELECT mk_derived_col((:table_str, 'accessRights'), $$map_access_rights("accessRights_verbatim")$$); -- runtime: 1 s ("Time: 1270.464 ms") @starscream
30 30

  
31 31
CREATE OR REPLACE FUNCTION map_fuzzing(value integer)
32 32
  RETURNS double precision AS
......
48 48
  LANGUAGE sql IMMUTABLE
49 49
  COST 100;
50 50

  
51
SELECT mk_derived_col((:table_str, 'coordinateUncertaintyInMeters__from_fuzzing'), $$map_fuzzing("confidentialitystatus")$$); -- runtime: 1 s ("Time: 1134.143 ms") @starscream
51
SELECT mk_derived_col((:table_str, 'coordinateUncertaintyInMeters__from_fuzzing'), $$map_fuzzing("accessRights_verbatim")$$); -- runtime: 1 s ("Time: 1134.143 ms") @starscream
52 52

  
53 53

  
54 54
SELECT mk_derived_col((:table_str, 'coordinateUncertaintyInMeters'),
55
$$GREATEST("coordinateUncertaintyInMeters__from_fuzzing", "locationaccuracy")$$)
55
$$GREATEST("coordinateUncertaintyInMeters__from_fuzzing", "coordinateUncertaintyInMeters__from_coords")$$)
56 56
; -- runtime: 1 s ("Time: 712.548 ms") @starscream
inputs/VegBank/plot_/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/VegBank/plot_/map.csv
53 53
county,county,,
54 54
quadrangle,*quadrangle,,
55 55
Geographic Name,*Geographic Name,,
56
accessRights,accessRights,,
57
coordinateUncertaintyInMeters,coordinateUncertaintyInMeters,,
inputs/VegBank/plot_/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <authorlocationcode>$authorplotcode</authorlocationcode>
11
                        <sourceaccessioncode>$plot_id</sourceaccessioncode>
10
                        <authorlocationcode>$locationName</authorlocationcode>
11
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
12 12
                        <accesslevel>$accessRights</accesslevel>
13
                        <area_m2>$area</area_m2>
14
                        <elevation_m>$elevation</elevation_m>
15
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locationnarrative</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
13
                        <area_m2>$plotArea_m2</area_m2>
14
                        <elevation_m>$elevationInMeters</elevation_m>
15
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
16 16
                        <landform>$landform</landform>
17
                        <locationnarrative>$locationnarrative</locationnarrative>
17
                        <locationnarrative>$locality</locationnarrative>
18 18
                        <locationplace>
19 19
                            <place_id>
20 20
                                <place>
21 21
                                    <coordinates_id>
22 22
                                        <coordinates>
23 23
                                            <coordsaccuracy_m><_noCV><value>$coordinateUncertaintyInMeters</value></_noCV></coordsaccuracy_m>
24
                                            <footprintgeometry_dwc>$shape</footprintgeometry_dwc>
24
                                            <footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc>
25 25
                                            <latitude_deg>
26 26
                                                <_nullIf>
27 27
                                                    <null>0</null>
28 28
                                                    <type>float</type>
29
                                                    <value>$latitude</value>
29
                                                    <value>$decimalLatitude</value>
30 30
                                                </_nullIf>
31 31
                                            </latitude_deg>
32 32
                                            <longitude_deg>
33 33
                                                <_nullIf>
34 34
                                                    <null>0</null>
35 35
                                                    <type>float</type>
36
                                                    <value>$longitude</value>
36
                                                    <value>$decimalLongitude</value>
37 37
                                                </_nullIf>
38 38
                                            </longitude_deg>
39 39
                                        </coordinates>
......
51 51
                                                        <_nullIf>
52 52
                                                            <null>0</null>
53 53
                                                            <type>float</type>
54
                                                            <value>$latitude</value>
54
                                                            <value>$decimalLatitude</value>
55 55
                                                        </_nullIf>
56 56
                                                    </latitude_deg>
57 57
                                                    <longitude_deg>
58 58
                                                        <_nullIf>
59 59
                                                            <null>0</null>
60 60
                                                            <type>float</type>
61
                                                            <value>$longitude</value>
61
                                                            <value>$decimalLongitude</value>
62 62
                                                        </_nullIf>
63 63
                                                    </longitude_deg>
64 64
                                                </coordinates>
65 65
                                            </coordinates_id>
66 66
                                            <country>$country</country>
67 67
                                            <county>$county</county>
68
                                            <stateprovince>$stateprovince</stateprovince>
68
                                            <stateprovince>$stateProvince</stateprovince>
69 69
                                        </place>
70 70
                                    </matched_place_id>
71
                                    <stateprovince>$stateprovince</stateprovince>
71
                                    <stateprovince>$stateProvince</stateprovince>
72 72
                                </place>
73 73
                            </place_id>
74 74
                        </locationplace>
75
                        <parent_id><location><sourceaccessioncode>$parent_id</sourceaccessioncode></location></parent_id>
75
                        <parent_id><location><sourceaccessioncode>$parentLocationID</sourceaccessioncode></location></parent_id>
76 76
                        <slopeaspect_deg>
77 77
                            <_alt>
78
                                <1><_compass><value>$slopeaspect</value></_compass></1>
78
                                <1><_compass><value>$slopeAspect</value></_compass></1>
79 79
                                <2>
80 80
                                    <_avg>
81
                                        <1>$minslopeaspect</1>
82
                                        <2>$maxslopeaspect</2>
81
                                        <1>$minSlopeAspect</1>
82
                                        <2>$maxSlopeAspect</2>
83 83
                                    </_avg>
84 84
                                </2>
85 85
                            </_alt>
86 86
                        </slopeaspect_deg>
87 87
                        <slopegradient_fraction>
88 88
                            <_alt>
89
                                <1>$slopegradient</1>
89
                                <1>$slopeGradient</1>
90 90
                                <2>
91 91
                                    <_avg>
92
                                        <1>$minslopegradient</1>
93
                                        <2>$maxslopegradient</2>
92
                                        <1>$minSlopeGradient</1>
93
                                        <2>$maxSlopeGradient</2>
94 94
                                    </_avg>
95 95
                                </2>
96 96
                            </_alt>

Also available in: Unified diff