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

Multiple issues with species.name_usage(data='vernacularNames') #68

Closed
niconoe opened this issue May 26, 2020 · 4 comments
Closed

Multiple issues with species.name_usage(data='vernacularNames') #68

niconoe opened this issue May 26, 2020 · 4 comments
Labels
Milestone

Comments

@niconoe
Copy link
Contributor

niconoe commented May 26, 2020

I noticed a few issues when trying to do species.name_usage(key=1, language="FRENCH", data='vernacularNames') (example from the documentation, I just changed the key to get some results).

  • Doc issue: there's no mention of the possible values for languages ("FRENCH"? "FR"? "fr"? ,"fra"?, ...). We should ideally list the possible values or link to an existing standard.
  • The documentation mentions "english" is the default language, but species.name_usage(key=1, data='vernacularNames') returns data in 17 different languages.
  • species.name_usage(key=1, language="FRENCH", data='vernacularNames') also returns vernacular names in the 17 languages (the parameter seems ignored).
@niconoe
Copy link
Contributor Author

niconoe commented May 26, 2020

According to GBIF's API documentation, the vernacularName endpoint doesn't support the LANGUAGE parameter.

We can either:

  • Drop this example from the documentation, and specify which options of name_usage() accept the LANGUAGE parameter.
  • Implement language filtering in the function, on GBIF's response. In theory, we should implement pagination first (in case there are more than 1000 results returned, and the requested language appears on a page > 1).

@sckott
Copy link
Collaborator

sckott commented May 26, 2020

Thanks. I've opened an issue in the gbif forum https://discourse.gbif.org/t/language-and-the-species-api/2188

@niconoe
Copy link
Contributor Author

niconoe commented May 28, 2020

Thanks!

The last column of the table "Working with Name Usages" at https://www.gbif.org/developer/species gives information on which endpoint accepts which parameter. Maybe we should make sure pygbif documentation is in sync (or just point users there, to avoid duplication information)?

@sckott
Copy link
Collaborator

sckott commented May 28, 2020

Right. It's not that much information though, so I think we can point out what routes language works with. And we should make sure to tell users how to specify language. In that forum thread Matt said:

Enumeration for all ISO 639-1 language codes using 2 lower case letters. The enumeration maps to 3 letter codes and Locales.

so language expects a 2 letter iso code, e..g.,

https://api.gbif.org/v1/species/5231190?language=de

@sckott sckott added this to the v0.6 milestone Mar 6, 2021
@sckott sckott added the docs label Mar 6, 2021
@sckott sckott closed this as completed in 256176a Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants