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

taxa db versioning issues within bdc_query_names_taxadb #228

Closed
mfidino opened this issue Jun 6, 2022 · 2 comments
Closed

taxa db versioning issues within bdc_query_names_taxadb #228

mfidino opened this issue Jun 6, 2022 · 2 comments
Labels
bug Something isn't working dependency

Comments

@mfidino
Copy link

mfidino commented Jun 6, 2022

The ``bdc_query_names_taxadb()` function hardcodes database versions here:

# Currently available databases and versions
switch(
EXPR = db,
itis = {
db_version <- 2022
},
ncbi = {
db_version <- 2022
},
col = {
db_version <- 2022
},
gbif = {
db_version <- 2022
},
iucn = {
db_version <- 2019 ### TODO: Change to 2022
},
ott = {
db_version <- 2021
},
fb = {
db_version <- 2019
},
tpl = {
db_version <- 2019
}
)

However, downstream in this function there are calls to the function taxadb::taxa_tbl() which has the default argument ofs:

taxa_tbl(
  provider = getOption("taxadb_default_provider", "itis"),
  schema = c("dwc", "common"),
  version = latest_version(),
  db = td_connect()
)

When latest_version() != db_version, bdc_query_names_taxadb() says that all species names were not found in the DB. This can be illustrated with the iucn database (hardcoded to 2019, but the 2022 version is available).

test <- bdc::bdc_query_names_taxadb(
 sci_name = "Sus scrofa", 
  db = "iucn"
)

test

 data.frame(test)
  original_search suggested_name distance    notes taxonID
1      Sus scrofa             NA       NA notFound    <NA>
  scientificName taxonRank acceptedNameUsageID taxonomicStatus
1           <NA>      <NA>                <NA>            <NA>
  kingdom phylum class order family genus specificEpithet
1    <NA>   <NA>  <NA>  <NA>   <NA>  <NA>            <NA>
  vernacularName infraspecificEpithet
1           <NA>                 <NA>

I'm working off the GitHub installation of bdc

kguidonimartins added a commit that referenced this issue Jun 23, 2022
When omitted, the default value is `taxadb::latest_version`; which is
the opposite of what we want since we have the fixed versions of the
databases.

Related to #228.
@kguidonimartins kguidonimartins added bug Something isn't working dependency labels Jun 23, 2022
@kguidonimartins
Copy link
Collaborator

Thanks for reporting @mfidino, and sorry for the late response. GitHub didn't notify me about this issue :/

However, downstream in this function there are calls to the function taxadb::taxa_tbl() which has the default argument ofs:

Nice catch! I included the argument now. Can you test the latest version of {bdc}?

remotes::install_github("brunobrr/bdc", force = TRUE)

We're aware of the latest version of the IUCN database. However, {taxadb} cannot return the latest version in a fit-for-use way yet (see here). That's the only reason to keep the hard-coded database versions.

@kguidonimartins
Copy link
Collaborator

Databases are hardcoded for a while in the new bdc release, and the following databases are not available: "tpl", "fb", "slb", "wd", and "iucn". I'm closing this issue due to inactivity. Please feel free to reopen it whenever you need to.

@kguidonimartins kguidonimartins closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependency
Projects
None yet
Development

No branches or pull requests

2 participants