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:

VegBIEN.specimens.csv
1
ACAD[DwC],VegBIEN:/specimenreplicate,Comments,Order
1
ACAD[DwC],"VegBIEN:/specimenreplicate:[./{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]",Comments,Order
2 2
county,"/*_id/locationevent/*_id/location/locationdetermination/namedplace_id/_simplifyPath:[next=""parent_id/namedplace"",require=placename]/path/_forEach:[in:[],do=""namedplace[rank=_val]/parent_id""]/namedplace[rank=county]/placename",,66
3 3
stateProvince,"/*_id/locationevent/*_id/location/locationdetermination/namedplace_id/_simplifyPath:[next=""parent_id/namedplace"",require=placename]/path/_forEach:[in:[county,],do=""namedplace[rank=_val]/parent_id""]/namedplace[rank=stateProvince]/placename",,65
4 4
country,"/*_id/locationevent/*_id/location/locationdetermination/namedplace_id/_simplifyPath:[next=""parent_id/namedplace"",require=placename]/path/_forEach:[in:[county,stateProvince,],do=""namedplace[rank=_val]/parent_id""]/namedplace[rank=country]/placename",Brad: Required; reject record if this field NULL,63
......
8 8
decimalLatitude,"/*_id/locationevent/*_id/location/{locationdetermination/latitude,centerlatitude}/_alt/1/_nullIf:[null=0,type=float]/value",,85
9 9
decimalLongitude,"/*_id/locationevent/*_id/location/{locationdetermination/longitude,centerlongitude}/_alt/1/_nullIf:[null=0,type=float]/value",,86
10 10
eventDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/2",,44
11
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
11
recordNumber,/collectionnumber/_alt/1/_alt/2,,22
12
collectionID,/collectionnumber/_alt/2,,9
12 13
dateIdentified,/taxondetermination[role=identifier]/determinationdate/_*/date/_dateRangeStart/value/_alt/2,,120
13 14
identifiedBy,"/taxondetermination[role=identifier]:[iscurrent=true]/*_id/party/{givenname/_namePart/first,middlename/_namePart/middle,surname/_namePart/last}",Brad: Bob: does this look correct for VegBank?,119
14 15
scientificName,"/taxondetermination[role=identifier]:[isoriginal=true,iscurrent=true]/*_id/plantconcept/plantname_id/_simplifyPath:[next=""parent_id/plantname"",require=plantname]/path/_forEach:[in:[],do=""plantname[rank=_val]/parent_id""]/plantname[rank=binomial]/plantname","Brad: Bob, Nick, please is this mapping OK?",134
......
22 23
phylum,"/taxondetermination[role=identifier]:[isoriginal=true,iscurrent=true]/*_id/plantconcept/plantname_id/_simplifyPath:[next=""parent_id/plantname"",require=plantname]/path/_forEach:[in:[binomial,authority,subspecies,species,genus,family,order,class,],do=""plantname[rank=_val]/parent_id""]/plantname[rank=subkingdom]/plantname",,143
23 24
kingdom,"/taxondetermination[role=identifier]:[isoriginal=true,iscurrent=true]/*_id/plantconcept/plantname_id/_simplifyPath:[next=""parent_id/plantname"",require=plantname]/path/_forEach:[in:[binomial,authority,subspecies,species,genus,family,order,class,subkingdom,],do=""plantname[rank=_val]/parent_id""]/plantname[rank=kingdom]/plantname",,142
24 25
recordedBy,/verbatimcollectorname,,23
25
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
26
recordNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/2,,22
27
collectionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/2,,9
28
institutionCode,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/institution_id/party/organizationname,,
29
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
26
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
27
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
28
institutionCode,"/{institution_id/party/organizationname,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/1}",,
29
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
30 30
basisOfRecord,,** No non-empty join mapping for basisOfRecord ** 
31 31
bibliographicCitation,,** No non-empty join mapping for bibliographicCitation ** 
32 32
dynamicProperties,,** No non-empty join mapping for dynamicProperties ** 

Also available in: Unified diff