Project

General

Profile

« Previous | Next » 

Revision 10934

inputs/VegBank/stemlocation_/: translated multi-column filters to postprocessing derived columns, using the steps at http://wiki.vegpath.org/Adding_new-style_import_to_a_datasource#Translating-filters-to-postprocessing-derived-columns

View differences:

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

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

  
5

  
6
SELECT mk_derived_col((:table_str, 'aggregateOrganismObservationID'),
7
$$_join("taxonimportance_id"::text, "stemcount_id"::text)$$)
8
; -- runtime: 0.5 s ("Time: 441.059 ms") @starscream
inputs/VegBank/stemlocation_/map.csv
1 1
VegBank,VegCore,Filter,Comments
2
stemcount_id,aggregateOrganismObservationID,/_join/2,
3
taxonimportance_id,aggregateOrganismObservationID,/_join/1,
2
stemcount_id,aggregateOrganismObservationID__individual_count,,
3
taxonimportance_id,aggregateOrganismObservationID__taxon_presence,,
4 4
stemdiameter,diameterBreastHeight_cm,,"""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>)"
5 5
stemdiameteraccuracy,*stemdiameteraccuracy,,
6 6
stemheight,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 15
stemyposition,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>)"
16 16
stemhealth,*stemhealth,,this *is* populated
17 17
emb_stemlocation,*emb_stemlocation,,
18
aggregateOrganismObservationID,aggregateOrganismObservationID,,
inputs/VegBank/stemlocation_/VegBIEN.csv
5 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 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 7
stemlocation_id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/sourceaccessioncode,
8
taxonimportance_id,/location/locationevent/taxonoccurrence/aggregateoccurrence/sourceaccessioncode/_join/1,
9
stemcount_id,/location/locationevent/taxonoccurrence/aggregateoccurrence/sourceaccessioncode/_join/2,
8
aggregateOrganismObservationID,/location/locationevent/taxonoccurrence/aggregateoccurrence/sourceaccessioncode,
10 9
stemlocation_id,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/1/_if[@name=""if individual""]/cond/_exists",
11 10
stemlocation_id,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
12
taxonimportance_id,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/cond/_exists/_join/1",
13
stemcount_id,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/cond/_exists/_join/2",
11
aggregateOrganismObservationID,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/cond/_exists",
14 12
stemlocation_id,"/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/2/_if[@name=""if organism in AggregateOccurrence""]/else/_first/2",
15 13
emb_stemcount,,** No join mapping for *emb_stemcount ** 
16 14
emb_stemlocation,,** No join mapping for *emb_stemlocation ** 
17 15
stemcode,,** No non-empty join mapping for UNUSED#stemcode ** 
16
stemcount_id,,** No join mapping for aggregateOrganismObservationID__individual_count ** 
18 17
stemdiameteraccuracy,,** No join mapping for *stemdiameteraccuracy ** 
19 18
stemhealth,,** No join mapping for *stemhealth ** this *is* populated
20 19
stemheightaccuracy,,** No join mapping for *stemheightaccuracy ** 
21 20
stemtaxonarea,,** No join mapping for *stemtaxonarea ** 
22 21
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 22
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>)"
23
taxonimportance_id,,** No join mapping for aggregateOrganismObservationID__taxon_presence ** 
inputs/VegBank/stemlocation_/test.xml.ref
19 19
                                            <sourceaccessioncode>$stemlocation_id</sourceaccessioncode>
20 20
                                        </stemobservation>
21 21
                                    </plantobservation>
22
                                    <sourceaccessioncode>
23
                                        <_join>
24
                                            <1>$taxonimportance_id</1>
25
                                            <2>$stemcount_id</2>
26
                                        </_join>
27
                                    </sourceaccessioncode>
22
                                    <sourceaccessioncode>$aggregateOrganismObservationID</sourceaccessioncode>
28 23
                                </aggregateoccurrence>
29 24
                            </taxonoccurrence>
30 25
                        </locationevent>
inputs/VegBank/stemlocation_/new_terms.csv
1
stemcount_id,aggregateOrganismObservationID,/_join/2,
2
taxonimportance_id,aggregateOrganismObservationID,/_join/1,
1
stemcount_id,aggregateOrganismObservationID__individual_count,,
2
taxonimportance_id,aggregateOrganismObservationID__taxon_presence,,
3 3
stemdiameter,diameterBreastHeight_cm,,"""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>)"
4 4
stemlocation_id,stemID,,
5 5
stemlocation_id,individualID,,
inputs/VegBank/stemlocation_/unmapped_terms.csv
1
aggregateOrganismObservationID__individual_count
2
aggregateOrganismObservationID__taxon_presence
1 3
*stemdiameteraccuracy
2 4
*stemheightaccuracy
3 5
*stemtaxonarea

Also available in: Unified diff