Project

General

Profile

« Previous | Next » 

Revision 10313

inputs/ACAD/: switched to new-style import, using the steps at wiki.vegpath.org/Switching_to_new-style_import#stage-I-source-specific > "run the following for each datasource"

View differences:

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

  
3 3
SELECT mk_derived_col((:table_str, 'specimenHolderInstitutions'),
4
$$_map('"Acadia University"=>"ACAD", "*"=>"*"', "institutionCode")$$);
4
$$_map('"Acadia University"=>"ACAD", "*"=>"*"', "specimenHolderInstitutions_verbatim")$$);
inputs/ACAD/Specimen/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/ACAD/Specimen/test.xml.ref
9 9
                    <location>
10 10
                        <authorlocationcode>
11 11
                            <_alt>
12
                                <1>$id</1>
12
                                <1>$dataProviderRecordID</1>
13 13
                                <2>
14 14
                                    <_join>
15 15
                                        <1>$specimenHolderInstitutions</1>
16 16
                                        <2>
17 17
                                            <_join>
18
                                                <1>$collectionCode</1>
19
                                                <2>$collectionID</2>
18
                                                <1>$collection</1>
19
                                                <2>$collectionURL</2>
20 20
                                            </_join>
21 21
                                        </2>
22
                                        <3>$catalogNumber</3>
22
                                        <3>$accessionNumber</3>
23 23
                                    </_join>
24 24
                                </2>
25 25
                            </_alt>
......
49 49
                                <aggregateoccurrence>
50 50
                                    <notes>$occurrenceRemarks</notes>
51 51
                                    <plantobservation>
52
                                        <authorplantcode>$recordNumber</authorplantcode>
52
                                        <authorplantcode>$collectorNumber</authorplantcode>
53 53
                                        <reproductivecondition>$reproductiveCondition</reproductivecondition>
54 54
                                        <specimenreplicate>
55
                                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
55
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
56 56
                                            <collectioncode_dwc>
57 57
                                                <_alt>
58
                                                    <1>$collectionCode</1>
59
                                                    <2>$collectionID</2>
58
                                                    <1>$collection</1>
59
                                                    <2>$collectionURL</2>
60 60
                                                </_alt>
61 61
                                            </collectioncode_dwc>
62
                                            <collectionnumber>$recordNumber</collectionnumber>
62
                                            <collectionnumber>$collectorNumber</collectionnumber>
63 63
                                            <institution_id>
64 64
                                                <sourcelist>
65 65
                                                    <name>$specimenHolderInstitutions</name>
......
73 73
                                                    </sourcename>
74 74
                                                </sourcelist>
75 75
                                            </institution_id>
76
                                            <sourceaccessioncode>$id</sourceaccessioncode>
76
                                            <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
77 77
                                        </specimenreplicate>
78 78
                                    </plantobservation>
79 79
                                </aggregateoccurrence>
80 80
                                <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
81
                                <sourceaccessioncode>$id</sourceaccessioncode>
81
                                <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
82 82
                                <taxondetermination>
83 83
                                    <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
84 84
                                    <taxonverbatim_id>
inputs/ACAD/Specimen/VegBIEN.csv
1
ACAD,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
catalogNumber,"/_if[@name=""if specimen""]/cond/_exists",
3
id,"/_if[@name=""if specimen""]/cond/_exists",
4
specimenHolderInstitutions,"/_if[@name=""if specimen""]/else/source/shortname/_first/1",
5
id,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/1",
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
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
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
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
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
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
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",
13
rights,/location/accessconditions,
14
verbatimElevation,"/location/elevation_m/_alt/1/_units:[to=m,to=]/value",
15
recordNumber,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
16
locality,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/1,
17
habitat,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/3,
18
eventDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
19
eventDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsenddate/_alt/2/_dateRangeEnd/value",
20
eventDate,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/obsstartdate/_alt/2/_dateRangeStart/value",
21
eventDate,/location/locationevent/obsenddate/_alt/2/_dateRangeEnd/value,
22
eventDate,/location/locationevent/obsstartdate/_alt/2/_dateRangeStart/value,
23
dateIdentified,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/determinationdate/_alt/1/_dateRangeStart/value",
24
occurrenceRemarks,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
25
recordNumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/authorplantcode/_first/2,
26
reproductiveCondition,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/reproductivecondition,
27
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
28
collectionCode,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectioncode_dwc/_alt/1,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name
29
collectionID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectioncode_dwc/_alt/2,
30
recordNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
31
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
32
id,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
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
id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/sourceaccessioncode,
36
recordNumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
37
scientificName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/2",
38
recordedBy,/location/locationevent/taxonoccurrence/collector_id/party/fullname,
39
id,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
40
recordNumber,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
41
id,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/3,
42
identifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/party/fullname,
43
taxonRank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/rank",
44
specificEpithet,"/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",
45
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",
46
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",
47
order,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=order]/taxonepithet",
48
class,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=class]/taxonepithet",
49
phylum,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=phylum]/taxonepithet",
50
kingdom,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,phylum,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=kingdom]/taxonepithet",
51
infraspecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/taxonepithet,
52
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/rank,
53
taxonRank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonepithet/_if[@name=""if taxonomic name is epithet""]/cond/_alt:[2=true]/1/_taxonomic_name_is_epithet/rank",
54
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
55
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/1,
56
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,
57
specificEpithet,/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,
58
infraspecificEpithet,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/cond",
59
taxonRank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then",
60
infraspecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/2,
61
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
62
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
63
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
64
genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
65
specificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
66
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonomicname,
67
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/verbatimrank,
68
dateIdentified,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/determinationdate/_alt/1/_dateRangeStart/value,
69
catalogNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/then",
70
recordNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/then",
71
locality,/location/locationnarrative/_merge/1,
72
habitat,"/location/locationnarrative/_merge/3/_label[label=""habitat""]/value","Brad: Free-text description of vegetation community where collected, frequently redundane wrt 'Vegetation'. Bob, Nick: keep as user defined or create special element?"
73
locationRemarks,/location/locationnarrative/_merge/4,
74
decimalLatitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
75
decimalLongitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
76
continent,/location/locationplace/*_id/place/continent,
77
country,/location/locationplace/*_id/place/country,
78
county,/location/locationplace/*_id/place/county,
79
decimalLatitude,"/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"
80
decimalLongitude,"/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"
81
country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
82
county,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
83
stateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
84
stateProvince,/location/locationplace/*_id/place/stateprovince,
85
verbatimElevation,/location/verbatimelevation,
86
basisOfRecord,,** No join mapping for basisOfRecord ** 
87
bibliographicCitation,,** No join mapping for bibliographicCitation ** 
88
dynamicProperties,,** No join mapping for dynamicProperties ** 
89
geodeticDatum,,** No join mapping for geodeticDatum ** 
90
georeferenceSources,,** No join mapping for georeferenceSources ** 
91
georeferenceVerificationStatus,,** No join mapping for georeferenceVerificationStatus ** 
92
identificationRemarks,,** No join mapping for identificationRemarks ** 
93
institutionCode,,** No join mapping for specimenHolderInstitutions_verbatim ** 
94
language,,** No join mapping for language ** 
95
modified,,** No join mapping for modified ** 
96
municipality,,** No join mapping for municipality ** 
97
ownerInstitutionCode,,** No join mapping for specimenOwner ** 
98
rightsHolder,,** No join mapping for dataOwners ** 
99
row_num,,** No join mapping for *row_num ** 
100
type,,** No join mapping for type ** 
101
verbatimDepth,,** No join mapping for verbatimDepth ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
102 2

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

  

Also available in: Unified diff