Reads metadata without network requests. For dsir_data, indicator
identities, dimension values and coverage describe the current rows;
provenance and input counts describe the original conversion input.
Arguments
- x
A download, directory or cleaned result carrying DSIR metadata, a dsir_data object, or one of the bundled gho_catalog, sdg_catalog and ghe_catalog datasets.
Value
A named list. For an analysis object it contains schema_version,
layout, provenance, input, fields, processing, current,
indicators and dimensions. Current indicator labels and dimension
values are observations from the table, not independently fetched
definitions. Read processing$semantics before interpreting them.
Catalog metadata includes its snapshot version, package build version
and source-specific retrieval records. current describes the supplied
table; source record counts describe the complete bundled snapshot.
Retrieval metadata
Downloads and directories retain their existing classes and columns.
dsir_metadata(x)$sources records the actual backend, endpoint, UTC
retrieved_at, retrieval status, cache use, source record count, reported
API version and release. Unknown versions and times remain NA.
Each source row includes its own server query. query records the public
selection, including local filters and reference-country/year restrictions.
result describes the function's original return; current is computed
from the supplied object. Source counts precede local filtering and GHE
measure pivoting, so they can differ from returned row counts.
Result status distinguishes success, empty, failed, incomplete,
invalid, partial and unverified. Completeness concerns the requested
retrieval, not global indicator coverage. It is NA when the response
lacks sufficient completeness information. A successful HTTP response
alone does not establish completeness of an observation download.
Cached records retain their original retrieval time and set cache_hit.
A historical fallback uses retrieval_status = "bundled_snapshot" and
retains the original collection date. It does not prove live availability.
Failed SDG list requests still return NULL with a warning; NULL cannot
carry metadata. Other empty failure results record no successful retrieval
time. Existing WHO who_provenance and catalog_snapshot attributes remain
available for compatibility.
Cleaners preserve acquisition metadata even for empty input. This is
independent of keep_metadata, which controls optional data columns.
as_dsir_data() also retains sources, query and result. These are
historical acquisition records, not an audit of arbitrary changes to a
plain tibble. Use the S3 object's processing status to track supported
transformations. saveRDS() preserves attributes; CSV does not.
Cleaning records live in cleaning, also for output = "tibble" and
user-supplied input without acquisition records. They contain the cleaner,
package version, UTC cleaning time, input/output sizes and columns, options,
and a profile of semantic fields. Each profile records its retained column
(or NA), distinct count including missing values, missing count and its
constant value, if any. Varying omitted values are not stored row by row.
Recorded aliases link equivalent core and named dimensions. Cleaning time
never substitutes for retrieval time. These records describe the cleaning
input; current coverage and subsequent field status remain separate.
Map metadata
dsir_map() records layout = "map", creation time, selected keys and
value/year columns, input metadata and boundary provenance. Downloaded
boundaries record per-country endpoints, queries, original retrieval times,
item modification times, source terms, checksums and cache use. Supplied
boundaries are labelled user_supplied, with no invented retrieval history.
This describes map creation, not later ggplot edits or additional layers.
