Project

General

Profile

« Previous | Next » 

Revision 3207

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 locationevent->location in plots data, by also mapping locationevent's unique keys to location.sourceaccessioncode and setting location.datasource_id.

View differences:

VegBIEN.organisms.csv
19 19
/*ID->/*s/plotObservation/simpleUserdefined[name=method]/*ID/method/name,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/method_id/_collapse:[require=name]/value/method/name,
20 20
/*ID->/*s/plotObservation/obsEndDate,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/obsenddate,
21 21
/*ID->/*s/plotObservation/obsStartDate,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/obsstartdate,
22
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation/*UniqueIdentifierID->/*s/plot/plotName,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/parent_id/locationevent/authorlocationcode,
23
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation/partyWithRole/*ID->/parties/party/organizationName,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/parent_id/locationevent:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,
24
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation:[partyWithRole/*ID->/parties/party/organizationName=$/_ignore/inLabel]/*UniqueIdentifierID->/*s/plot/plotUniqueIdentifier,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/parent_id/locationevent:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,
25 22
/*ID->/*s/plotObservation/simpleUserdefined[name=precipitation]/value,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/precipitation,
26 23
/*ID->/*s/plotObservation/*ID->/*s/project/personnel[role=metadataProvider]/organizationName,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/project_id/_collapse:[require=projectname]/value/project:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,
27 24
/*ID->/*s/plotObservation/*ID->/*s/project:[personnel[role=metadataProvider]/organizationName=$/_ignore/inLabel]/title,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/project_id/_collapse:[require=projectname]/value/project:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/projectname,
......
45 42
/*ID->/*s/plotObservation/temperature,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/temperature,
46 43
/*ID->/*s/plotObservation/*UniqueIdentifierID->/*s/plot/geospatial/maximumDepthInMeters,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/waterdepth/_avg/max/_units:[default=m,to=m,to=]/value",
47 44
/*ID->/*s/plotObservation/*UniqueIdentifierID->/*s/plot/geospatial/minimumDepthInMeters,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/waterdepth/_avg/min/_units:[default=m,to=m,to=]/value",
48
/*ID->/*s/plotObservation/plotUniqueIdentifierID->/*s/plot[plotUniqueIdentifier]/plotName,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/authorlocationcode,
49
/*ID->/*s/plotObservation/partyWithRole/*ID->/parties/party/organizationName,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1,
50
/*ID->/*s/plotObservation/plotUniqueIdentifierID->/*s/plot[plotUniqueIdentifier]/plotUniqueIdentifier,/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/sourceaccessioncode,
45
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation/*UniqueIdentifierID->/*s/plot/plotName,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/{parent_id/locationevent/{authorlocationcode,*_id/location/sourceaccessioncode/_alt/2},*_id/location/sourceaccessioncode/_merge/1/_alt/2}",
46
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation/partyWithRole/*ID->/parties/party/organizationName,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/{parent_id/locationevent:[./{.,*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/{.,*_id/location}/datasource_id/party/organizationname/_alt/1}",
47
/*ID->/*s/plotObservation/simpleUserdefined[name=parent]/value->/*s/plotObservation:[partyWithRole/*ID->/parties/party/organizationName=$/_ignore/inLabel]/*UniqueIdentifierID->/*s/plot/plotUniqueIdentifier,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent/{parent_id/locationevent:[./{.,*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/{sourceaccessioncode,*_id/location/sourceaccessioncode/_alt/1},*_id/location/sourceaccessioncode/_merge/1/_alt/1}",
48
/*ID->/*s/plotObservation/partyWithRole/*ID->/parties/party/organizationName,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[./{.,*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/{.,*_id/location}/datasource_id/party/organizationname/_alt/1",
49
/*ID->/*s/plotObservation/plotUniqueIdentifierID->/*s/plot[plotUniqueIdentifier]/plotName,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[./{.,*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/{authorlocationcode,*_id/location/sourceaccessioncode/_merge/2/_alt/2}",
50
/*ID->/*s/plotObservation/plotUniqueIdentifierID->/*s/plot[plotUniqueIdentifier]/plotUniqueIdentifier,"/aggregateoccurrence/*_id/taxonoccurrence/*_id/locationevent:[./{.,*_id/location}/datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/{sourceaccessioncode,*_id/location/sourceaccessioncode/_merge/2/_alt/1}",
51 51
/*ID->/*s/individualOrganism/*ID->/*s/taxonNameUsageConcept:[partyWithRole/*ID->/parties/party/organizationName=$/_ignore/inLabel]/voucher,"/aggregateoccurrence/*_id/taxonoccurrence/_if:[cond/_eq:[left/_ref[addr=""../../../../_ignore/voucherType""],right=direct]]/{then/specimenreplicate,else/voucher/*_id/specimenreplicate:[*_id/taxonoccurrence]}/:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/catalognumber_dwc",
52 52
/*ID->/*s/individualOrganism/*ID->/*s/taxonNameUsageConcept/partyWithRole/*ID->/parties/party/organizationName,"/aggregateoccurrence/*_id/taxonoccurrence/_if:[cond/_eq:[left/_ref[addr=""../../../../_ignore/voucherType""],right=direct]]/{then/specimenreplicate,else/voucher/*_id/specimenreplicate:[*_id/taxonoccurrence]}/:[datasource_id/party/organizationname/_alt/2=$/_ignore/inLabel]/datasource_id/party/organizationname/_alt/1",
53 53
/simpleUserdefined[name=growthForm]/value,/aggregateoccurrence/*_id/taxonoccurrence/growthform,

Also available in: Unified diff