Skip to contents

Read catalogue sources and lookup definitions

Usage

read_reference_configuration(path, prompt = FALSE, sources_path = NULL)

Arguments

path

YAML configuration path.

prompt

Securely prompt for missing passwords; defaults to FALSE.

sources_path

Optional YAML mapping catalogue names to source overrides. Relative override paths resolve from this file.

Value

A reference_configuration object containing named catalogues, each with a reference_source object and table lookup definitions. No data is downloaded.

Details

The packaged schema/references-1.0.0.yaml schema checks the required schema_version. Each catalogue declares source and tables; each source directory contains catalogue.yaml and catalogue.csv; lookup names are column names. Relative source and cache paths resolve from the YAML directory. The schema uses form.references/schema/1, not JSON Schema.

Sources accept url, cache, timeout and max_connections, plus user and password for HTTPS Basic authentication. If cache is omitted, each source uses a temporary directory for the current R session. Set cache explicitly to retain downloaded files across sessions. Use password: !env VARIABLE to read a secret from the environment. With prompt = TRUE, missing passwords are requested through askpass. Credentials remain in memory; do not serialize the result.

Examples

# Read the catalogue sources and lookup settings.
reference_configuration <- read_reference_configuration(
  system.file("examples", "survey", "references.yaml", package = "form.model"))
# Inspect the configured catalogue names.
names(reference_configuration$catalogues)
#> [1] "code_lists" "registries"