ropensci / rgbif

Interface to the Global Biodiversity Information Facility API
https://docs.ropensci.org/rgbif
Other
152 stars 51 forks source link

vernacular names missing #518

Closed mvarewyck closed 2 years ago

mvarewyck commented 2 years ago

I can't manage to retrieve vernacular names

> library(rgbif)
> 
> fullData <- name_lookup(
+   query = "Tricellaria",
+   datasetKey = "0a2eaf0c-5504-4f48-a47f-c94229029dc8",
+   limit = 10000)
> fullData$names
NULL
> fullData$data$key
[1] 157131002 157131003 157131004 157131005

While they seem to be here and I can retrieve them using API requests:

> myRequest <- httr::GET("https://api.gbif.org/v1/species/157131005/vernacularNames")
> httr::content(myRequest)$results
[[1]]
[[1]]$taxonKey
[1] 157131005

[[1]]$vernacularName
[1] "onverwacht mosdiertje"

[[1]]$language
[1] "nld"

[[1]]$preferred
[1] TRUE

[[2]]
[[2]]$taxonKey
[1] 157131005

[[2]]$vernacularName
[1] "bryozoaire inopiné"

[[2]]$language
[1] "fra"

[[2]]$source
[1] "Dewarumez, J.-M.; Gévaert, F.; Massé, C.; Foveau, A.; Desroy, N.; Grulois, D. (2011). Les espèces marines animales et végétales introduites dans le bassin Artois-Picardie . UMR CNRS 8187 LOG/Agence de l'Eau Artois-Picardie: Douai. 138 pp."

[[2]]$preferred
[1] FALSE
Session Info ```r R version 4.1.1 (2021-08-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.6 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1 locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_GB.UTF-8 LC_NAME=en_GB.UTF-8 [9] LC_ADDRESS=en_GB.UTF-8 LC_TELEPHONE=en_GB.UTF-8 [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rgbif_3.7.2 rj_4.0.5-4 loaded via a namespace (and not attached): [1] Rcpp_1.0.7 pillar_1.6.4 compiler_4.1.1 plyr_1.8.6 [5] tools_4.1.1 rj.gd_4.0.5-1 uuid_0.1-4 jsonlite_1.7.2 [9] lifecycle_1.0.1 tibble_3.1.5 gtable_0.3.0 pkgconfig_2.0.3 [13] rlang_0.4.12 DBI_1.1.1 curl_4.3.2 crul_1.1.0 [17] dplyr_1.0.7 httr_1.4.2 stringr_1.4.0 xml2_1.3.2 [21] generics_0.1.0 vctrs_0.3.8 triebeard_0.3.0 grid_4.1.1 [25] tidyselect_1.1.1 httpcode_0.3.0 glue_1.4.2 data.table_1.14.2 [29] R6_2.5.1 oai_0.3.2 fansi_0.5.0 conditionz_0.1.0 [33] whisker_0.4 ggplot2_3.3.5 purrr_0.3.4 magrittr_2.0.1 [37] urltools_1.7.3 scales_1.1.1 ellipsis_0.3.2 assertthat_0.2.1 [41] colorspace_2.0-2 utf8_1.2.2 stringi_1.7.5 lazyeval_0.2.2 [45] munsell_0.5.0 crayon_1.4.1 ```
jhnwllr commented 2 years ago

Try instead

name_usage(key=157131005, data='vernacularNames')