This function is used to create a yaml metadata file when executing a data pipeline that describes the data pipeline and the data queried through the data pipeline.

metadata(
  pipeline_id,
  pipeline_creators,
  pipeline_date,
  pipeline_url,
  pipeline_crs,
  pipeline_bbox = NULL,
  pipeline_timespan = NULL,
  data_name,
  data_description,
  data_access = timestamp(),
  data_timespan = NULL,
  data_bbox = NULL,
  data_contacts,
  data_url = NULL,
  data_uuid = NULL,
  data_availability = NULL,
  data_citekey
)

get_metadata(
  pipeline_id,
  pipeline_crs = 4326,
  pipeline_bbox = NULL,
  pipeline_timespan = NULL,
  data_access = timestamp(),
  data_bbox = NULL,
  data_timespan = NULL,
  ...
)

add_metadata(meta, ...)

Arguments

pipeline_id

individual id of data pipeline

pipeline_creators

creators of the data pipeline

pipeline_date

date YYYY-MM-DD (%Y-%m-%s) that pipeline was created

pipeline_url

url to data pipeline code

pipeline_crs

spatial projection used to transform the spatial data into a uniform projection. Default is set to crs = 4326

pipeline_bbox

bounding box that was used to spatially subset the queried data, if applicable. The bounding box should be of the form c(xmin, ymin, xmax, ymax),

pipeline_timespan

time span that was used to temporally subset the queried data, if applicable. The time span should a vector containing all the years to be queried c(year1, year2, ...),

data_name

short name of data queried

data_description

description of data queried

data_access

access date of queried data

data_timespan

temporal coverage of data, if applicable

data_bbox

bounding box of data of the form c(xmin, ymin, xmax, ymax), if applicable

data_contacts

contacts for data queried

data_url

data url, if applicable

data_uuid

data uuid, e.g. from API or open data portals, if applicable

data_availability

availability of queried data, one of c('open','on demand','data sharing agreement','restricted')

data_citekey

vector of citation keys for reference to bibtex files

...

further arguments used in add_template() to include additional metadata information on the queried data.

meta

meta list generated by metadata() and used as first argument of add_metadata()

Value

This function returns a yaml metadata

Functions

  • metadata: export metadata yaml

  • get_metadata: builds metadata from internal package data

  • add_metadata: add additional information on queried data to metadata

Examples

if (FALSE) {
meta <- get_metadata(
  pipeline_id = uid,
  pipeline_crs = crs,
  pipeline_bbox = bbox,
  pipeline_timespan = timespan,
  data_access = timestamp(),
  data_bbox = sf::st_bbox(dat),
)

meta <- add_metadata(meta,
  species = c("Cod", "Capelin", "Shrimp"),
  gear = c("Trawl", "Longline")
)
}