Project

General

Profile

« Previous | Next » 

Revision 5513

mappings/VegCore-VegBIEN.csv: taxonconcept.parent_id when explicit parent provided: Set taxonconcept.parent_id using new _taxonconcept_set_parent_id() after creating the child taxonconcept, so that the parent_id will point to the already-inserted parent taxonconcept instead of creating a new, empty parent taxonconcept. This creates a two-step import, where first the taxonconcepts are imported, and then the parent_ids are matched up. This is necessary for column-based import because all the parent taxonconcepts are imported in a separate iteration from the child taxonconcepts with only their sourceaccessioncode, so this iteration must occur after the child taxonconcept iteration in order to match up with fully-populated taxonconcepts. Row-based import, on the other hand, does not require _taxonconcept_set_parent_id() but does require the taxonconcepts to be provided in dependency order (parents first), which is unfortunately not the case for NCBI.

View differences:

inputs/.NCBI/higher_taxa/VegBIEN.csv
2 2
parent tax_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_if[@name=""if has explicit parent""]/cond/_exists",
3 3
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_if[@name=""if has explicit parent""]/else/_if[@name=""if has verbatim name""]/{then/.,else/matched_concept_id/taxonconcept:[creator_id/party:[creator_id=0]/organizationname=TNRS]}/identifyingtaxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then",
4 4
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_if[@name=""if has explicit parent""]/else/_if[@name=""if has verbatim name""]/{then/.,else/matched_concept_id/taxonconcept:[creator_id/party:[creator_id=0]/organizationname=TNRS]}/identifyingtaxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/6",
5
parent tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_parent_id/parent_id/taxonconcept/sourceaccessioncode,
5 6
parent tax_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/_if[@name=""if has explicit parent""]/cond/_exists",
6 7
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/_if[@name=""if has explicit parent""]/else/rank",
7 8
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/_if[@name=""if has explicit parent""]/else/verbatimrank",
8
parent tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
9 9
rank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/rank,
10 10
tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/sourceaccessioncode,
11 11
name_txt,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/taxonname,
inputs/.NCBI/higher_taxa/test.xml.ref
9 9
                        <taxondetermination>
10 10
                            <taxonconcept_id>
11 11
                                <taxonconcept>
12
                                    <parent_id><taxonconcept><sourceaccessioncode>$parent tax_id</sourceaccessioncode></taxonconcept></parent_id>
12
                                    <_taxonconcept_set_parent_id><parent_id><taxonconcept><sourceaccessioncode>$parent tax_id</sourceaccessioncode></taxonconcept></parent_id></_taxonconcept_set_parent_id>
13 13
                                    <rank>$rank</rank>
14 14
                                    <sourceaccessioncode>$tax_id</sourceaccessioncode>
15 15
                                    <taxonname>$name_txt</taxonname>
mappings/VegCore-VegBIEN.csv
184 184
acceptedSpecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_matched_concept_id/matched_concept_id/taxonconcept/species,
185 185
acceptedScientificName,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_matched_concept_id/matched_concept_id/taxonconcept/taxonomicname,
186 186
acceptedTaxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_matched_concept_id/matched_concept_id/taxonconcept/verbatimrank,
187
parentScientificNameID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_parent_id/parent_id/taxonconcept/sourceaccessioncode,
188
parentTaxonConceptID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_parent_id/parent_id/taxonconcept/sourceaccessioncode,
189
parentTaxonID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/_taxonconcept_set_parent_id/parent_id/taxonconcept/sourceaccessioncode,
187 190
scientificNameAuthorship,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/author,
188 191
identifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/creator_id/_simplifyPath:[next=creator_id]/path/party/givenname/_namePart/first,
189 192
identifiedBy,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/creator_id/_simplifyPath:[next=creator_id]/path/party/middlename/_namePart/middle,
......
206 209
class,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,],do=""taxonconcept[rank=_val]/parent_id""]/taxonconcept[rank=class]/taxonname",
207 210
phylum,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,],do=""taxonconcept[rank=_val]/parent_id""]/taxonconcept[rank=phylum]/taxonname",
208 211
kingdom,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,genus,family,order,class,phylum,],do=""taxonconcept[rank=_val]/parent_id""]/taxonconcept[rank=kingdom]/taxonname",
209
parentScientificNameID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
210
parentTaxonConceptID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
211
parentTaxonID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
212 212
infraspecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/parent_id/taxonconcept/taxonname,
213 213
taxonRank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/rank,
214 214
scientificNameID,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonconcept/sourceaccessioncode,
mappings/for_review/VegCore-VegBIEN.csv
184 184
acceptedSpecificEpithet,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/species,
185 185
acceptedScientificName,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/taxonomicname,
186 186
acceptedTaxonRank,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/verbatimrank,
187
parentScientificNameID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/sourceaccessioncode,
188
parentTaxonConceptID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/sourceaccessioncode,
189
parentTaxonID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/taxonconcept/sourceaccessioncode,
187 190
scientificNameAuthorship,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/author,
188 191
identifiedBy,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/creator_id/party/givenname,
189 192
identifiedBy,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/creator_id/party/middlename,
......
206 209
class,//taxonconcept/parent_id[rank=class]/taxonname,
207 210
phylum,//taxonconcept/parent_id[rank=phylum]/taxonname,
208 211
kingdom,//taxonconcept/parent_id[rank=kingdom]/taxonname,
209
parentScientificNameID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
210
parentTaxonConceptID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
211
parentTaxonID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/parent_id/taxonconcept/sourceaccessioncode,
212 212
infraspecificEpithet,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/parent_id/taxonconcept/taxonname,
213 213
taxonRank,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/rank,
214 214
scientificNameID,//taxonoccurrence/taxondetermination[]/*_id/taxonconcept/sourceaccessioncode,

Also available in: Unified diff