taxadb 0.3.0
Data
All provider snapshots are rebuilt (#123). Six defects in the previously published tables are fixed:
-
ncbi: accepted names had notaxonID– 2,210,230 of them – which brokefilter_id(),get_names()and theget_ids()round trip for the provider. The table also held only 3.8M of NCBI’s 5.1M names, missing most names above species rank, and put the whole binomial inspecificEpithetwhere every other provider puts the epithet alone. -
col: 402,570 names were empty, nearly all at genus rank and above, so higher taxa could not be found by name. -
gbif: 1,272,809 names were empty – BOLD BINs, UNITE species hypotheses, metagenome-assembled genomes and hybrid formulas, which GBIF cannot canonicalize but which are still the names. 40,895 synonyms ofdoubtfulnames could not be resolved. -
ott: 2,226,375 synonyms had notaxonomicStatus, because OTT stopped populating the column this was read from. -
itis: 208,544 names gained afamilyand 212,029 aclass; rank information had been missing for plants and fungi. -
fb,slb: accepted names and synonyms were numbered in separate sequences but given the same prefix, so 28,989 identifiers inslbnamed more than one taxon.
scientificName now preserves the authority’s own name string. Previously clean_names() was applied when building the tables, which stripped punctuation out of the reference data itself: the phylum Deinococcus-Thermus was published as Deinococcus Thermus, and Acalypha gracilens var. monococca as var monococca. clean_names() is for normalizing your own input at query time; it is unchanged and still exported.
fb (FishBase) and slb (SeaLifeBase) are published again.
iucn, tpl and wd are dropped. The IUCN Red List cannot be redistributed under its terms and its API now requires a personal token – use rredlist, noting that the Red List is a conservation-status source rather than a taxonomy. The Plant List was retired by its maintainers in 2013; use col, or World Flora Online. Wikidata was never published.
Note that the gbif table is built from the most recent backbone GBIF has published, which is dated 2023-08-28.
Versions
Older releases are republished on the same object store as the current ones, so an analysis that pinned a version keeps resolving. Archival snapshots are byte-identical to the original release and are deliberately not corrected: a silently repaired snapshot would return different results to a script written against the real one. They therefore predate the schema rules and generally violate some, which each release records per table in the rules_violated column of its manifest.csv.
22.12 – the version taxadb 0.2.x resolved by default, and the one pinned by bdc and BeeBDC – is published, covering the nine datasets that release declared. Its IUCN table is excluded: the Red List terms prohibit redistribution of the data and its derivatives.
Reading the data
- Tables are read directly from versioned Parquet on source.coop by
duckdb. There is no import step:filter_name("Homo sapiens", "itis")works on a fresh install. -
td_download()installs a local copy for offline use or repeated queries.td_create()is retained as an alias for it. -
available_versions(),available_providers()andlist_snapshots()report what is published, discovered from the data repository, so a new release needs no package update to become visible. -
taxadb_uri()gives the location backing any table, andoptions(taxadb_repo=)redirects reads to a mirror or to your own builds. -
taxadb_provider_info()gives each provider’s authority, licence and preferred citation.fbandslbare CC BY-NC and may not be used commercially; the other providers permit commercial use with attribution.
Building and checking the data
-
td_build()rebuilds a provider from its own distribution, andbuild_itis(),build_ncbi(),build_col(),build_gbif(),build_ott()andbuild_fishbase()are exported individually. This supersedes the separatetaxadb-cacherepository, so a fresher snapshot than the published one no longer requires anyone else’s involvement. Builds run induckdb, out of core. -
td_validate()checks a table against the taxadb schema rules, stated as structural invariants rather than a column whitelist. It is what gates the published snapshots. -
td_manifest()andtd_write_metadata()describe a built snapshot: row counts, column lists, per-file SHA-256, and the upstream release each table was derived from.
Breaking changes
-
duckdbis the only backend. TheRSQLite,MonetDBLiteand in-memory options are gone, along with thebackendsvignette and theTAXADB_DRIVERenvironment variable.dbdir,driverandread_onlyarguments totd_connect()are ignored. - The content-hash and provenance layer is removed:
tl_import(), the bundledschema.json, and thecontentidandmemoisedependencies. The data are addressed by version and provider instead. -
iucn,tplandwdare no longer recognized providers. -
ncbi’sspecificEpithetholds the epithet, not the binomial.fbandslbsynonyms have aNULLtaxonID, with the FishBaseSynCodein a newsynonymIDcolumn.
Documentation
- README gains a section on names that match more than one taxon, which affects 207,438 of GBIF’s 7.2 million names (2.9%). It separates the three causes – homonyms across nomenclatural codes, ambiguous synonyms, and duplicate name usages – and recommends
filter_name()overget_ids()for bulk matching, since keeping only accepted rows resolves 51% of cases and the classification columns resolve most of the rest.
Bug fixes
-
filter_name()and the otherfilter_*functions no longer letduckdbscale memory with core count.duckdbdefaults to one scanning thread per core and a buffer pool of most of system RAM; each scanning thread holds a decompressed Parquet row group, so on a 128-core machine looking up a single name in the GBIF table peaked at 1.3 GB while getting no faster.td_connect()now caps threads at 8, which measured faster than the default (0.7s against 1.0s) at a quarter of the memory. Raise it withoptions(taxadb_threads=);td_build()lifts it automatically, since a bulk build is the opposite workload (#95). -
latest_version()ordered versions as strings, so"22.12"sorted above"2026"and publishing an archival release would have made 2022 data the default for every query. Versions are now compared as version numbers. -
itisandncbigainscientificNameAuthorship, which every other provider already carried (#100). ITIS supplies it for 97% of names; NCBI records authorship as a separateauthorityname, which is now also lifted onto the taxon’s other rows, covering 52%. Authorship is what distinguishes same-name-different-author synonyms, which is the case the requester raised. - The paper describing the package is cited in the README and the
data-sourcesvignette, not only ininst/CITATION(#92). - The warning
get_ids()emits for an ambiguous name suggestedfilter_name('X', '')with an empty provider, because it was built from the deprecateddbargument rather thanprovider. The suggested command now works. -
get_names()returnsNAfor an unmatched identifier, as documented, rather than raising an error. -
get_names()works for every identifier format. Theuriformat never round-tripped for any provider, because the URI prefix was applied as a regular expression and ITIS’s contains?and&; and all formats butprefixfailed for theitis_testprovider. - The bundled
itis_testfixture is regenerated from a real build, and the examples that had been querying names absent from it now work.
taxadb 0.2.1
CRAN release: 2023-03-08
- substantial speed improvements to all
filter_*andget_*functions - streamline legacy code in filter_* and get_* functions to better leverage duckdb speed increase
-
get_namesandget_idsnow use the same argument name,provider, to specify the naming provider, rather thandb(which was used intaxize::get_ids)
taxadb 0.2.0
CRAN release: 2023-02-14
- taxadb is now backed by partitioned parquet files, cached locally by contentid
- taxadb is now fully-duckdb based. This deprecates the previous ‘pluggable’ backend with options to use RSQLite or no database backend. Parquet-backed option means that even initial import is much faster, leaving no need to use any of the inferior backend options.
- mutate_db is deprecated,
dplyr::mutate()will work as anticipated. - metadata/prov archive is now based on schema.org rather than DCAT2
- includes 22.12 release for name providers
col,itis,ncbi,ott, andgbif. Other database name providers are currently deprecated (though at leastiucnshould be restored soon).
taxadb 0.1.6
CRAN release: 2022-09-14
- bugfix for recent duckdb release. (imported table names are now prefixed with “v” to avoid names that start with numbers)
taxadb 0.1.4
CRAN release: 2022-03-05
- bugfix in
get_ids()when multiple English common names are accepted for the species. - export
taxadb_dir(), making it easier to purge the DB afterduckdbupgrades - All imports must be used
- Improve testing in
db=NULLcase. - Require R.utils, to ensure compressed files can be expanded