The single rule for minting the global taxon key, stated once:
Details
A taxon keys itis:<tsn> exactly when its class is Aves and an acceptedTSN resolves; otherwise worms:<aphia>; otherwise NA, which callersturn into the dataset-local fallback <dataset_key>:<code> thatcheck_taxon_ids() refuses unless allow-listed.
The class is a fact from the authority's classification (staged by
ensure_taxon_lineage()), not a flag a source declares: only one dataset
ever carried an is_bird column, so Aves reaching the release through any
other dataset would have keyed worms: and one species could have carried two
keys. Birds key on ITIS because WoRMS bird taxonomy lags (it still says
Oceanodroma, Puffinus, Phalacrocorax). A bird with no accepted TSN keys
worms: and gets a note in taxon.notes — visible, not silent. All prefixes
are lowercase. Vectorized over the ids; class recycles.
Examples
taxon_key_of(217452L, 161729L) # "worms:217452" (Pacific sardine)
#> [1] "worms:217452"
taxon_key_of(137179L, 174715L, class = "Aves") # "itis:174715" (Great Cormorant)
#> [1] "itis:174715"
taxon_key_of(137179L, NA_integer_, class = "Aves") # "worms:137179" (a bird with no TSN)
#> [1] "worms:137179"