Project

General

Profile

« Previous | Next » 

Revision 3203

VegBIEN: Fixing import issue related to duplicate entries in tables with children, where when a new table entry duplicates an existing entry, the 1:1 tables of that table and those tables' children are not merged, causing them to become orphaned. It is described in detail at <https://projects.nceas.ucsb.edu/nceas/projects/bien/wiki/Import_issues#Merging-duplicates-with-children&gt;, including the rationale for this solution. Note that this is not a bug in column-based import, it applies to row-based import as well. This commit fixes the issue for specimenreplicate->...->location, by also mapping specimenreplicate's unique keys to location.sourceaccessioncode and setting location.datasource_id.

View differences:

DwC-VegBIEN.specimens.csv
1
"DwC::[@xmlns:dcterms=""http://purl.org/dc/terms/""]/list:[institutionID=$/_ignore/inLabel]/",VegBIEN:/specimenreplicate,Comments,Order
1
"DwC::[@xmlns:dcterms=""http://purl.org/dc/terms/""]/list:[institutionID=$/_ignore/inLabel]/","VegBIEN:/specimenreplicate:[./{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]",Comments,Order
2 2
CoordinateUncertaintyInMeters,/*_id/locationevent/*_id/location/locationdetermination/coordsaccuracy/_noCV/value/_alt/1,,88
3 3
coordinateUncertaintyInMeters,/*_id/locationevent/*_id/location/locationdetermination/coordsaccuracy/_noCV/value/_alt/1,,88
4 4
CoordinatePrecision,/*_id/locationevent/*_id/location/locationdetermination/coordsaccuracy/_noCV/value/_alt/2,,89
......
65 65
eventDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/2",,44
66 66
CollectedDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/3",,44
67 67
collectedDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/3",,44
68
CollectionCode,/collectioncode_dwc,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name,12
69
collectionCode,/collectioncode_dwc,Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name,12
68
CollectorNumber,/collectionnumber/_alt/1/_alt/1,,22
69
collectorNumber,/collectionnumber/_alt/1/_alt/1,,22
70
RecordNumber,/collectionnumber/_alt/1/_alt/2,,22
71
recordNumber,/collectionnumber/_alt/1/_alt/2,,22
72
CollectionID,/collectionnumber/_alt/2,,9
73
collectionID,/collectionnumber/_alt/2,,9
74
FieldNumber,/collectionnumber/_alt/3,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?",53
75
fieldNumber,/collectionnumber/_alt/3,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?",53
70 76
Sex,"/definedvalue[*_id/userdefined[tablename=specimenreplicate,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",26
71 77
sex,"/definedvalue[*_id/userdefined[tablename=specimenreplicate,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",26
72 78
FieldNotes,/description/_merge/1,,
......
121 127
RecordedBy,/verbatimcollectorname,,23
122 128
collector,/verbatimcollectorname,,23
123 129
recordedBy,/verbatimcollectorname,,23
130
InstitutionID,"/{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/1",,8
131
institutionID,"/{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/1",,8
132
CatalogNumber,"/{catalognumber_dwc,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/3}","Brad: Not sure if mapping correct. Nick, is there an element for institutional accession codes in VegX?; Aaron: This can't be used as the accession code (primary key) because some rows don't have a value for it",20
133
catalogNumber,"/{catalognumber_dwc,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/3}","Brad: Not sure if mapping correct. Nick, is there an element for institutional accession codes in VegX?; Aaron: This can't be used as the accession code (primary key) because some rows don't have a value for it",20
134
CollectionCode,"/{collectioncode_dwc,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/2}",Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name,12
135
collectionCode,"/{collectioncode_dwc,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/2}",Brad: Not sure if mapping correct. DwC element; code for entire collection; often same as InstitutionCode; Aaron: Combining with InstitutionCode to create collection name,12
124 136
EstablishmentMeans,"/{growthform/_map:[./{tree,shrub,liana,vine,herb,hemiepiphyte,epiphyte,grass,forb,moss,lichen,fungus,""floating aquatic"",""submerged aquatic""}=*,*=],iscultivated/_map:[cultivated=t,wild=f,*=],isnative/_map:[native=t,exotic=f,*=]}/value",,30
125 137
establishmentMeans,"/{growthform/_map:[./{tree,shrub,liana,vine,herb,hemiepiphyte,epiphyte,grass,forb,moss,lichen,fungus,""floating aquatic"",""submerged aquatic""}=*,*=],iscultivated/_map:[cultivated=t,wild=f,*=],isnative/_map:[native=t,exotic=f,*=]}/value",,30
126
CatalogNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/catalognumber_dwc,"Brad: Not sure if mapping correct. Nick, is there an element for institutional accession codes in VegX?; Aaron: This can't be used as the accession code (primary key) because some rows don't have a value for it",20
127
catalogNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/catalognumber_dwc,"Brad: Not sure if mapping correct. Nick, is there an element for institutional accession codes in VegX?; Aaron: This can't be used as the accession code (primary key) because some rows don't have a value for it",20
128
CollectorNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/1,,22
129
collectorNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/1,,22
130
RecordNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/2,,22
131
recordNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/2,,22
132
CollectionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/2,,9
133
collectionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/2,,9
134
FieldNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/3,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?",53
135
fieldNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/3,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?",53
136
InstitutionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,,8
137
institutionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,,8
138
InstitutionCode,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/institution_id/party/organizationname,,
139
institutionCode,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/institution_id/party/organizationname,,
140
GlobalUniqueIdentifier,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
141
Id,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
142
OccurrenceID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
143
globalUniqueIdentifier,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
144
id,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
145
occurrenceID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,"Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
138
InstitutionCode,"/{institution_id/party/organizationname,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/1}",,
139
institutionCode,"/{institution_id/party/organizationname,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/1}",,
140
GlobalUniqueIdentifier,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
141
Id,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
142
OccurrenceID,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
143
globalUniqueIdentifier,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
144
id,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
145
occurrenceID,"/{sourceaccessioncode,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/1}","Brad: OMIT; Aaron: We need this field because it is the only ID column with an entry in every row; Brad: OK, use this as primary key",19
146 146
AcceptedNameUsage,,** No non-empty join mapping for acceptedNameUsage ** 
147 147
AcceptedNameUsageID,,** No non-empty join mapping for acceptedNameUsageID ** 
148 148
AccessRights,,** No non-empty join mapping for accessRights ** 

Also available in: Unified diff