Writes a JSON-LD document with pretty-printing and auto_unbox = TRUE,
the convention used throughout the cybedtools pipeline. Creates the
parent directory if it does not exist.
See also
Other File I/O:
read_jsonld_document()
Examples
tmp <- tempfile(fileext = ".jsonld")
doc <- list(
`@context` = build_jsonld_context("nice"),
`@graph` = list(build_framework_node(
framework_id = "nice-v2",
framework_name = "NICE",
framework_prefix = "nice",
version = "2.0.0",
publisher = "NIST",
jurisdiction = "US",
sector = "civilian",
specificity = "cybersecurity-specific"
))
)
write_jsonld_document(doc, tmp)
#> JSON-LD written: /tmp/RtmpIddnpZ/file1b8069e7cdea.jsonld
file.exists(tmp)
#> [1] TRUE
unlink(tmp)
