Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the labelHtml for a name relation #872

Open
thomasstjerne opened this issue Oct 13, 2020 · 3 comments
Open

How to get the labelHtml for a name relation #872

thomasstjerne opened this issue Oct 13, 2020 · 3 comments

Comments

@thomasstjerne
Copy link

After labelHtml was removed from names, the related names on taxon pages are broken.
The UI receives name relations through the https://api.catalogue.life/dataset/2207/name/359/relations endpoint, and subsequently fetches each name:
https://api.catalogue.life/dataset/2207/name/360
https://api.catalogue.life/dataset/2207/name/362

It would be ideal if the https://api.catalogue.life/dataset/2207/name/359/relations endpoint include the labelHtml , that would even save the subsequent calls to the /name endpoint

@mdoering
Copy link
Member

Ah, makes sense. Leads to a quite inconsistent API unfortunately. I was strongly hoping to restrict labels to usages (which have namePhrase etc) and was glad to remove them from pure names.

What if the TaxonInfo object would already contain relations and resolve them to actual usages, not names?

@thomasstjerne
Copy link
Author

What if the TaxonInfo object would already contain relations and resolve them to actual usages, not names?

That would be ideal

@mdoering
Copy link
Member

As a quick fix you can just render the scientificName & authorship of the name.
The label really becomes tricky only for usages with accordingTo and namePhrases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants