Project

General

Profile

« Previous | Next » 

Revision 10558

inputs/UBC/: switched to new-style import, using the steps at wiki.vegpath.org/Adding_new-style_import_to_a_datasource

View differences:

inputs/UBC/Specimen/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/UBC/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
                                        <1>$institutionCode</1>
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>
......
45 45
                        <locationevent>
46 46
                            <taxonoccurrence>
47 47
                                <aggregateoccurrence>
48
                                    <collectiondate>$eventDate</collectiondate>
48
                                    <collectiondate>$dateCollected</collectiondate>
49 49
                                    <notes>$occurrenceRemarks</notes>
50 50
                                    <plantobservation>
51
                                        <authorplantcode>$recordNumber</authorplantcode>
51
                                        <authorplantcode>$collectorNumber</authorplantcode>
52 52
                                        <specimenreplicate>
53
                                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
53
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
54 54
                                            <collectioncode_dwc>
55 55
                                                <_alt>
56
                                                    <1>$collectionCode</1>
57
                                                    <2>$collectionID</2>
56
                                                    <1>$collection</1>
57
                                                    <2>$collectionURL</2>
58 58
                                                </_alt>
59 59
                                            </collectioncode_dwc>
60
                                            <collectionnumber>$recordNumber</collectionnumber>
60
                                            <collectionnumber>$collectorNumber</collectionnumber>
61 61
                                            <institution_id>
62 62
                                                <sourcelist>
63
                                                    <name>$institutionCode</name>
63
                                                    <name>$specimenHolderInstitutions</name>
64 64
                                                    <sourcename>
65 65
                                                        <name>
66 66
                                                            <_split>
67 67
                                                                <separator>[,;] *</separator>
68
                                                                <value>$institutionCode</value>
68
                                                                <value>$specimenHolderInstitutions</value>
69 69
                                                            </_split>
70 70
                                                        </name>
71 71
                                                    </sourcename>
72 72
                                                </sourcelist>
73 73
                                            </institution_id>
74
                                            <sourceaccessioncode>$id</sourceaccessioncode>
74
                                            <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
75 75
                                        </specimenreplicate>
76 76
                                    </plantobservation>
77 77
                                </aggregateoccurrence>
78 78
                                <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
79
                                <sourceaccessioncode>$id</sourceaccessioncode>
79
                                <sourceaccessioncode>$dataProviderRecordID</sourceaccessioncode>
80 80
                                <taxondetermination>
81 81
                                    <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
82 82
                                    <taxonverbatim_id>
inputs/UBC/Specimen/VegBIEN.csv
1
UBC,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
institutionCode,"/_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
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",
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
dateIdentified,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/determinationdate/_alt/1/_dateRangeStart/value",
19
taxonRemarks,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/notes",
20
identificationQualifier,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/taxonfit",
21
eventDate,/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/1,
22
occurrenceRemarks,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
23
recordNumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/authorplantcode/_first/2,
24
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
25
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
26
collectionID,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectioncode_dwc/_alt/2,
27
recordNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
28
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
29
id,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
30
institutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/name/_first/2",
31
institutionCode,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/then/sourcename/name/_first/2/_split:[separator=""[,;] *""]/value",
32
id,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/sourceaccessioncode,
33
recordNumber,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/3",
34
scientificName,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/3/_first/2",
35
recordedBy,/location/locationevent/taxonoccurrence/collector_id/party/fullname,
36
id,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
37
recordNumber,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
38
id,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/3,
39
identifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/party/fullname,
40
taxonRank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/rank",
41
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",
42
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",
43
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",
44
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",
45
infraspecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/taxonepithet,
46
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/rank,
47
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",
48
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
49
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/1,
50
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,
51
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,
52
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",
53
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",
54
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,
55
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
56
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
57
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
58
genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
59
specificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
60
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonomicname,
61
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/verbatimrank,
62
dateIdentified,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/determinationdate/_alt/1/_dateRangeStart/value,
63
taxonRemarks,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/notes,
64
identificationQualifier,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/taxonfit,
65
catalogNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/then",
66
recordNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/then",
67
locality,/location/locationnarrative/_merge/1,
68
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?"
69
coordinateUncertaintyInMeters,/location/locationplace/*_id/place/*_id/coordinates/coordsaccuracy_m/_noCV/value,
70
decimalLatitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
71
decimalLongitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
72
verbatimCoordinates,/location/locationplace/*_id/place/*_id/coordinates/verbatimcoordinates,
73
verbatimLatitude,/location/locationplace/*_id/place/*_id/coordinates/verbatimlatitude,
74
verbatimLongitude,/location/locationplace/*_id/place/*_id/coordinates/verbatimlongitude,
75
country,/location/locationplace/*_id/place/country,
76
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"
77
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"
78
country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
79
stateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
80
stateProvince,/location/locationplace/*_id/place/stateprovince,
81
verbatimElevation,/location/verbatimelevation,
82
associatedMedia,,** No join mapping for associatedMedia ** 
83
associatedReferences,,** No join mapping for associatedReferences ** 
84
associatedSequences,,** No join mapping for associatedSequences ** 
85
basisOfRecord,,** No join mapping for basisOfRecord ** 
86
bibliographicCitation,,** No join mapping for bibliographicCitation ** 
87
datasetID,,** No join mapping for datasetURL ** 
88
datasetName,,** No join mapping for dataset ** 
89
disposition,,** No join mapping for disposition ** 
90
geodeticDatum,,** No join mapping for geodeticDatum ** 
91
georeferenceSources,,** No join mapping for georeferenceSources ** 
92
georeferencedBy,,** No join mapping for georeferencedBy ** 
93
georeferencedDate,,** No join mapping for georeferencedDate ** 
94
institutionID,,** No non-empty join mapping for UNUSED#institutionID ** 
95
language,,** No join mapping for language ** 
96
modified,,** No join mapping for modified ** 
97
nomenclaturalCode,,** No join mapping for nomenclaturalCode ** 
98
ownerInstitutionCode,,** No join mapping for specimenOwner ** 
99
preparations,,** No join mapping for preparations ** 
100
previousIdentifications,,** No join mapping for previousIdentifications ** 
101
references,,** No join mapping for distributors ** 
102
rightsHolder,,** No join mapping for dataOwners ** 
103
row_num,,** No join mapping for *row_num ** 
104
type,,** No join mapping for type ** 
105
typeStatus,,** No join mapping for typeStatus ** 
106
verbatimSRS,,** No join mapping for verbatimSRS ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
107 2

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

  

Also available in: Unified diff