Skip to contents

metadata/taxon_override.csv and metadata/taxon_group.csv are read whole by every ingest while each loads only its own vocabulary, so a row for another dataset is normal there and cannot be validated. This is the check for the place where every dataset IS present — the release, after assemble_core() — replacing the hard-coded list of dataset names the package used to validate against (taxon plan D5). The allowed set is the dataset_keys present in dataset_taxonmeasurement_taxon; a row naming anything else (a typo, a retired dataset) errors, because a registry row that matches nothing is how a missing id hides.

Usage

check_taxon_registries(
  con,
  overrides = NULL,
  group_rules = NULL,
  measurement_taxon = NULL,
  halt = TRUE
)

Arguments

con

a DBI connection holding the assembled dataset_taxon

overrides

the override registry (metadata/taxon_override.csv), or NULL

group_rules

the group registry (read_taxon_group_rules()), or NULL

measurement_taxon

the composite crosswalk (metadata/measurement_taxon.csv), whose dataset_keys count as supplied, or NULL

halt

logical; stop() on an orphan (default TRUE)

Value

(invisibly) a named list of the orphan dataset_keys per registry