Project

General

Profile

« Previous | Next » 

Revision 10418

inputs/CTFS/StemObservation/: translated collisions (missing filters) to postprocessing derived columns, using the steps at wiki.vegpath.org/Adding_new-style_import_to_a_datasource#Translating-filters-to-postprocessing-derived-columns

View differences:

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

  
3
SELECT mk_derived_col((:table_str, 'stemTag'),
4
$$concat_ws('.', "Tag", "StemTag")$$); -- runtime: 30 s ("Time: 29390.121 ms") @starscream
5
SELECT mk_derived_col((:table_str, 'tag'), $$"stemTag"$$); -- runtime: 25 s ("Time: 25010.752 ms") @starscream
inputs/CTFS/StemObservation/map.csv
13 13
PrimaryStem,*PrimaryStem,,
14 14
ExactDate,*ExactDate,,
15 15
Stem.src.row_num,*Stem.src.row_num,,
16
StemTag,tag,,
16
StemTag,stem_subtag,,
17 17
StemDescription,*StemDescription,,
18 18
Organism.src.row_num,*Organism.src.row_num,,
19 19
QuadratID,subplot,,Not globally unique; unique only within Site
20 20
PlotID,locationID,,
21
Tag,tag,,
21
Tag,individual_tag,,
22 22
x,organismX_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>."
23 23
y,organismY_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>."
24 24
InfraspecificEpithet.src.row_num,*InfraspecificEpithet.src.row_num,,
......
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/VegBIEN.csv
15 15
MeasureID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/sourceaccessioncode/_first/2,
16 16
StemID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/authorstemcode,
17 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
StemTag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
19
Tag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
18
tag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
20 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>."
21 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>."
22 21
CensusID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
23 22
PlotID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
24 23
MeasureID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/1/_if[@name=""if individual""]/cond/_exists",
25
StemTag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
26
Tag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
24
tag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
27 25
MeasureID,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
28 26
MeasureID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/else/_first/2",
29 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",
......
68 66
Stem.src.row_num,,** No join mapping for *Stem.src.row_num ** 
69 67
StemDescription,,** No join mapping for *StemDescription ** 
70 68
StemObservation.src.row_num,,** No join mapping for *StemObservation.src.row_num ** 
69
StemTag,,** No join mapping for stem_subtag ** 
71 70
SubSpeciesAuthority,,** No join mapping for *SubSpeciesAuthority ** 
72 71
SubSpeciesCurrentTaxonFlag,,** No join mapping for *SubSpeciesCurrentTaxonFlag ** 
73 72
SubSpeciesID,,** No join mapping for *SubSpeciesID ** 
74 73
SubSpeciesMnemonic,,** No join mapping for *SubSpeciesMnemonic ** 
75 74
SubSpeciesObsoleteTaxonFlag,,** No join mapping for *SubSpeciesObsoleteTaxonFlag ** 
75
Tag,,** No join mapping for individual_tag ** 
76 76
TreeID,,** No join mapping for *TreeID ** 
77
stemTag,,** No join mapping for stemTag ** 
inputs/CTFS/StemObservation/test.xml.ref
32 32
                                        <stemobservation>
33 33
                                            <authorstemcode>$StemID</authorstemcode>
34 34
                                            <diameterbreastheight_m><_cm_to_m><value>$DBH</value></_cm_to_m></diameterbreastheight_m>
35
                                            <tag>
36
                                                <_alt>
37
                                                    <0>$StemTag</0>
38
                                                    <1>$Tag</1>
39
                                                </_alt>
40
                                            </tag>
35
                                            <tag>$tag</tag>
41 36
                                            <xposition_m>$x</xposition_m>
42 37
                                            <yposition_m>$y</yposition_m>
43 38
                                        </stemobservation>
44 39
                                    </plantobservation>
45 40
                                </aggregateoccurrence>
46
                                <authortaxoncode>
47
                                    <_alt>
48
                                        <0>$StemTag</0>
49
                                        <1>$Tag</1>
50
                                    </_alt>
51
                                </authortaxoncode>
41
                                <authortaxoncode>$tag</authortaxoncode>
52 42
                                <sourceaccessioncode>$MeasureID</sourceaccessioncode>
53 43
                                <taxondetermination>
54 44
                                    <taxonverbatim_id>
inputs/CTFS/StemObservation/unmapped_terms.csv
8 8
*PrimaryStem
9 9
*ExactDate
10 10
*Stem.src.row_num
11
stem_subtag
11 12
*StemDescription
12 13
*Organism.src.row_num
14
individual_tag
13 15
*InfraspecificEpithet.src.row_num
14 16
*SubSpeciesCurrentTaxonFlag
15 17
*SubSpeciesObsoleteTaxonFlag
......
29 31
*GenusAuthority
30 32
*Family.src.row_num
31 33
*ReferenceID
34
stemTag

Also available in: Unified diff