Project

General

Profile

« Previous | Next » 

Revision 10318

inputs/ARIZ/: 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/ARIZ/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../../lib/runscripts/datasrc_dir.run
0 3

  
inputs/ARIZ/omoccurrences/postprocess.sql
2 2

  
3 3
-- cultivated can only be true or NULL, not false
4 4
SELECT mk_derived_col((:table_str, 'cultivated'),
5
$$_map('"0"=>NULL, "*"=>"*"', "cultivationStatus")$$);
5
$$_map('"0"=>NULL, "*"=>"*"', "cultivated_verbatim")$$);
inputs/ARIZ/omoccurrences/run
1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../table.run
0 3

  
inputs/ARIZ/omoccurrences/test.xml.ref
9 9
                    <location>
10 10
                        <authorlocationcode>
11 11
                            <_alt>
12
                                <1>$occid</1>
13
                                <2>$catalogNumber</2>
12
                                <1>$occurrenceID</1>
13
                                <2>$accessionNumber</2>
14 14
                            </_alt>
15 15
                        </authorlocationcode>
16 16
                        <elevation_m>
......
49 49
                                    <count>$individualCount</count>
50 50
                                    <notes>$occurrenceRemarks</notes>
51 51
                                    <plantobservation>
52
                                        <authorplantcode>$recordNumber</authorplantcode>
52
                                        <authorplantcode>$collectorNumber</authorplantcode>
53 53
                                        <definedvalue fkey="tablerecord_id">
54 54
                                            <userdefined_id>
55 55
                                                <userdefined>
......
61 61
                                        </definedvalue>
62 62
                                        <reproductivecondition>$reproductiveCondition</reproductivecondition>
63 63
                                        <specimenreplicate>
64
                                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
65
                                            <collectionnumber>$recordNumber</collectionnumber>
66
                                            <sourceaccessioncode>$occid</sourceaccessioncode>
64
                                            <catalognumber_dwc>$accessionNumber</catalognumber_dwc>
65
                                            <collectionnumber>$collectorNumber</collectionnumber>
66
                                            <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
67 67
                                        </specimenreplicate>
68 68
                                    </plantobservation>
69 69
                                </aggregateoccurrence>
70 70
                                <collector_id><party><fullname>$recordedBy</fullname></party></collector_id>
71 71
                                <iscultivated>$cultivated</iscultivated>
72
                                <sourceaccessioncode>$occid</sourceaccessioncode>
72
                                <sourceaccessioncode>$occurrenceID</sourceaccessioncode>
73 73
                                <taxondetermination>
74 74
                                    <party_id><party><fullname>$identifiedBy</fullname></party></party_id>
75 75
                                    <taxonverbatim_id>
