Read all datafindr cache files from a metawoRld project
read_all_from_cache.Rd
Scans the datafindr cache directory within a metawoRld project, reads all valid cached JSON files (assessment, extraction, metadata), parses them, and returns them organized in a nested list.
Usage
read_all_from_cache(
type = c("assessment", "extraction", "metadata"),
metawoRld_path
)
Value
A named list. The top-level names are the sanitized identifiers found
in the cache. Each element is itself a list containing the parsed data,
named by the type ("assessment", "extraction", "metadata"). Returns an
empty list (list()
) if the cache directory doesn't exist or no valid
cache files are found.
Details
The function identifies files matching the pattern
<sanitized_id>_<type>.json
within the assessment
, extraction
, and
metadata
subdirectories of the datafindr cache. It attempts to parse each
valid file as JSON. Files that cannot be parsed or do not match the naming
convention are skipped with a warning.