Project

General

Profile

« Previous | Next » 

Revision 10419

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

View differences:

inputs/CTFS/Plot/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PlotName,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/1",
3
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
PlotName,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
6
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
7
SizeOfSite,/location/area_m2/_ha_to_m2/value,"""Size in hectares"" (SizeOfSite comments in <https://projects.nceas.ucsb.edu/nceas/projects/bien/repository/raw/inputs/CTFS/_src/ctfs-comments_worksheet.xls>)"
8
Elevation,/location/elevation_m/_alt/1,"Assuming units are m based on the range of values [1] and the country the data is from (Panama). Not documented in <https://projects.nceas.ucsb.edu/nceas/projects/bien/repository/raw/inputs/CTFS/_src/ctfs-comments_worksheet.xls>.
9

  
10
[1] Using the following query:
11
-----
12
SELECT ""Elevation""::real, ""LocationName""
13
FROM ""CTFS"".""Plot""
14
GROUP BY ""Elevation""::real , ""LocationName""
15
ORDER BY ""Elevation""::real DESC
16
-----"
17
LocationName,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/1,
18
PlotName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
19
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
20
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
21
PlotName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
22
LocationName,/location/locationnarrative/_merge/1,
23
DescriptionOfSite,/location/locationnarrative/_merge/4,
24
ShapeOfSite,/location/locationplace/*_id/place/*_id/coordinates/footprintgeometry_dwc,
25
Latitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
26
Longitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
27
CountryName,/location/locationplace/*_id/place/country,
28
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"
29
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"
30
CountryName,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
31
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
32
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
33
Country.src.row_num,,** No join mapping for *Country.src.row_num ** 
34
CountryID,,** No join mapping for *CountryID ** 
35
Plot.src.row_num,,** No join mapping for *Plot.src.row_num ** 
36
ReferenceX,,** No join mapping for *ReferenceX ** Rarely used
37
ReferenceY,,** No join mapping for *ReferenceY ** Rarely used
1
link ../../../mappings/VegCore-VegBIEN.csv
38 2

  
inputs/CTFS/StemObservation/postprocess.sql
1 1
SELECT util.search_path_append('util');
2 2

  
3 3
SELECT mk_derived_col((:table_str, 'stemTag'),
4
$$concat_ws('.', "Tag", "StemTag")$$); -- runtime: 30 s ("Time: 29390.121 ms") @starscream
4
$$concat_ws('.', "individual_tag", "stem_subtag")$$); -- runtime: 30 s ("Time: 29390.121 ms") @starscream
5 5
SELECT mk_derived_col((:table_str, 'tag'), $$"stemTag"$$); -- runtime: 25 s ("Time: 25010.752 ms") @starscream
inputs/CTFS/StemObservation/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/StemObservation/map.csv
45 45
Family.src.row_num,*Family.src.row_num,,
46 46
Family,family,,
47 47
ReferenceID,*ReferenceID,,
48
stemTag,stemTag,,
49
tag,tag,,
inputs/CTFS/StemObservation/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <parent_id><location><sourceaccessioncode>$PlotID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$QuadratID</authorlocationcode>
10
                        <parent_id><location><sourceaccessioncode>$locationID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$subplot</authorlocationcode>
12 12
                        <locationevent>
13 13
                            <parent_id>
14 14
                                <locationevent>
......
16 16
                                        <location>
17 17
                                            <sourceaccessioncode>
18 18
                                                <_if name="if subplot">
19
                                                    <cond>$QuadratID</cond>
20
                                                    <then>$PlotID</then>
19
                                                    <cond>$subplot</cond>
20
                                                    <then>$locationID</then>
21 21
                                                </_if>
22 22
                                            </sourceaccessioncode>
23 23
                                        </location>
24 24
                                    </location_id>
25
                                    <sourceaccessioncode>$CensusID</sourceaccessioncode>
25
                                    <sourceaccessioncode>$eventID</sourceaccessioncode>
26 26
                                </locationevent>
27 27
                            </parent_id>
28 28
                            <taxonoccurrence>
29 29
                                <aggregateoccurrence>
30 30
                                    <plantobservation>
31
                                        <sourceaccessioncode>$MeasureID</sourceaccessioncode>
31
                                        <sourceaccessioncode>$individualID</sourceaccessioncode>
32 32
                                        <stemobservation>
33
                                            <authorstemcode>$StemID</authorstemcode>
34
                                            <diameterbreastheight_m><_cm_to_m><value>$DBH</value></_cm_to_m></diameterbreastheight_m>
33
                                            <authorstemcode>$authorStemCode</authorstemcode>
34
                                            <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
35 35
                                            <tag>$tag</tag>
36
                                            <xposition_m>$x</xposition_m>
37
                                            <yposition_m>$y</yposition_m>
36
                                            <xposition_m>$organismX_m</xposition_m>
37
                                            <yposition_m>$organismY_m</yposition_m>
38 38
                                        </stemobservation>
39 39
                                    </plantobservation>
40 40
                                </aggregateoccurrence>
41 41
                                <authortaxoncode>$tag</authortaxoncode>
42
                                <sourceaccessioncode>$MeasureID</sourceaccessioncode>
42
                                <sourceaccessioncode>$individualID</sourceaccessioncode>
43 43
                                <taxondetermination>
44 44
                                    <taxonverbatim_id>
45 45
                                        <taxonverbatim>
......
59 59
                                                                                    <parent_id>
60 60
                                                                                        <taxonlabel>
61 61
                                                                                            <rank>subspecies</rank>
62
                                                                                            <taxonepithet>$SubSpeciesName</taxonepithet>
62
                                                                                            <taxonepithet>$subspecies</taxonepithet>
63 63
                                                                                            <parent_id>
64 64
                                                                                                <taxonlabel>
65 65
                                                                                                    <rank>species</rank>
66
                                                                                                    <taxonepithet>$SpeciesName</taxonepithet>
66
                                                                                                    <taxonepithet>$specificEpithet</taxonepithet>
67 67
                                                                                                    <parent_id>
68 68
                                                                                                        <taxonlabel>
69 69
                                                                                                            <rank>genus</rank>
70
                                                                                                            <taxonepithet>$Genus</taxonepithet>
70
                                                                                                            <taxonepithet>$genus</taxonepithet>
71 71
                                                                                                            <parent_id>
72 72
                                                                                                                <taxonlabel>
73 73
                                                                                                                    <rank>family</rank>
74
                                                                                                                    <taxonepithet>$Family</taxonepithet>
74
                                                                                                                    <taxonepithet>$family</taxonepithet>
75 75
                                                                                                                </taxonlabel>
76 76
                                                                                                            </parent_id>
77 77
                                                                                                        </taxonlabel>
......
90 90
                                                    </parent_id>
91 91
                                                    <taxonomicname>
92 92
                                                        <_merge_prefix>
93
                                                            <prefix><_taxon_family_require_std><family>$Family</family></_taxon_family_require_std></prefix>
93
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
94 94
                                                            <value>
95 95
                                                                <_join_words>
96 96
                                                                    <1>
97 97
                                                                        <_join_words>
98
                                                                            <2><_filter_genus><value>$Genus</value></_filter_genus></2>
99
                                                                            <3>$SpeciesName</3>
100
                                                                            <4>$SubSpeciesName</4>
98
                                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
99
                                                                            <3>$specificEpithet</3>
100
                                                                            <4>$subspecies</4>
101 101
                                                                        </_join_words>
102 102
                                                                    </1>
103
                                                                    <2>$SpeciesAuthority</2>
103
                                                                    <2>$scientificNameAuthorship</2>
104 104
                                                                </_join_words>
105 105
                                                            </value>
106 106
                                                        </_merge_prefix>
107 107
                                                    </taxonomicname>
108 108
                                                </taxonlabel>
109 109
                                            </taxonlabel_id>
110
                                            <author>$SpeciesAuthority</author>
111
                                            <family>$Family</family>
112
                                            <genus>$Genus</genus>
113
                                            <specific_epithet>$SpeciesName</specific_epithet>
110
                                            <author>$scientificNameAuthorship</author>
111
                                            <family>$family</family>
112
                                            <genus>$genus</genus>
113
                                            <specific_epithet>$specificEpithet</specific_epithet>
114 114
                                        </taxonverbatim>
115 115
                                    </taxonverbatim_id>
116 116
                                </taxondetermination>
......
118 118
                        </locationevent>
119 119
                        <sourceaccessioncode>
120 120
                            <_join>
121
                                <1>$PlotID</1>
122
                                <2>$QuadratID</2>
121
                                <1>$locationID</1>
122
                                <2>$subplot</2>
123 123
                            </_join>
124 124
                        </sourceaccessioncode>
125 125
                    </location>
inputs/CTFS/StemObservation/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
QuadratID,"/location/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
3
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
QuadratID,/location/authorlocationcode,Not globally unique; unique only within Site
7
MeasureID,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
8
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
9
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
10
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
12
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
13
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
14
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
15
MeasureID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/sourceaccessioncode/_first/2,
16
StemID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/authorstemcode,
17
DBH,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value,Assuming units based on the range and precision of values. Not documented in <https://projects.nceas.ucsb.edu/nceas/projects/bien/repository/raw/inputs/CTFS/_src/ctfs-comments_worksheet.xls>.
18
tag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
19
x,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/xposition_m,"Assuming units based on the size of values relative to plot area, which has units of ha. Not documented in <https://projects.nceas.ucsb.edu/nceas/projects/bien/repository/raw/inputs/CTFS/_src/ctfs-comments_worksheet.xls>."
20
y,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/yposition_m,"Assuming units based on the size of values relative to plot area, which has units of ha. Not documented in <https://projects.nceas.ucsb.edu/nceas/projects/bien/repository/raw/inputs/CTFS/_src/ctfs-comments_worksheet.xls>."
21
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
22
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
23
MeasureID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/1/_if[@name=""if individual""]/cond/_exists",
24
tag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
25
MeasureID,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
26
MeasureID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/else/_first/2",
27
SubSpeciesName,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=subspecies]/taxonepithet",
28
SpeciesName,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
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",
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
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
32
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,
33
SpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
34
SubSpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/4,
35
SpeciesAuthority,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
36
SpeciesAuthority,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
37
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
38
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
39
SpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
40
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
41
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
42
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
43
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/2",Not globally unique; unique only within Site
44
Description,,** No join mapping for *Description ** 
45
ExactDate,,** No join mapping for *ExactDate ** 
46
Family.src.row_num,,** No join mapping for *Family.src.row_num ** 
47
FamilyID,,** No join mapping for *FamilyID ** 
48
FieldFamily,,** No join mapping for *FieldFamily ** 
49
Genus.src.row_num,,** No join mapping for *Genus.src.row_num ** 
50
GenusAuthority,,** No join mapping for *GenusAuthority ** 
51
GenusID,,** No join mapping for *GenusID ** 
52
GenusReferenceID,,** No join mapping for *GenusReferenceID ** 
53
HOM,,** No join mapping for *HOM ** 
54
IDLevel,,** No join mapping for *IDLevel ** 
55
InfraSpecificLevel,,** No join mapping for *InfraSpecificLevel ** 
56
InfraspecificEpithet.src.row_num,,** No join mapping for *InfraspecificEpithet.src.row_num ** 
57
Organism.src.row_num,,** No join mapping for *Organism.src.row_num ** 
58
PrimaryStem,,** No join mapping for *PrimaryStem ** 
59
ReferenceID,,** No join mapping for *ReferenceID ** 
60
SpeciesCurrentTaxonFlag,,** No join mapping for *SpeciesCurrentTaxonFlag ** 
61
SpeciesID,,** No join mapping for *SpeciesID ** 
62
SpeciesMnemonic,,** No join mapping for *SpeciesMnemonic ** 
63
SpeciesObsoleteTaxonFlag,,** No join mapping for *SpeciesObsoleteTaxonFlag ** 
64
SpeciesReferenceID,,** No join mapping for *SpeciesReferenceID ** 
65
SpecificEpithet.src.row_num,,** No join mapping for *SpecificEpithet.src.row_num ** 
66
Stem.src.row_num,,** No join mapping for *Stem.src.row_num ** 
67
StemDescription,,** No join mapping for *StemDescription ** 
68
StemObservation.src.row_num,,** No join mapping for *StemObservation.src.row_num ** 
69
StemTag,,** No join mapping for stem_subtag ** 
70
SubSpeciesAuthority,,** No join mapping for *SubSpeciesAuthority ** 
71
SubSpeciesCurrentTaxonFlag,,** No join mapping for *SubSpeciesCurrentTaxonFlag ** 
72
SubSpeciesID,,** No join mapping for *SubSpeciesID ** 
73
SubSpeciesMnemonic,,** No join mapping for *SubSpeciesMnemonic ** 
74
SubSpeciesObsoleteTaxonFlag,,** No join mapping for *SubSpeciesObsoleteTaxonFlag ** 
75
Tag,,** No join mapping for individual_tag ** 
76
TreeID,,** No join mapping for *TreeID ** 
77
stemTag,,** No join mapping for stemTag ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
78 2

  
inputs/CTFS/TaxonOccurrence/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/TaxonOccurrence/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <sourceaccessioncode>$PlotID</sourceaccessioncode>
10
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
11 11
                        <locationevent>
12
                            <sourceaccessioncode>$CensusID</sourceaccessioncode>
12
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
13 13
                            <taxonoccurrence>
14
                                <sourceaccessioncode>$SpeciesInvID</sourceaccessioncode>
14
                                <sourceaccessioncode>$taxonOccurrenceID</sourceaccessioncode>
15 15
                                <taxondetermination>
16 16
                                    <taxonverbatim_id>
17 17
                                        <taxonverbatim>
......
31 31
                                                                                    <parent_id>
32 32
                                                                                        <taxonlabel>
33 33
                                                                                            <rank>subspecies</rank>
34
                                                                                            <taxonepithet>$SubSpeciesName</taxonepithet>
34
                                                                                            <taxonepithet>$subspecies</taxonepithet>
35 35
                                                                                            <parent_id>
36 36
                                                                                                <taxonlabel>
37 37
                                                                                                    <rank>species</rank>
38
                                                                                                    <taxonepithet>$SpeciesName</taxonepithet>
38
                                                                                                    <taxonepithet>$specificEpithet</taxonepithet>
39 39
                                                                                                    <parent_id>
40 40
                                                                                                        <taxonlabel>
41 41
                                                                                                            <rank>genus</rank>
42
                                                                                                            <taxonepithet>$Genus</taxonepithet>
42
                                                                                                            <taxonepithet>$genus</taxonepithet>
43 43
                                                                                                            <parent_id>
44 44
                                                                                                                <taxonlabel>
45 45
                                                                                                                    <rank>family</rank>
46
                                                                                                                    <taxonepithet>$Family</taxonepithet>
46
                                                                                                                    <taxonepithet>$family</taxonepithet>
47 47
                                                                                                                </taxonlabel>
48 48
                                                                                                            </parent_id>
49 49
                                                                                                        </taxonlabel>
......
62 62
                                                    </parent_id>
63 63
                                                    <taxonomicname>
64 64
                                                        <_merge_prefix>
65
                                                            <prefix><_taxon_family_require_std><family>$Family</family></_taxon_family_require_std></prefix>
65
                                                            <prefix><_taxon_family_require_std><family>$family</family></_taxon_family_require_std></prefix>
66 66
                                                            <value>
67 67
                                                                <_join_words>
68 68
                                                                    <1>
69 69
                                                                        <_join_words>
70
                                                                            <2><_filter_genus><value>$Genus</value></_filter_genus></2>
71
                                                                            <3>$SpeciesName</3>
72
                                                                            <4>$SubSpeciesName</4>
70
                                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
71
                                                                            <3>$specificEpithet</3>
72
                                                                            <4>$subspecies</4>
73 73
                                                                        </_join_words>
74 74
                                                                    </1>
75
                                                                    <2>$SpeciesAuthority</2>
75
                                                                    <2>$scientificNameAuthorship</2>
76 76
                                                                </_join_words>
77 77
                                                            </value>
78 78
                                                        </_merge_prefix>
79 79
                                                    </taxonomicname>
80 80
                                                </taxonlabel>
81 81
                                            </taxonlabel_id>
82
                                            <author>$SpeciesAuthority</author>
83
                                            <family>$Family</family>
84
                                            <genus>$Genus</genus>
85
                                            <specific_epithet>$SpeciesName</specific_epithet>
82
                                            <author>$scientificNameAuthorship</author>
83
                                            <family>$family</family>
84
                                            <genus>$genus</genus>
85
                                            <specific_epithet>$specificEpithet</specific_epithet>
86 86
                                        </taxonverbatim>
87 87
                                    </taxonverbatim_id>
88 88
                                </taxondetermination>
inputs/CTFS/TaxonOccurrence/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
4
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
5
SpeciesInvID,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
6
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
7
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
8
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
9
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
10
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
11
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
12
SpeciesInvID,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
13
SpeciesInvID,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/1,
14
SubSpeciesName,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=subspecies]/taxonepithet",
15
SpeciesName,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
16
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",
17
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",
18
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
19
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,
20
SpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
21
SubSpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/4,
22
SpeciesAuthority,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
23
SpeciesAuthority,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
24
Family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
25
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
26
SpeciesName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
27
SpeciesInvID,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/_if[@name=""if has taxondetermination""]/cond/_exists",
28
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
29
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
30
Description,,** No join mapping for *Description ** 
31
Family.src.row_num,,** No join mapping for *Family.src.row_num ** 
32
FamilyID,,** No join mapping for *FamilyID ** 
33
FieldFamily,,** No join mapping for *FieldFamily ** 
34
Genus.src.row_num,,** No join mapping for *Genus.src.row_num ** 
35
GenusAuthority,,** No join mapping for *GenusAuthority ** 
36
GenusID,,** No join mapping for *GenusID ** 
37
GenusReferenceID,,** No join mapping for *GenusReferenceID ** 
38
IDLevel,,** No join mapping for *IDLevel ** 
39
InfraSpecificLevel,,** No non-empty join mapping for UNUSED#InfraSpecificLevel ** 
40
InfraspecificEpithet.src.row_num,,** No join mapping for *InfraspecificEpithet.src.row_num ** 
41
ReferenceID,,** No join mapping for *ReferenceID ** 
42
SpeciesCurrentTaxonFlag,,** No join mapping for *SpeciesCurrentTaxonFlag ** 
43
SpeciesID,,** No join mapping for *SpeciesID ** 
44
SpeciesMnemonic,,** No join mapping for *SpeciesMnemonic ** 
45
SpeciesObsoleteTaxonFlag,,** No join mapping for *SpeciesObsoleteTaxonFlag ** 
46
SpeciesReferenceID,,** No join mapping for *SpeciesReferenceID ** 
47
SpecificEpithet.src.row_num,,** No join mapping for *SpecificEpithet.src.row_num ** 
48
SubSpeciesAuthority,,** No join mapping for *SubSpeciesAuthority ** 
49
SubSpeciesCurrentTaxonFlag,,** No join mapping for *SubSpeciesCurrentTaxonFlag ** 
50
SubSpeciesID,,** No join mapping for *SubSpeciesID ** 
51
SubSpeciesMnemonic,,** No join mapping for *SubSpeciesMnemonic ** 
52
SubSpeciesObsoleteTaxonFlag,,** No join mapping for *SubSpeciesObsoleteTaxonFlag ** 
53
TaxonOccurrence.src.row_num,,** No join mapping for *TaxonOccurrence.src.row_num ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
54 2

  
inputs/CTFS/SubplotObservation/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/SubplotObservation/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <parent_id><location><sourceaccessioncode>$PlotID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$QuadratID</authorlocationcode>
10
                        <parent_id><location><sourceaccessioncode>$locationID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$subplot</authorlocationcode>
12 12
                        <locationevent>
13 13
                            <parent_id>
14 14
                                <locationevent>
......
16 16
                                        <location>
17 17
                                            <sourceaccessioncode>
18 18
                                                <_if name="if subplot">
19
                                                    <cond>$QuadratID</cond>
20
                                                    <then>$PlotID</then>
19
                                                    <cond>$subplot</cond>
20
                                                    <then>$locationID</then>
21 21
                                                </_if>
22 22
                                            </sourceaccessioncode>
23 23
                                        </location>
24 24
                                    </location_id>
25
                                    <sourceaccessioncode>$CensusID</sourceaccessioncode>
25
                                    <sourceaccessioncode>$eventID</sourceaccessioncode>
26 26
                                </locationevent>
27 27
                            </parent_id>
28 28
                        </locationevent>
29 29
                        <sourceaccessioncode>
30 30
                            <_join>
31
                                <1>$PlotID</1>
32
                                <2>$QuadratID</2>
31
                                <1>$locationID</1>
32
                                <2>$subplot</2>
33 33
                            </_join>
34 34
                        </sourceaccessioncode>
35 35
                    </location>
inputs/CTFS/SubplotObservation/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
QuadratID,"/location/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
3
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
QuadratID,/location/authorlocationcode,Not globally unique; unique only within Site
7
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
8
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
9
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
10
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
11
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
13
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
14
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
15
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
17
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
18
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
19
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/2",Not globally unique; unique only within Site
20
row_num,,** No join mapping for *row_num ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
21 2

  
inputs/CTFS/Subplot/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/Subplot/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <parent_id><location><sourceaccessioncode>$PlotID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$QuadratID</authorlocationcode>
10
                        <parent_id><location><sourceaccessioncode>$locationID</sourceaccessioncode></location></parent_id>
11
                        <authorlocationcode>$subplot</authorlocationcode>
12 12
                        <sourceaccessioncode>
13 13
                            <_join>
14
                                <1>$PlotID</1>
15
                                <2>$QuadratID</2>
14
                                <1>$locationID</1>
15
                                <2>$subplot</2>
16 16
                            </_join>
17 17
                        </sourceaccessioncode>
18
                        <sublocationxposition_m>$StartX</sublocationxposition_m>
19
                        <sublocationyposition_m>$StartY</sublocationyposition_m>
18
                        <sublocationxposition_m>$subplotX</sublocationxposition_m>
19
                        <sublocationyposition_m>$subplotY</sublocationyposition_m>
20 20
                    </location>
21 21
                </path>
22 22
            </_simplifyPath>
inputs/CTFS/Subplot/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
QuadratID,"/location/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
3
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
QuadratID,/location/authorlocationcode,Not globally unique; unique only within Site
7
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
8
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
9
QuadratID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/cond/_first/2",Not globally unique; unique only within Site
10
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
11
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
12
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
13
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/cond/_exists",Not globally unique; unique only within Site
14
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
15
QuadratID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/2",Not globally unique; unique only within Site
16
StartX,/location/sublocationxposition_m,
17
StartY,/location/sublocationyposition_m,
18
DimX,,** No join mapping for *DimX ** 
19
DimY,,** No join mapping for *DimY ** 
20
QuadratName,,** No non-empty join mapping for OMIT#QuadratName ** QuadratID is used for the same purpose
21
row_num,,** No join mapping for *row_num ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
22 2

  
inputs/CTFS/PlotObservation/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/PlotObservation/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <sourceaccessioncode>$PlotID</sourceaccessioncode>
10
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
11 11
                        <locationevent>
12
                            <authoreventcode>$PlotCensusNumber</authoreventcode>
13
                            <sourceaccessioncode>$CensusID</sourceaccessioncode>
14
                            <obsenddate>$EndDate</obsenddate>
15
                            <obsstartdate>$StartDate</obsstartdate>
12
                            <authoreventcode>$authorEventCode</authoreventcode>
13
                            <sourceaccessioncode>$eventID</sourceaccessioncode>
14
                            <obsenddate>$endDate</obsenddate>
15
                            <obsstartdate>$startDate</obsstartdate>
16 16
                        </locationevent>
17 17
                    </location>
18 18
                </path>
inputs/CTFS/PlotObservation/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PlotID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3
PlotCensusNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/else",
4
PlotID,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
5
PlotID,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
6
PlotCensusNumber,"/location/locationevent/_if[@name=""if subplot""]/else/authoreventcode",
7
CensusID,"/location/locationevent/_if[@name=""if subplot""]/else/sourceaccessioncode",
8
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
9
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
10
PlotCensusNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
12
PlotID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
13
PlotCensusNumber,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authoreventcode",
14
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_alt/1",
15
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_alt/1",
16
CensusID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/sourceaccessioncode",
17
EndDate,/location/locationevent/obsenddate/_alt/1,
18
StartDate,/location/locationevent/obsstartdate/_alt/1,
19
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
20
PlotCensusNumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
21
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
22
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
23
PlotID,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
24
Description,,** No join mapping for *Description ** 
25
row_num,,** No join mapping for *row_num ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
26 2

  
inputs/CTFS/AggregateObservation/postprocess.sql
2 2

  
3 3
-- runtime: 0.3 s ("Time: 256.926 ms") @starscream
4 4
SELECT set_col_types(:table_str, ARRAY[
5
  ('minDBHcm', 'double precision')
6
, ('maxDBHcm', 'double precision')
5
  ('diameterBreastHeight_min_cm', 'double precision')
6
, ('diameterBreastHeight_max_cm', 'double precision')
7 7
]::col_cast[]);
8 8

  
9 9

  
10
SELECT mk_derived_col((:table_str, 'diameterBreastHeight_cm'), $$_avg("minDBHcm", "maxDBHcm")$$); -- runtime: 0.4 s ("Time: 431.405 ms") @starscream
10
SELECT mk_derived_col((:table_str, 'diameterBreastHeight_cm'), $$_avg("diameterBreastHeight_min_cm", "diameterBreastHeight_max_cm")$$); -- runtime: 0.4 s ("Time: 431.405 ms") @starscream
inputs/CTFS/AggregateObservation/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/AggregateObservation/map.csv
20 20
minDBHcm,diameterBreastHeight_min_cm,,
21 21
PlotSize,plotArea_ha,,Assuming units based on the range and precision of values compared to the PlotShape values
22 22
PlotShape,footprintWKT,,
23
diameterBreastHeight_cm,diameterBreastHeight_cm,,
inputs/CTFS/AggregateObservation/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <authorlocationcode>$Plot</authorlocationcode>
11
                        <area_m2><_ha_to_m2><value>$PlotSize</value></_ha_to_m2></area_m2>
12
                        <elevation_m>$Elevation </elevation_m>
10
                        <authorlocationcode>$locationName</authorlocationcode>
11
                        <area_m2><_ha_to_m2><value>$plotArea_ha</value></_ha_to_m2></area_m2>
12
                        <elevation_m>$elevationInMeters</elevation_m>
13 13
                        <locationevent>
14
                            <authoreventcode>$CensusName</authoreventcode>
15
                            <obsenddate>$EndDate</obsenddate>
16
                            <obsstartdate>$StartDate</obsstartdate>
14
                            <authoreventcode>$authorEventCode</authoreventcode>
15
                            <obsenddate>$endDate</obsenddate>
16
                            <obsstartdate>$startDate</obsstartdate>
17 17
                            <taxonoccurrence>
18 18
                                <aggregateoccurrence>
19
                                    <count>$Abund</count>
19
                                    <count>$individualCount</count>
20 20
                                    <plantobservation>
21
                                        <specimenreplicate><sourceaccessioncode>$DWstagingID</sourceaccessioncode></specimenreplicate>
21
                                        <specimenreplicate><sourceaccessioncode>$occurrenceID</sourceaccessioncode></specimenreplicate>
22 22
                                        <stemobservation><diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m></stemobservation>
23 23
                                    </plantobservation>
24 24
                                </aggregateoccurrence>
25
                                <growthform>$VegCategory</growthform>
26
                                <sourceaccessioncode>$DWstagingID</sourceaccessioncode>
25
                                <growthform>$growthForm</growthform>
26
                                <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
27 27
                                <taxondetermination>
28 28
                                    <taxonverbatim_id>
29 29
                                        <taxonverbatim>
......
47 47
                                                                                            <parent_id>
48 48
                                                                                                <taxonlabel>
49 49
                                                                                                    <rank>species</rank>
50
                                                                                                    <taxonepithet>$speciesname</taxonepithet>
50
                                                                                                    <taxonepithet>$specificEpithet</taxonepithet>
51 51
                                                                                                    <parent_id>
52 52
                                                                                                        <taxonlabel>
53 53
                                                                                                            <rank>genus</rank>
54
                                                                                                            <taxonepithet>$Genus </taxonepithet>
54
                                                                                                            <taxonepithet>$genus</taxonepithet>
55 55
                                                                                                        </taxonlabel>
56 56
                                                                                                    </parent_id>
57 57
                                                                                                </taxonlabel>
......
68 68
                                                    </parent_id>
69 69
                                                    <taxonomicname>
70 70
                                                        <_join_words>
71
                                                            <2><_filter_genus><value>$Genus </value></_filter_genus></2>
72
                                                            <3>$speciesname</3>
71
                                                            <2><_filter_genus><value>$genus</value></_filter_genus></2>
72
                                                            <3>$specificEpithet</3>
73 73
                                                            <4>$subspecies</4>
74 74
                                                        </_join_words>
75 75
                                                    </taxonomicname>
76 76
                                                </taxonlabel>
77 77
                                            </taxonlabel_id>
78
                                            <genus>$Genus </genus>
79
                                            <specific_epithet>$speciesname</specific_epithet>
78
                                            <genus>$genus</genus>
79
                                            <specific_epithet>$specificEpithet</specific_epithet>
80 80
                                        </taxonverbatim>
81 81
                                    </taxonverbatim_id>
82 82
                                </taxondetermination>
......
87 87
                                <place>
88 88
                                    <coordinates_id>
89 89
                                        <coordinates>
90
                                            <footprintgeometry_dwc>$PlotShape</footprintgeometry_dwc>
90
                                            <footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc>
91 91
                                            <latitude_deg>
92 92
                                                <_nullIf>
93 93
                                                    <null>0</null>
94 94
                                                    <type>float</type>
95
                                                    <value>$Latitude </value>
95
                                                    <value>$decimalLatitude</value>
96 96
                                                </_nullIf>
97 97
                                            </latitude_deg>
98 98
                                            <longitude_deg>
99 99
                                                <_nullIf>
100 100
                                                    <null>0</null>
101 101
                                                    <type>float</type>
102
                                                    <value>$Longitude </value>
102
                                                    <value>$decimalLongitude</value>
103 103
                                                </_nullIf>
104 104
                                            </longitude_deg>
105 105
                                        </coordinates>
106 106
                                    </coordinates_id>
107
                                    <country>$Country</country>
107
                                    <country>$country</country>
108 108
                                    <matched_place_id>
109 109
                                        <place>
110 110
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
......
115 115
                                                        <_nullIf>
116 116
                                                            <null>0</null>
117 117
                                                            <type>float</type>
118
                                                            <value>$Latitude </value>
118
                                                            <value>$decimalLatitude</value>
119 119
                                                        </_nullIf>
120 120
                                                    </latitude_deg>
121 121
                                                    <longitude_deg>
122 122
                                                        <_nullIf>
123 123
                                                            <null>0</null>
124 124
                                                            <type>float</type>
125
                                                            <value>$Longitude </value>
125
                                                            <value>$decimalLongitude</value>
126 126
                                                        </_nullIf>
127 127
                                                    </longitude_deg>
128 128
                                                </coordinates>
129 129
                                            </coordinates_id>
130
                                            <country>$Country</country>
131
                                            <stateprovince>$Province</stateprovince>
130
                                            <country>$country</country>
131
                                            <stateprovince>$stateProvince</stateprovince>
132 132
                                        </place>
133 133
                                    </matched_place_id>
134
                                    <stateprovince>$Province</stateprovince>
134
                                    <stateprovince>$stateProvince</stateprovince>
135 135
                                </place>
136 136
                            </place_id>
137 137
                        </locationplace>
inputs/CTFS/AggregateObservation/VegBIEN.csv
1
CTFS,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
DWstagingID,"/_if[@name=""if specimen""]/cond/_exists",
3
Plot,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/1",
4
CensusName,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/else",
5
DWstagingID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/1",
6
DWstagingID,"/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
Plot,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
8
PlotSize,/location/area_m2/_ha_to_m2/value,Assuming units based on the range and precision of values compared to the PlotShape values
9
Elevation ,/location/elevation_m/_alt/1,Assuming units based on the range and precision of values
10
DWstagingID,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
11
CensusName,"/location/locationevent/_if[@name=""if subplot""]/else/authoreventcode",
12
CensusName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
13
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
14
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
15
Plot,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
16
CensusName,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authoreventcode",
17
EndDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_alt/1",
18
StartDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_alt/1",
19
EndDate,/location/locationevent/obsenddate/_alt/1,
20
StartDate,/location/locationevent/obsstartdate/_alt/1,
21
Abund,/location/locationevent/taxonoccurrence/aggregateoccurrence/count,
22
DWstagingID,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
23
DWstagingID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/sourceaccessioncode,
24
diameterBreastHeight_cm,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value,
25
CensusName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
26
Plot,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
27
VegCategory,/location/locationevent/taxonoccurrence/growthform,
28
DWstagingID,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
29
DWstagingID,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/3,
30
subspecies,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=subspecies]/taxonepithet",
31
speciesname,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
32
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",
33
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,
34
speciesname,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
35
subspecies,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/4,
36
Genus ,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
37
speciesname,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
38
PlotShape,/location/locationplace/*_id/place/*_id/coordinates/footprintgeometry_dwc,
39
Latitude ,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
40
Longitude ,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
41
Country,/location/locationplace/*_id/place/country,
42
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"
43
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"
44
Country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
45
Province,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
46
Province,/location/locationplace/*_id/place/stateprovince,
47
MeanDate,,** No join mapping for *MeanDate ** 
48
maxDBHcm,,** No join mapping for diameterBreastHeight_max_cm ** 
49
minDBHcm,,** No join mapping for diameterBreastHeight_min_cm ** 
50
row_num,,** No join mapping for *row_num ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
51 2

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

  
inputs/CTFS/Plot/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/CTFS/Plot/test.xml.ref
7 7
                <next>parent_id</next>
8 8
                <path>
9 9
                    <location>
10
                        <authorlocationcode>$PlotName</authorlocationcode>
11
                        <sourceaccessioncode>$PlotID</sourceaccessioncode>
12
                        <area_m2><_ha_to_m2><value>$SizeOfSite</value></_ha_to_m2></area_m2>
13
                        <elevation_m>$Elevation</elevation_m>
14
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$LocationName</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
10
                        <authorlocationcode>$locationName</authorlocationcode>
11
                        <sourceaccessioncode>$locationID</sourceaccessioncode>
12
                        <area_m2><_ha_to_m2><value>$plotArea_ha</value></_ha_to_m2></area_m2>
13
                        <elevation_m>$elevationInMeters</elevation_m>
14
                        <iscultivated><_locationnarrative_is_cultivated><locationnarrative>$locality</locationnarrative></_locationnarrative_is_cultivated></iscultivated>
15 15
                        <locationnarrative>
16 16
                            <_merge>
17
                                <1>$LocationName</1>
18
                                <4>$DescriptionOfSite</4>
17
                                <1>$locality</1>
18
                                <4>$locationRemarks</4>
19 19
                            </_merge>
20 20
                        </locationnarrative>
21 21
                        <locationplace>
......
23 23
                                <place>
24 24
                                    <coordinates_id>
25 25
                                        <coordinates>
26
                                            <footprintgeometry_dwc>$ShapeOfSite</footprintgeometry_dwc>
26
                                            <footprintgeometry_dwc>$footprintWKT</footprintgeometry_dwc>
27 27
                                            <latitude_deg>
28 28
                                                <_nullIf>
29 29
                                                    <null>0</null>
30 30
                                                    <type>float</type>
31
                                                    <value>$Latitude</value>
31
                                                    <value>$decimalLatitude</value>
32 32
                                                </_nullIf>
33 33
                                            </latitude_deg>
34 34
                                            <longitude_deg>
35 35
                                                <_nullIf>
36 36
                                                    <null>0</null>
37 37
                                                    <type>float</type>
38
                                                    <value>$Longitude</value>
38
                                                    <value>$decimalLongitude</value>
39 39
                                                </_nullIf>
40 40
                                            </longitude_deg>
41 41
                                        </coordinates>
42 42
                                    </coordinates_id>
43
                                    <country>$CountryName</country>
43
                                    <country>$country</country>
44 44
                                    <matched_place_id>
45 45
                                        <place>
46 46
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
......
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
                                            <country>$CountryName</country>
66
                                            <country>$country</country>
67 67
                                        </place>
68 68
                                    </matched_place_id>
69 69
                                </place>

Also available in: Unified diff