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.cs-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
coordinatePrecision,/*_id/locationevent/*_id/location/locationdetermination/coordsaccuracy/_noCV/value/_alt/2,,89
4 4
boundingBox,/*_id/locationevent/*_id/location/locationdetermination/footprintgeometry_dwc,,91
......
32 32
yearCollected,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/1/_date/year/_nullIf:[null=0,type=float]/value",,44
33 33
eventDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/2",,44
34 34
collectedDate,"/*_id/locationevent/{obsstartdate/_*/date/_dateRangeStart,obsenddate/_*/date/_dateRangeEnd}/value/_alt/3",,44
35
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
35
collectorNumber,/collectionnumber/_alt/1/_alt/1,,22
36
recordNumber,/collectionnumber/_alt/1/_alt/2,,22
37
collectionID,/collectionnumber/_alt/2,,9
38
fieldNumber,/collectionnumber/_alt/3,"Brad: Correct for VB, not sure about VX; Nick, is there an element in VX fo Collection Number?",53
36 39
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
37 40
fieldNotes,/description/_merge/1,,
38 41
notes,/description/_merge/1,,
......
60 63
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
61 64
collector,/verbatimcollectorname,,23
62 65
recordedBy,/verbatimcollectorname,,23
66
institutionID,"/{.,*_id/locationevent/*_id/location}/datasource_id/party/organizationname/_alt/1",,8
67
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
68
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
63 69
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
64
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
65
collectorNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/1,,22
66
recordNumber,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/1/_alt/2,,22
67
collectionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/collectionnumber/_alt/2,,9
68
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
69
institutionID,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,,8
70
institutionCode,:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/institution_id/party/organizationname,,
71
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
72
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
73
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
70
institutionCode,"/{institution_id/party/organizationname,*_id/locationevent/*_id/location/sourceaccessioncode/_alt/2/_merge/1}",,
71
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
72
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
73
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
74 74
acceptedNameUsage,,,135
75 75
acceptedNameUsageID,,,128
76 76
accessRights,,** No non-empty join mapping for dcterms:accessRights ** Versions without namespace

Also available in: Unified diff