validate_metadata: Validate Metadata

View source: R/validate_metadata.R

validate_metadataR Documentation

Validate Metadata

Description

Validates the Extensible Markup Language (XML) formatted metadata that is intended for a USGS data release. Checks your FGDC-compatible geospatial metadata record using mp (metadata parser). Requires the mp executable is on your path. Download and install the software if not found.

Usage

validate_metadata(file, destdir = NULL, opts = c("e", "h", "f"), error = FALSE)

Arguments

file

'character' string. Path to a XML formatted metadata file that contains the information for a USGS data release.

destdir

'character' string. Destination directory to write files, with tilde-expansion performed. Defaults to the file directory.

opts

'character' vector. Output option codes. Choose from one or more of the following codes: e direct syntax errors to file, t write indented ASCII text file, h write outline-style HTML file, f write FAQ-style HTML file, s write Standard Generalized Markup Language (SGML) file, x write XML file, and d write Directory Interchange Format (DIF) file.

error

'logical' flag. Whether to stop execution if validation errors are found (default is FALSE) or mp executable is not accessible.

Value

Invisibly returns a flag indicating whether validation errors were found. Returns NA if mp executable is not accessible.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

make_data_release function for creating a USGS data release.

Examples

validate_metadata(
  file = system.file("extdata/test.xml", package = "inldata"),
  destdir = "validate"
)
list.files("validate")

unlink("validate", recursive = TRUE)

inldata documentation built on Sept. 12, 2024, 9:34 a.m.