Internal handlers to i) ensure there are local copies of record metadata, fetching it from the SAFE project website if needed and ii) load that data from file.
fetch_record_metadata(record_set)
load_record_metadata(record_set)
An object of class safe_record_set
.
The fetch_record_metadata
function invisibly returns a
logical value indicating if all records were fetched successfully and
load_record_metadata
returns a list object containing record
metadata
This is the same metadata used to populate the Zenodo description but is downloaded as JSON format and stored within the record directory in the SAFE data directory for reuse.
fetch_record_metadata
: Download and store JSON metadata for
a record
load_record_metadata
: Load JSON metadata for a record
# \donttest{
set_example_safe_dir()
#> Loading and caching index
#> Validating directory
rec <- validate_record_ids(1400562)
safedata:::fetch_record_metadata(rec)
metadata <- safedata:::load_record_metadata(rec)
unset_example_safe_dir()
#> Loading and caching index
#> Validating directory
# }