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
U[DwC],VegBIEN:/specimenreplicate,Comments,Order
1
U[DwC],"VegBIEN:/specimenreplicate:[./{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]",Comments,Order
2 2
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
3 3
Gazetteer,"/*_id/locationevent/*_id/location/locationnarrative/_merge/2/_merge/1/_label[label=""gazetteer""]/value/_merge/1","Brad: Correct for VB; Nick, is there no specific element for locality description in VegX? Definitely need one.",69
4 4
Newgazett,"/*_id/locationevent/*_id/location/locationnarrative/_merge/2/_merge/1/_label[label=""gazetteer""]/value/_merge/2","Only used in 1 row; Brad: Correct for VB; Nick, is there no specific element for locality description in VegX? Definitely need one.",69
......
9 9
Colldd,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/1/_date/day/_nullIf:[null=0,type=float]/value",,44
10 10
Collmm,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/1/_date/month/_nullIf:[null=0,type=float]/value",,44
11 11
Collyy,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/1/_date/year/_nullIf:[null=0,type=float]/value",,44
12
Number,/collectionnumber/_alt/1/_alt/2,,22
12 13
Notes,/description/_merge/1,,
13 14
Detyy,"/taxondetermination[role=identifier]/determinationdate/_*/date/_dateRangeStart/value/_alt/1/_date/year/_nullIf:[null=0,type=float]/value",,120
14 15
Detby,"/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
......
16 17
Family,"/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,],do=""plantname[rank=_val]/parent_id""]/plantname[rank=family]/plantname",,146
17 18
Collector,/verbatimcollectorname/_merge/1,,23
18 19
Addcoll,/verbatimcollectorname/_merge/2,,23
19
Barcode,:[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
20
Number,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/2,,22
21
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
20
Barcode,"/{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
21
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
22 22
Alt,,What is this?
23 23
Alt2,,What is this?
24 24
Coorsyst,,** No input mapping for Coorsyst ** 

Also available in: Unified diff