Project

General

Profile

« Previous | Next » 

Revision 10310

inputs/ACAD/Specimen/: translated single-column filters to postprocessing derived columns, using the steps at wiki.vegpath.org/Switching_to_new-style_import#stage-I-source-specific > "translate single-column filters to postprocessing derived columns"

View differences:

inputs/ACAD/Specimen/postprocess.sql
1
SELECT util.search_path_append('util');
2

  
3
SELECT mk_derived_col((:table_str, 'specimenHolderInstitutions'),
4
$$_map('"Acadia University"=>"ACAD", "*"=>"*"', "institutionCode")$$);
inputs/ACAD/Specimen/map.csv
8 8
geodeticDatum,geodeticDatum,,
9 9
reproductiveCondition,reproductiveCondition,,
10 10
decimalLongitude,decimalLongitude,,
11
institutionCode,specimenHolderInstitutions,"/_map:[""Acadia University""=ACAD,*=*]/value",
11
institutionCode,specimenHolderInstitutions_verbatim,,
12 12
continent,continent,,
13 13
recordedBy,recordedBy,,
14 14
county,county,,
......
48 48
catalogNumber,accessionNumber,,
49 49
country,country,,
50 50
dynamicProperties,dynamicProperties,,
51
specimenHolderInstitutions,specimenHolderInstitutions,,
inputs/ACAD/Specimen/VegBIEN.csv
1 1
ACAD,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2 2
catalogNumber,"/_if[@name=""if specimen""]/cond/_exists",
3 3
id,"/_if[@name=""if specimen""]/cond/_exists",
4
institutionCode,"/_if[@name=""if specimen""]/else/source/shortname/_first/1/_map:[""Acadia University""=ACAD,*=*]/value",
4
specimenHolderInstitutions,"/_if[@name=""if specimen""]/else/source/shortname/_first/1",
5 5
id,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/1",
6 6
catalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/cond/_exists",
7 7
catalogNumber,"/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",
8 8
id,"/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",
9
institutionCode,"/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""]/then/_first/2/_map:[""Acadia University""=ACAD,*=*]/value",
9
specimenHolderInstitutions,"/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""]/then/_first/2",
10 10
collectionCode,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/2/_join/1",
11 11
collectionID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/2/_join/2",
12 12
catalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/then/_join/3/_if[@name=""if indirect voucher""]/else",
......
30 30
recordNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
31 31
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
32 32
id,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
33
institutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/name/_first/2/_map:[""Acadia University""=ACAD,*=*]/value",
34
institutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/sourcename/name/_first/2/_split:[separator=""[,;] *""]/value/_map:[""Acadia University""=ACAD,*=*]/value",
33
specimenHolderInstitutions,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/name/_first/2",
34
specimenHolderInstitutions,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/sourcename/name/_first/2/_split:[separator=""[,;] *""]/value",
35 35
id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/sourceaccessioncode,
36 36
recordNumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
37 37
scientificName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/2",
......
90 90
georeferenceSources,,** No join mapping for georeferenceSources ** 
91 91
georeferenceVerificationStatus,,** No join mapping for georeferenceVerificationStatus ** 
92 92
identificationRemarks,,** No join mapping for identificationRemarks ** 
93
institutionCode,,** No join mapping for specimenHolderInstitutions_verbatim ** 
93 94
language,,** No join mapping for language ** 
94 95
modified,,** No join mapping for modified ** 
95 96
municipality,,** No join mapping for municipality ** 
inputs/ACAD/Specimen/test.xml.ref
12 12
                                <1>$id</1>
13 13
                                <2>
14 14
                                    <_join>
15
                                        <1>
16
                                            <_map>
17
                                                <Acadia University>ACAD</Acadia University>
18
                                                <*>*</*>
19
                                                <value>$institutionCode</value>
20
                                            </_map>
21
                                        </1>
15
                                        <1>$specimenHolderInstitutions</1>
22 16
                                        <2>
23 17
                                            <_join>
24 18
                                                <1>$collectionCode</1>
......
68 62
                                            <collectionnumber>$recordNumber</collectionnumber>
69 63
                                            <institution_id>
70 64
                                                <sourcelist>
71
                                                    <name>
72
                                                        <_map>
73
                                                            <Acadia University>ACAD</Acadia University>
74
                                                            <*>*</*>
75
                                                            <value>$institutionCode</value>
76
                                                        </_map>
77
                                                    </name>
65
                                                    <name>$specimenHolderInstitutions</name>
78 66
                                                    <sourcename>
79 67
                                                        <name>
80 68
                                                            <_split>
81 69
                                                                <separator>[,;] *</separator>
82
                                                                <value>
83
                                                                    <_map>
84
                                                                        <Acadia University>ACAD</Acadia University>
85
                                                                        <*>*</*>
86
                                                                        <value>$institutionCode</value>
87
                                                                    </_map>
88
                                                                </value>
70
                                                                <value>$specimenHolderInstitutions</value>
89 71
                                                            </_split>
90 72
                                                        </name>
91 73
                                                    </sourcename>
inputs/ACAD/Specimen/unmapped_terms.csv
1 1
*row_num
2 2
basisOfRecord
3 3
geodeticDatum
4
specimenHolderInstitutions_verbatim
4 5
georeferenceSources
5 6
language
6 7
georeferenceVerificationStatus

Also available in: Unified diff