spice_to_eml {dataspice}R Documentation

Convert dataspice metadata to EML

Description

Performs an (imperfect) conversion of dataspice metadata to EML. It's very likely you will get validation errors and need to fix them afterwards but spice_to_eml is a good way to a richer metadata schema (EML) when you're already using dataspice but need a richer metadata schema.

Usage

spice_to_eml(spice = file.path("data", "metadata", "dataspice.json"))

Arguments

spice

(list) Your dataspice metadata. Uses data/metadata/dataspice.json by default.

Value

(emld) The crosswalked emld object

Examples

# Load an example dataspice JSON that comes installed with the package
spice <- system.file(
  "examples", "annual-escapement.json",
  package = "dataspice"
)

# And crosswalk it to EML
spice_to_eml(spice)

# We can also create dataspice metadata from scratch and crosswalk it to EML
myspice <- list(
  name = "My example spice",
  creator = "Me",
  contact = "Me"
)
spice_to_eml(myspice)

[Package dataspice version 1.1.0 Index]