CatalogueOfLife / backend

Complete backend of COL ChecklistBank
Apache License 2.0
15 stars 11 forks source link

families.hierarchy_code not populated in CoL+ to AC export #392

Closed gdower closed 5 years ago

gdower commented 5 years ago

As a heads up, the hierarchy_code delimiter is '-' not ' - ' like taxonomic_coverage in the databases table. Here's the code I used to temporarily correct this problem for testing:

ALTER TABLE families MODIFY hierarchy_code VARCHAR(250) NULL;
UPDATE families SET hierarchy_code=CONCAT_WS('-', kingdom, IF(phylum IS NULL, 'Not assigned', phylum), IF(class IS NULL, 'Not assigned', class), IF(`order` IS NULL, 'Not assigned', `order`), superfamily, IF(family IS NULL, 'Not assigned', family));
ALTER TABLE families MODIFY hierarchy_code VARCHAR(250) NOT NULL;
gdower commented 5 years ago

Here's some example hierarchy_codes:

Viruses-Not assigned-Not assigned-Caudovirales-Myoviridae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Problognathiidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Austrognathiidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Paucidentulidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Mesognathariidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Gnathostomariidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Gnathostomulidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Onychognathiidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Agnathiellidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Rastrognathiidae
Animalia-Gnathostomulida-Not assigned-Bursovaginoidea-Clausognathiidae
Animalia-Gnathostomulida-Not assigned-Filospermoidea-Pterognathiidae
Animalia-Gnathostomulida-Not assigned-Filospermoidea-Haplognathiidae
Animalia-Hemichordata-Pterobranchia-Not assigned-Atubariidae
Animalia-Hemichordata-Pterobranchia-Not assigned-Cephalodiscidae
Animalia-Hemichordata-Enteropneusta-Not assigned-Spengelidae
mdoering commented 5 years ago

As far as I remember @ruud-altenburg told me the code is not needed for the conversion script. @ruud-altenburg please advice and reopen if it is indeed needed!!!