Skip to contents

Read catalogue correspondences without loading data

Usage

read_mapping_configuration(path)

Arguments

path

Local mapping YAML path.

Value

A mapping_configuration object. Each target table contains a list of alternatives, including when YAML uses the compact single-mapping form. Effective source and target lookups and the returned property are explicit. Correspondence file paths are absolute. The provenance attribute records the configuration path and SHA-256 checksum.

Details

Validates the versioned mapping schema, lookup inheritance and alternative uniqueness. A selection is identified by its source table, source lookup, target lookup and returned property. YAML expressions are never evaluated. Reading does not load reference configurations, open CSV correspondence files or retrieve catalogue data.

Relative correspondence paths resolve from the YAML directory. File existence, contents and table columns are checked during preparation.

Examples

mapping <- read_mapping_configuration(system.file(
  "examples", "survey", "mapping.yaml", package = "form.model"))
names(mapping$mappings)
#> [1] "stations"  "observers"