build_fishbase: Rebuild the FishBase or SeaLifeBase snapshot

View source: R/build_fishbase.R

build_fishbaseR Documentation

Rebuild the FishBase or SeaLifeBase snapshot

Description

Rebuild the FishBase or SeaLifeBase snapshot

Usage

build_fishbase(
  version = format(Sys.Date(), "%Y"),
  provider = c("fb", "slb"),
  fb_version = NULL,
  dir = build_dir(),
  db = td_connect()
)

Arguments

version

snapshot version to write, e.g. "2026"

provider

"fb" for FishBase or "slb" for SeaLifeBase

fb_version

which FishBase snapshot to build from, e.g. "v26.07". Defaults to the most recent published.

dir

directory for build inputs and outputs

db

a duckdb connection

Details

FishBase and SeaLifeBase share a schema, and both are already published as Parquet alongside the taxadb snapshots, so this build reads them over the network and downloads nothing.

FishBase numbers accepted species (SpecCode) and synonyms (SynCode) in two independent sequences, so the same integer means different things in each: SpecCode 1 is Scyris indica while SynCode 1 is Alausa coerulea. Prefixing both as FB:1 would make one identifier name two taxa, which it did in the previously published table – 20,295 FishBase identifiers and 61,125 SeaLifeBase ones were ambiguous.

Only SpecCode is therefore used as the taxonID, and synonyms carry a NULL one exactly as they do for NCBI and OTT. Nothing is lost: the SynCode is published in its own synonymID column. A consequence is that a synonym whose SpecCode is 0 – not linked to any species record, 1,043 names in FishBase and 7,512 in SeaLifeBase – has nothing to resolve to and is dropped.

Classification comes from the families table. FishBase covers only fishes, so its phylum and kingdom are constant. SeaLifeBase spans some sixty phyla across several kingdoms and asserts no kingdom itself, so kingdom is left empty there rather than inferred.

FishBase data is CC-BY-NC (fishbase.org).

Value

the paths written, invisibly

See Also

Other build: build_col(), build_gbif(), build_itis(), build_ncbi(), build_ott()

Examples

## Not run: 
build_fishbase("2026", provider = "fb")

## End(Not run)

taxadb documentation built on Aug. 31, 2026, 5:07 p.m.