inputs/ARIZ/omoccurrences/VegBIEN.csv
1
ARIZ,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
occid,"/_if[@name=""if specimen""]/cond/_exists",
4
occid,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/1",
5
catalogNumber,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/3/_if[@name=""if plot""]/else/_alt/2/_if[@name=""if catalogNumber""]/cond/_exists",
6
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",
7
occid,"/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
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",
9
verbatimElevation,"/location/elevation_m/_alt/1/_units:[to=m,to=]/value",
10
minimumElevationInMeters,/location/elevation_m/_alt/2/_avg/1,
11
maximumElevationInMeters,/location/elevation_m/_alt/2/_avg/2,
12
occid,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
13
recordNumber,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/cond/_exists",
14
cultivated,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/else/_first/1",
15
locality,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/1,
16
habitat,/location/iscultivated/_or/2/_locationnarrative_is_cultivated/locationnarrative/_join/3,
17
samplingProtocol,/location/locationevent/*_id/method/name,
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
taxonRemarks,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/notes",
25
identificationQualifier,"/location/locationevent/taxonoccurrence/_if[@name=""if has accepted name""]/then/taxondetermination:[determinationtype=accepted]/taxonfit",
26
individualCount,/location/locationevent/taxonoccurrence/aggregateoccurrence/count,
27
occurrenceRemarks,/location/locationevent/taxonoccurrence/aggregateoccurrence/notes/_join/1,
28
recordNumber,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/authorplantcode/_first/2,
29
sex,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/definedvalue[*_id/userdefined[tablename=plantobservation,userdefinedname=sex]]:[@fkey=tablerecord_id]/definedvalue","Brad: OMIT. Apparently not used by this institution and of uncertain applicability to plants. With other collections, *sometimes* used for phenological information (if specimen in flower, in fruit, sterile, etc.). If so, this is important information we should keep. Bob, Nick, anywhere for phenological information in VB and VX?; Aaron: Keeping it because it's useful for some collections"
30
reproductiveCondition,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/reproductivecondition,
31
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/else",
32
recordNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/else",
33
catalogNumber,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
34
occid,"/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/specimenreplicate/institution_id/sourcelist/_if[@name=""if specimen""]/cond/_exists",
35
occid,/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
occid,"/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
cultivated,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/then/_first/1",
42
occid,/location/locationevent/taxonoccurrence/sourceaccessioncode/_first/3,
43
identifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/party/fullname,
44
taxonRank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/rank",
45
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",
46
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",
47
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",
48
infraspecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/taxonepithet,
49
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/rank,
50
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",
51
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/prefix/_taxon_family_require_std/family,
52
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/1,
53
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,
54
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,
55
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",
56
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",
57
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,
58
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/2,
59
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/author,
60
family,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/family,
61
genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
62
specificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
63
scientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/taxonomicname,
64
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/verbatimrank,
65
dateIdentified,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/determinationdate/_alt/1/_dateRangeStart/value,
66
taxonRemarks,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/notes,
67
identificationQualifier,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/taxonfit,
68
catalogNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/catalognumber_dwc/_if[@name=""if indirect voucher""]/then",
69
recordNumber,"/location/locationevent/taxonoccurrence/voucher/*_id/specimenreplicate/collectionnumber/_if[@name=""if indirect voucher""]/then",
70
locality,/location/locationnarrative/_merge/1,
71
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?"
72
locationRemarks,/location/locationnarrative/_merge/4,
73
coordinateUncertaintyInMeters,/location/locationplace/*_id/place/*_id/coordinates/coordsaccuracy_m/_noCV/value,
74
footprintWKT,/location/locationplace/*_id/place/*_id/coordinates/footprintgeometry_dwc,
75
decimalLatitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
76
decimalLongitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
77
verbatimCoordinates,/location/locationplace/*_id/place/*_id/coordinates/verbatimcoordinates,
78
country,/location/locationplace/*_id/place/country,
79
county,/location/locationplace/*_id/place/county,
80
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"
81
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"
82
country,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/country/_first/2,
83
county,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
84
stateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
85
stateProvince,/location/locationplace/*_id/place/stateprovince,
86
verbatimElevation,/location/verbatimelevation,
87
associatedCollectors,,** No join mapping for *associatedCollectors ** 
88
associatedOccurrences,,** No join mapping for associatedOccurrences ** 
89
associatedTaxa,,** No join mapping for associatedTaxa ** 
90
attributes,,** No join mapping for *attributes ** 
91
basisOfRecord,,** No join mapping for basisOfRecord ** 
92
collectionCode,,** No non-empty join mapping for UNUSED#collectionCode ** 
93
collectionID,,** No non-empty join mapping for UNUSED#collectionID ** 
94
collid,,** No join mapping for *collid ** 
95
coordinatePrecision,,** No non-empty join mapping for UNUSED#coordinatePrecision ** 
96
cultivationStatus,,** No join mapping for cultivated_verbatim ** 
97
dataGeneralizations,,** No join mapping for dataGeneralizations ** 
98
datasetID,,** No non-empty join mapping for UNUSED#datasetID ** 
99
dateLastModified,,** No join mapping for modified ** 
100
day,,** No join mapping for day ** 
101
dbpk,,** No join mapping for *dbpk ** Only populated for 2651 rows
102
deaccessioned,,** No join mapping for *deaccessioned ** 
103
disposition,,** No join mapping for disposition ** 
104
duplicateQuantity,,** No join mapping for *duplicateQuantity ** 
105
duplicateid,,** No join mapping for *duplicateid ** 
106
dynamicProperties,,** No join mapping for dynamicProperties ** 
107
endDayOfYear,,** No join mapping for endDayOfYear ** 
108
establishmentMeans,,"** No non-empty join mapping for OMIT#establishmentMeans ** Only populated for 1 row, which also has cultivationStatus"
109
fieldNotes,,** No non-empty join mapping for UNUSED#fieldNotes ** 
110
fieldnumber,,** No non-empty join mapping for UNUSED#fieldnumber ** 
111
genericcolumn1,,** No join mapping for *genericcolumn1 ** 
112
genericcolumn2,,** No join mapping for *genericcolumn2 ** 
113
geodeticDatum,,** No join mapping for geodeticDatum ** 
114
georeferenceProtocol,,** No join mapping for georeferenceProtocol ** 
115
georeferenceRemarks,,** No join mapping for georeferenceRemarks ** 
116
georeferenceSources,,** No join mapping for georeferenceSources ** 
117
georeferenceVerificationStatus,,** No join mapping for georeferenceVerificationStatus ** 
118
georeferencedBy,,** No join mapping for georeferencedBy ** 
119
identificationReferences,,** No join mapping for identificationReferences ** 
120
identificationRemarks,,** No join mapping for identificationRemarks ** 
121
informationWithheld,,** No join mapping for informationWithheld ** 
122
institutionCode,,** No non-empty join mapping for UNUSED#institutionCode ** 
123
institutionID,,** No non-empty join mapping for UNUSED#institutionID ** 
124
labelProject,,** No join mapping for *labelProject ** 
125
language,,** No join mapping for language ** 
126
lifeStage,,** No join mapping for lifeStage ** 
127
localitySecurity,,** No join mapping for *localitySecurity ** 
128
localitySecurityReason,,** No join mapping for *localitySecurityReason ** 
129
modified,,** No join mapping for modified ** 
130
month,,** No join mapping for month ** 
131
municipality,,** No join mapping for municipality ** 
132
observeruid,,** No join mapping for *observeruid ** 
133
occurrenceID,,** No non-empty join mapping for DUPLICATE#of:occid#occurrenceID ** Not populated for all rows
134
otherCatalogNumbers,,** No join mapping for otherCatalogNumbers ** 
135
ownerInstitutionCode,,** No join mapping for specimenOwner ** Only populated for 547 rows
136
preparations,,** No join mapping for preparations ** 
137
previousIdentifications,,** No join mapping for previousIdentifications ** 
138
processingstatus,,** No join mapping for *processingstatus ** 
139
recordEnteredBy,,** No join mapping for *recordEnteredBy ** 
140
recordedById,,** No join mapping for *recordedById ** 
141
sciname,,** No join mapping for *sciname ** 
142
startDayOfYear,,** No join mapping for startDayOfYear ** 
143
substrate,,** No join mapping for *substrate ** 
144
tidinterpreted,,** No join mapping for *tidinterpreted ** 
145
typeStatus,,** No join mapping for typeStatus ** 
146
verbatimAttributes,,** No join mapping for *verbatimAttributes ** 
147
verbatimCoordinateSystem,,** No non-empty join mapping for UNUSED#verbatimCoordinateSystem ** 
148
verbatimEventDate,,** No join mapping for verbatimEventDate ** 
149
year,,** No join mapping for year ** 
1
link ../../../mappings/VegCore-VegBIEN.csv
150 2

  

Also available in: Unified diff