Project

General

Profile

« Previous | Next » 

Revision 10381

inputs/.../: translated multi-column filters with _avg() 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/BRIT/specimen_flat/postprocess.sql
5 5
SELECT mk_derived_col((:table_str, 'occurrenceRemarks'),
6 6
$$CASE WHEN "Locality_Description" IS NOT NULL THEN "Notes_Plant" END$$)
7 7
; -- runtime: 0.3 s ("Time: 311.190 ms") @starscream
8

  
9
SELECT mk_derived_col((:table_str, 'diameterBreastHeight_cm'), $$_avg("DBH_Min"   , "DBH_Max"   )$$); -- runtime:  s ("Time:  ms") @starscream
10
SELECT mk_derived_col((:table_str, 'height_m'),                $$_avg("Height_Min", "Height_Max")$$); -- runtime:  s ("Time:  ms") @starscream
inputs/BRIT/specimen_flat/map.csv
38 38
Soil_Description,*Soil_Description,,
39 39
Notes_Plant,occurrenceRemarks_verbatim,,
40 40
Phenology_Stage,reproductiveCondition,,
41
Height_Min,height_m,/_avg/1,Assuming units based on the range and precision of values
42
Height_Max,height_m,/_avg/2,Assuming units based on the range and precision of values
43
DBH_Min,diameterBreastHeight_cm,/_avg/1,Assuming units based on the range and precision of values
44
DBH_Max,diameterBreastHeight_cm,/_avg/2,Assuming units based on the range and precision of values
41
Height_Min,height_min_m,,Assuming units based on the range and precision of values
42
Height_Max,height_max_m,,Assuming units based on the range and precision of values
43
DBH_Min,diameterBreastHeight_min_cm,,Assuming units based on the range and precision of values
44
DBH_Max,diameterBreastHeight_max_cm,,Assuming units based on the range and precision of values
45 45
Latitude,decimalLatitude,,
46 46
Longitude,decimalLongitude,,
47 47
Coordinate_Uncertainity,coordinateUncertaintyInMeters,,Assuming units based on the range and precision of values
......
60 60
Month_Identified,monthIdentified,,
61 61
Day_Identified,dayIdentified,,
62 62
occurrenceRemarks,occurrenceRemarks,,
63
diameterBreastHeight_cm,diameterBreastHeight_cm,,
64
height_m,height_m,,
inputs/BRIT/specimen_flat/VegBIEN.csv
36 36
Institution_Code,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/name/_first/2",
37 37
Institution_Code,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/sourcename/name/_first/2/_split:[separator=""[,;] *""]/value",
38 38
specimen_id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/sourceaccessioncode,
39
DBH_Min,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value/_avg/1,Assuming units based on the range and precision of values
40
DBH_Max,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value/_avg/2,Assuming units based on the range and precision of values
41
Height_Min,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m/_avg/1,Assuming units based on the range and precision of values
42
Height_Max,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m/_avg/2,Assuming units based on the range and precision of values
39
diameterBreastHeight_cm,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_cm_to_m/value,
40
height_m,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m,
43 41
Collection_Number,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
44 42
Scientific_Name,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/2",
45 43
Collector_Abbrev_Name,/location/locationevent/taxonoccurrence/collector_id/party/fullname/_join/1,
......
94 92
Auxilirary_Collections,,** No non-empty join mapping for UNUSED#Auxilirary_Collections ** 
95 93
Basis_Of_Specimen,,** No join mapping for basisOfRecord ** 
96 94
Closest_Town,,** No non-empty join mapping for UNUSED#Closest_Town ** 
95
DBH_Max,,** No join mapping for diameterBreastHeight_max_cm ** Assuming units based on the range and precision of values
96
DBH_Min,,** No join mapping for diameterBreastHeight_min_cm ** Assuming units based on the range and precision of values
97 97
Dubpliate_Herbarium,,** No non-empty join mapping for UNUSED#Dubpliate_Herbarium ** 
98 98
Duplicates,,** No join mapping for *Duplicates ** # of duplicates
99 99
Global_Unique_Identifier,,** No non-empty join mapping for UNUSED#Global_Unique_Identifier ** 
100
Height_Max,,** No join mapping for height_max_m ** Assuming units based on the range and precision of values
101
Height_Min,,** No join mapping for height_min_m ** Assuming units based on the range and precision of values
100 102
Infra_Rank,,** No join mapping for infraspecificRank ** 
101 103
Local_Name,,** No join mapping for vernacularName ** 
102 104
Notes_Plant,,** No join mapping for occurrenceRemarks_verbatim ** 
inputs/BRIT/specimen_flat/test.xml.ref
103 103
                                            <sourceaccessioncode>$specimen_id</sourceaccessioncode>
104 104
                                        </specimenreplicate>
105 105
                                        <stemobservation>
106
                                            <diameterbreastheight_m>
107
                                                <_cm_to_m>
108
                                                    <value>
109
                                                        <_avg>
110
                                                            <1>$DBH_Min</1>
111
                                                            <2>$DBH_Max</2>
112
                                                        </_avg>
113
                                                    </value>
114
                                                </_cm_to_m>
115
                                            </diameterbreastheight_m>
116
                                            <height_m>
117
                                                <_avg>
118
                                                    <1>$Height_Min</1>
119
                                                    <2>$Height_Max</2>
120
                                                </_avg>
121
                                            </height_m>
106
                                            <diameterbreastheight_m><_cm_to_m><value>$diameterBreastHeight_cm</value></_cm_to_m></diameterbreastheight_m>
107
                                            <height_m>$height_m</height_m>
122 108
                                        </stemobservation>
123 109
                                    </plantobservation>
124 110
                                </aggregateoccurrence>
inputs/BRIT/specimen_flat/new_terms.csv
23 23
Habitat_Summary,habitat,/_join/2,
24 24
Notes_Plant,occurrenceRemarks_verbatim,,
25 25
Phenology_Stage,reproductiveCondition,,
26
Height_Min,height_m,/_avg/1,Assuming units based on the range and precision of values
27
Height_Max,height_m,/_avg/2,Assuming units based on the range and precision of values
28
DBH_Min,diameterBreastHeight_cm,/_avg/1,Assuming units based on the range and precision of values
29
DBH_Max,diameterBreastHeight_cm,/_avg/2,Assuming units based on the range and precision of values
26
Height_Min,height_min_m,,Assuming units based on the range and precision of values
27
Height_Max,height_max_m,,Assuming units based on the range and precision of values
28
DBH_Min,diameterBreastHeight_min_cm,,Assuming units based on the range and precision of values
29
DBH_Max,diameterBreastHeight_max_cm,,Assuming units based on the range and precision of values
30 30
Coordinate_Uncertainity,coordinateUncertaintyInMeters,,Assuming units based on the range and precision of values
31 31
Elevation_Min,minimumElevationInMeters,,Assuming units based on the range and precision of values
32 32
Elevation_Max,maximumElevationInMeters,,Assuming units based on the range and precision of values
inputs/BRIT/specimen_flat/unmapped_terms.csv
4 4
*Research_Site_Name
5 5
*Soil_Description
6 6
occurrenceRemarks_verbatim
7
height_min_m
8
height_max_m
9
diameterBreastHeight_min_cm
10
diameterBreastHeight_max_cm
7 11
basisOfRecord
8 12
*Duplicates
9 13
modified

Also available in: Unified diff