create_EML: Create EML.

View source: R/create_EML.R

create_EMLR Documentation

Create EML.

Description

Create an EML package-compatible XML list tree for an EML document, ready to validate and write to .xml file.

Usage

create_EML(
  meta_list,
  entity_list,
  dataset_id,
  file_dir = getwd(),
  expand_taxa = FALSE,
  skip_taxa = FALSE,
  ble_options = FALSE
)

Arguments

meta_list

(list) A list of dataframes containing metadata returned by get_meta.

entity_list

(character) A list of entities returned by create_entity_all.

dataset_id

(numeric) A dataset ID.

file_dir

(character) Path to directory containing flat files (abstract and method documents). Defaults current R working directory.

expand_taxa

(logical) TRUE/FALSE on whether assemble_taxonomic will lookup and fully expand a leaf node taxon's full taxonomic classification (kingdom to the lowest rank provided) into nested EML taxonomicCoverage elements (TRUE) or simply make a taxonomic coverage module based on the information provided in metabase (FALSE). This assumes, of course, that the taxa provided are only the leaf nodes. If so, setting this to TRUE and having the full classification may help your dataset be more discover-able, however the lookup process may be more prone to errors. If this is set to TRUE, rows containing taxa from unsupported providers, or from supported providers but whose classification lookups fail, will not be expanded. The function will use information from the taxonid, taxonrankvalue, taxonid_provider, and (if you have it) providerurl columns from the vw_eml_taxonomy view queried from metabase. It expects taxonid to contain the correct identifier for the taxon from the listed taxonomic authority/provider, taxonrankvalue to contain the taxon's name, taxonid_provider to provide a correctly spelled name or commonly used ID for the taxonomic provider/authority (e.g. ITIS for the Integrated Taxonomy Information System), and providerurl to contain a working url to the same.

skip_taxa

(logical) Whether to skip the call to assemble_taxonomic. Provided in case assemble_taxonomic fails in some way – taxonomies are tricky; one option is to manually insert in a text editor a snippet of EML generated elsewhere, into the complete EML output from MetaEgress. Defaults to FALSE.

ble_options

(logical) Whether to perform tasks specific to BLE-LTER: add an additional metadata snippet to facilitate replication to the Arctic Data Center. Defaults to FALSE.

Value

(list) An EML package-compatible XML list tree. Supply this list object to eml_validate and write_eml to, in order, validate and write to .xml file.

Examples

## Not run: 
# continued from \code{\link{get_meta}} and \code{\link{create_entity_all}}
EML <- create_EML(meta_list = metadata, entity_list = entities, dataset_id = 1, license_path = here::here("documents", "license.docx"))

## End(Not run)

atn38/metabase-to-eml-R documentation built on June 12, 2025, 6:18 p.m.