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
QMOR[DwC],VegBIEN:/specimenreplicate,Comments,Order
1
QMOR[DwC],"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
footprintWKT,/*_id/locationevent/*_id/location/locationdetermination/footprintgeometry_dwc,,91
4 4
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
......
14 14
decimalLongitude,"/*_id/locationevent/*_id/location/{locationdetermination/longitude,centerlongitude}/_alt/1/_nullIf:[null=0,type=float]/value",,86
15 15
verbatimLongitude,"/*_id/locationevent/*_id/location/{locationdetermination/longitude,centerlongitude}/_alt/1/_nullIf:[null=0,type=float]/value",,82
16 16
eventDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/2",,44
17
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
17
collectionID,/collectionnumber/_alt/2,,9
18 18
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
19 19
dateIdentified,/taxondetermination[role=identifier]/determinationdate/_*/date/_dateRangeStart/value/_alt/2,,120
20 20
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
......
29 29
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
30 30
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
31 31
recordedBy,/verbatimcollectorname,,23
32
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
33
collectionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/2,,9
34
institutionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,,8
35
institutionCode,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/institution_id/party/organizationname,,
36
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
32
institutionID,"/{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/1",,8
33
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
34
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
35
institutionCode,"/{institution_id/party/organizationname,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/1}",,
36
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
37 37
acceptedNameUsage,,** No non-empty join mapping for acceptedNameUsage ** 
38 38
basisOfRecord,,** No non-empty join mapping for basisOfRecord ** 
39 39
behavior,,** No non-empty join mapping for behavior ** 

Also available in: Unified diff