Skip to contents

JSON sidecars preserve source identity and query context separately from CSV exports or transformed tibbles. Save nso_value_status() separately for successful results when source symbols matter. Failed fetch manifests retain status from completed chunks when available. Both reading and writing validate the manifest schema. Reading accepts local files; replacement writes preserve the previous file if installing the new file fails.

Usage

nso_write_manifest(x, path, overwrite = FALSE)

nso_read_manifest(path)

Arguments

x

A fetched result, fetch error condition, or provenance manifest.

path

JSON file path.

overwrite

Whether to replace an existing file. Defaults to FALSE.

Value

nso_write_manifest() returns path invisibly; nso_read_manifest() returns an nso_manifest.

Examples

# An unannotated table produces an empty provenance manifest.
observations <- data.frame(value = c(12, 15))
path <- tempfile(fileext = ".json")
nso_write_manifest(observations, path)
saved <- nso_read_manifest(path)
identical(saved, nso_provenance(observations))
#> [1] TRUE
unlink(path)