Build the taxon_group grouping table (many taxa per group) from the registry
Source: R/taxa.R
build_taxon_group.RdGroups come from metadata/taxon_group.csv (taxon plan D4), not from code:
Arguments
- con
a DuckDB connection holding
taxonanddataset_taxon- rules
the registry as read by
read_taxon_group_rules(), or a path to it.NULLlooks formetadata/taxon_group.csvunderhere::here().- tbl
target table name (default
"taxon_group")- ...
the pre-3.29
measurement_taxon/overridesarguments, accepted with a deprecation warning and ignored (the groups are not derived from them any more)
Details
class— every vocabulary taxon whose releasedclassequalsrule_value:calcofi:seabirds= Aves,calcofi:marine_mammals= Mammalia. Cross-dataset by construction; no dataset column. Scoped to taxa some dataset actually observes (present indataset_taxon), never to a bare lineage ancestor — a group selects observed taxa, and the ancestors are reachable throughparent_taxon_keyanyway.dataset_taxon— by(dataset_key, match_column, match_value)againstdataset_taxon, the same matchertaxon_override.csvuses: the phytoplankton functional groups onds_common_name.
A rule naming a match_column the vocabulary lacks errors; a rule for a
dataset absent from this connection is skipped (it is another ingest's), and
check_taxon_registries() catches one nobody supplies at the release. Needs
taxon and dataset_taxon in con, i.e. call it after
build_taxon_reference() and resolve_dataset_taxon().