Call it after resolve_dataset_taxon() and before append_obs(). Three
findings, each a row of the returned report:
Usage
check_dataset_taxon(
con,
dataset_key,
allow = character(),
halt = TRUE,
codes = NULL,
verbose = TRUE
)Arguments
- con
a DBI connection holding
dataset_taxon(andtaxon)- dataset_key
the dataset whose crosswalk is checked
- allow
character vector of
taxon_keys accepted as-is: dataset-local keys of non-taxonomic classes, or aworms:key for an Aves taxon with no TSN- halt
logical;
stop()on any finding (defaultTRUE)- codes
optional character vector of the
ds_taxa_codes the observations reference (e.g.DISTINCT species_codeof the source observation table); every one must be in the vocabulary- verbose
logical; message the summary
Value
a data.frame with one row per finding (check, ds_taxon_key,
ds_taxa_code, taxon_key, detail); zero rows when clean. Invisible
when verbose = FALSE.
Details
missing_code— a code the observations reference (codes) that is not in this dataset'sdataset_taxon. Farallon'sMEGU(the pre-split Mew Gull code, present in the observations and absent from the species list) is the case that motivated it: anobsprojection joining on the code would drop or NULL those rows with no error anywhere.unresolved— adataset_taxonrow with no authoritytaxon_key(worms:/itis:), unless its dataset-local key is inallow— the ingest's own declaration of a genuinely non-taxonomic class (zooscan "nauplii", phyto "undefined code"), one key at a time, with a comment.aves_not_itis— a taxon whose class is Aves that did not keyitis:(no accepted TSN resolved; seetaxon_key_of()). Checked here because this is where it is cheap to fix — a TSN intaxon_override.csv. An ingest that accepts theworms:key lists that key inallow. Needstaxonincon(build_taxon_reference()) for the class; skipped without it.
release_database.qmd's check_taxon_ids() stays as the backstop.