Merge the per-dataset taxon shards into one authoritative reference
Source: R/shards.R
merge_taxon_shards.RdEach ingest emits the taxon rows its own vocabulary reaches. The same taxon
can appear in several shards (Appendicularia is in both zoodb and zooscan), so
rows are collapsed on taxon_key and each field takes the first non-NULL
value in dataset directory order. There is no priority list (taxon plan
D5): every shard's scientific_name / rank / classification comes from the
same cached authority lineage, so shards agree wherever both have a value and
the order only settles which shard fills a gap. common_name is not decided
here at all — the release applies the written precedence with
apply_taxon_common() — and notes is unioned, never picked.
Usage
merge_taxon_shards(
con,
root = ".",
parquet_dir = cc_stage_path("parquet"),
exclude = release_excluded_datasets(root)
)Arguments
- con
a DuckDB connection
- root
workflows repo root
- parquet_dir
directory holding the per-dataset output dirs. Defaults to the local staging root (see
cc_stage_dir()), where the bulk parquet lives; an absolute path is used as-is, a relative one is resolved againstroot. The JSON sidecars stay in the repo and are found separately.- exclude
dataset dir names to skip (see
core_shard_paths())