| validate_rocrate | R Documentation |
Performs structural, semantic and profile validation.
validate_rocrate(x, mode = c("stop", "report"), strict = FALSE)
x |
A path (character) or an existing rocrate object. |
mode |
Either |
strict |
Logical. Enable profile validation. |
A rocrate_validation object (in report mode).
# -------- SETUP --------
basic_crate <- rocrateR::rocrate()
# temp file
tmp_dir <- file.path(tempdir(), digest::digest(basename(tempfile())))
tmp <- file.path(tmp_dir, "ro-crate-metadata.json")
dir.create(tmp_dir)
# -------- INPUT: RO-Crate --------
rocrateR::validate_rocrate(basic_crate)
# -------- INPUT: Path --------
# save RO-Crate
rocrateR::write_rocrate(basic_crate, path = tmp)
## with file name
rocrateR::validate_rocrate(tmp)
## with directory
rocrateR::validate_rocrate(tmp_dir)
# -------- INPUT: Invalid RO-Crate --------
structure(list(), class = "rocrate") |>
rocrateR::validate_rocrate(mode = "report")
# delete temp directory
unlink(tmp_dir, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.