CatalogueOfLife / backend

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

Empty text tree download #1334

Closed nickynicolson closed 3 months ago

nickynicolson commented 3 months ago

Description

Checking fix for issue CatalogueOfLife/checklistbank#1416 - selected text tree format download for an accepted species in the dataset Download processed but the .txtree file (attached: ec14862c-1d62-4809-8462-95c82a82b249.zip) is empty. Request parameters:

datasetKey: 1048
root: Geranium trilophum Boiss.
synonyms: true
bareNames: false
minRank: genus
format: text tree
tabFormat: tsv
excel: false
extended: false
force: false

What browsers are you seeing the problem on?

Chrome

ChecklistBank URL

https://www.checklistbank.org/download/ec14862c-1d62-4809-8462-95c82a82b249

mdoering commented 3 months ago

When I select that species the UI sends this request:

{"format":"text tree","synonyms":true,"bareNames":false,"extinct":null,"excel":false,"root":{"id":"acf6dd1c-8bab-9a63-8e6f-26034f10719e"},"minRank":"SPECIES"}

Which yields the following download:

Geranium trilophum Boiss. [species]
  =Geraniopsis trilophum (Boiss.) Chrtek [species]
  =Geranium abaicum Schweinf. ex R. Knuth in Engl. [species]

This seems to be all correct to me.

mdoering commented 3 months ago

Ah, this is because your request contains minRank=GENUS for some reason. Either you really selected that, or it is this bug I just opened for @thomasstjerne https://github.com/CatalogueOfLife/checklistbank/issues/1416#issuecomment-2196263257

mdoering commented 3 months ago

In case you wanna get some good exports now you can always use curl:

curl --user USER:PASSWD --data-binary '{"format":"text tree","synonyms":true,"root":{"id":"acf6dd1c-8bab-9a63-8e6f-26034f10719e"}}' -X POST https://api.checklistbank.org/dataset/1048/export

If you like to have identifiers in your TextTree results you need to also set "extended": true. Depending on the dataset this makes the export a lot slower as it grabs all kind of other data like vernacular names too.