diff --git a/DESCRIPTION b/DESCRIPTION index 4146c8d..b15c9b8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,10 +27,10 @@ Imports: corella, curl, dplyr, - elm, glue, httr2, jsonlite, + paperbark, potions, purrr, readr, @@ -45,6 +45,9 @@ Suggests: rmarkdown, testthat (>= 3.0.0), xml2 +Remotes: + AtlasOfLivingAustralia/corella + AtlasOfLivingAustralia/paperbark License: MPL-2.0 URL: https://galaxias.ala.org.au BugReports: https://github.com/AtlasOfLivingAustralia/galaxias/issues diff --git a/NAMESPACE b/NAMESPACE index 440613d..179d69f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -28,11 +28,6 @@ importFrom(dplyr,mutate) importFrom(dplyr,pull) importFrom(dplyr,select) importFrom(dplyr,slice_head) -importFrom(elm,add_eml_header) -importFrom(elm,check_eml) -importFrom(elm,read_md) -importFrom(elm,use_metadata) -importFrom(elm,write_eml) importFrom(glue,glue) importFrom(glue,glue_collapse) importFrom(httr2,req_body_multipart) @@ -43,6 +38,10 @@ importFrom(httr2,request) importFrom(httr2,resp_body_json) importFrom(jsonlite,toJSON) importFrom(jsonlite,unbox) +importFrom(paperbark,check_eml) +importFrom(paperbark,read_md) +importFrom(paperbark,use_metadata) +importFrom(paperbark,write_eml) importFrom(potions,brew) importFrom(potions,pour) importFrom(purrr,map) diff --git a/R/build_archive.R b/R/build_archive.R index db94b28..97018ca 100644 --- a/R/build_archive.R +++ b/R/build_archive.R @@ -16,8 +16,8 @@ #' altered to use Darwin Core terms as column headers. See the `corella` #' package for details. #' * A metadata statement, stored in xml using the filename `eml.xml`. The -#' function `use_metadata()` from the `elm` package is a good starting point -#' here, followed by `build_metadata()` to save it in xml. +#' function `use_metadata()` from the `paperbark` package is a good starting +#' point here, followed by `build_metadata()` to save it in xml. #' * A 'schema' document, also stored in xml, called `meta.xml`. This is #' usually constructed using `build_schema()`. #' @@ -135,7 +135,7 @@ find_data <- function(directory, if(!file.exists(glue("{directory}/eml.xml"))){ bullets <- c("No metadata statement ({.file eml.xml}) is present in the specified directory.", - i = "See `elm::use_metadata()` for an example metadata statement.", + i = "See `paperbark::use_metadata()` for an example metadata statement.", i = "Use `build_metadata()` to convert to {.file eml.xml}.") cli_abort(bullets, call = call) diff --git a/R/build_metadata.R b/R/build_metadata.R index 3b8d5a4..0a436bf 100644 --- a/R/build_metadata.R +++ b/R/build_metadata.R @@ -6,7 +6,7 @@ #' specified using the `directory` argument. #' #' This function is a fairly shallow wrapper on top of functionality build -#' in the `elm` package, particularly `read_md()` and `write_eml()`. You can +#' in the `paperbark` package, particularly `read_md()` and `write_eml()`. You can #' use that package to gain greater control, or to debug problems, should you #' wish. #' @param path Path to a metadata statement stored in markdown format (.md). @@ -14,9 +14,8 @@ #' `data/eml.xml`. #' @returns Does not return an object to the workspace; called for the side #' effect of building a file named `meta.xml` in the `data` directory. -#' @importFrom elm add_eml_header -#' @importFrom elm read_md -#' @importFrom elm write_eml +#' @importFrom paperbark read_md +#' @importFrom paperbark write_eml #' @export build_metadata <- function(x = "data", file = "./data/eml.xml"){ @@ -26,13 +25,10 @@ build_metadata <- function(x = "data", # import file, ensure EML metadata is added, convert to XML progress_update("Reading file...") metadata_file <- read_md(x) - - progress_update("Building xml components...") - built_file <- add_eml_header(metadata_file) - + progress_update("Writing file...") write_eml(built_file, file = file) cli::cli_alert_success("Metadata successfully built. Saved as {.file /data/eml.xml}.") cli::cli_progress_done() -} \ No newline at end of file +} diff --git a/R/build_schema.R b/R/build_schema.R index 262f0a6..a87c3aa 100644 --- a/R/build_schema.R +++ b/R/build_schema.R @@ -9,7 +9,7 @@ #' @param file (string) A file name for the resulting schema document. #' @returns Does not return an object to the workspace; called for the side #' effect of building a file named `meta.xml` in the specified directory. -#' @importFrom elm write_eml +#' @importFrom paperbark write_eml #' @importFrom glue glue #' @importFrom rlang abort #' @export @@ -231,4 +231,4 @@ add_front_matter <- function(df){ ) ) bind_rows(front_row, df) -} \ No newline at end of file +} diff --git a/R/check_archive.R b/R/check_archive.R index 4595e62..09a4620 100644 --- a/R/check_archive.R +++ b/R/check_archive.R @@ -1,7 +1,7 @@ #' Check an archive against Darwin Core standards #' #' This is a wrapper to two other packages; schema and EML files (i.e. xml) are -#' checked with the `elm` package; csv files are checked with the `corella` +#' checked with the `paperbark` package; csv files are checked with the `corella` #' package. #' @param x (string) A directory containing the files to be published, or #' optionally a `.zip` file built from the same (i.e. with `build_archive()`). @@ -27,7 +27,7 @@ check_archive <- function(x = "data"){ #' Internal function to check all files #' @importFrom corella check_occurrences -#' @importFrom elm check_eml +#' @importFrom paperbark check_eml #' @importFrom purrr map #' @importFrom readr read_csv #' @noRd diff --git a/R/galaxias-package.R b/R/galaxias-package.R index a7308ac..93d32e5 100644 --- a/R/galaxias-package.R +++ b/R/galaxias-package.R @@ -23,7 +23,7 @@ #' * [build_archive()] Convert a directory to a Darwin Core Archive #' #' **Validate an archive** -#' * [check_archive()] Check your archive using the `elm` and `corella` packages +#' * [check_archive()] Check your archive using the `paperbark` and `corella` packages #' * [galaxias_config()] Store credentials for your API call #' * [validate_archive()] Check your archive using the GBIF 'validator' API #' * [print_validation()] Methods for displaying API responses diff --git a/R/galaxias_project.R b/R/galaxias_project.R index d53672a..642d5e4 100644 --- a/R/galaxias_project.R +++ b/R/galaxias_project.R @@ -12,7 +12,7 @@ #' side-effect of building a new project or package. #' @name galaxias_project #' @order 1 -#' @importFrom elm use_metadata +#' @importFrom paperbark use_metadata #' @importFrom usethis create_project #' @importFrom usethis use_directory #' @export @@ -33,4 +33,4 @@ galaxias_package <- function(path, ...){ create_package(path, ...) use_directory("data_raw") use_directory("data") -} \ No newline at end of file +} diff --git a/README.Rmd b/README.Rmd index 13e6005..cc307eb 100644 --- a/README.Rmd +++ b/README.Rmd @@ -62,8 +62,8 @@ library(galaxias) `galaxias` is part of a group of packages that help users publish data using the Darwin Core standard. The other packages are: - - [`corella`](https://github.com/AtlasOfLivingAustralia/corella) for converting tibbles to the required column names - - [`elm`](https://github.com/AtlasOfLivingAustralia/elm) for converting markdown files to `xml`. + - [`corella`](https://corella.ala.org.au) for converting tibbles to the required column names + - [`paperbark`](https://paperbark.ala.org.au) for converting markdown files to `xml`. ## Citing galaxias diff --git a/README.md b/README.md index 1b190a5..e21baa9 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,10 @@ library(galaxias) `galaxias` is part of a group of packages that help users publish data using the Darwin Core standard. The other packages are: -- [`corella`](https://github.com/AtlasOfLivingAustralia/corella) for - converting tibbles to the required column names -- [`elm`](https://github.com/AtlasOfLivingAustralia/elm) for converting - markdown files to `xml`. +- [`corella`](https://corella.ala.org.au) for converting tibbles to the + required column names +- [`paperbark`](https://paperbark.ala.org.au) for converting markdown + files to `xml`. ## Citing galaxias diff --git a/man/build_archive.Rd b/man/build_archive.Rd index 9ebc7f6..f8aa0c6 100644 --- a/man/build_archive.Rd +++ b/man/build_archive.Rd @@ -35,8 +35,8 @@ These will be manipulated versions of the raw dataset, which have been altered to use Darwin Core terms as column headers. See the \code{corella} package for details. \item A metadata statement, stored in xml using the filename \code{eml.xml}. The -function \code{use_metadata()} from the \code{elm} package is a good starting point -here, followed by \code{build_metadata()} to save it in xml. +function \code{use_metadata()} from the \code{paperbark} package is a good starting +point here, followed by \code{build_metadata()} to save it in xml. \item A 'schema' document, also stored in xml, called \code{meta.xml}. This is usually constructed using \code{build_schema()}. } diff --git a/man/build_metadata.Rd b/man/build_metadata.Rd index ff89339..cb6b96d 100644 --- a/man/build_metadata.Rd +++ b/man/build_metadata.Rd @@ -24,7 +24,7 @@ specified using the \code{directory} argument. } \details{ This function is a fairly shallow wrapper on top of functionality build -in the \code{elm} package, particularly \code{read_md()} and \code{write_eml()}. You can +in the \code{paperbark} package, particularly \code{read_md()} and \code{write_eml()}. You can use that package to gain greater control, or to debug problems, should you wish. } diff --git a/man/check_archive.Rd b/man/check_archive.Rd index d9d5f04..a54b366 100644 --- a/man/check_archive.Rd +++ b/man/check_archive.Rd @@ -18,7 +18,7 @@ the console. } \description{ This is a wrapper to two other packages; schema and EML files (i.e. xml) are -checked with the \code{elm} package; csv files are checked with the \code{corella} +checked with the \code{paperbark} package; csv files are checked with the \code{corella} package. } \seealso{ diff --git a/man/galaxias-package.Rd b/man/galaxias-package.Rd index 0e0bfd6..dc4ef44 100644 --- a/man/galaxias-package.Rd +++ b/man/galaxias-package.Rd @@ -32,7 +32,7 @@ If you have any questions, comments or suggestions, please email \strong{Validate an archive} \itemize{ -\item \code{\link[=check_archive]{check_archive()}} Check your archive using the \code{elm} and \code{corella} packages +\item \code{\link[=check_archive]{check_archive()}} Check your archive using the \code{paperbark} and \code{corella} packages \item \code{\link[=galaxias_config]{galaxias_config()}} Store credentials for your API call \item \code{\link[=validate_archive]{validate_archive()}} Check your archive using the GBIF 'validator' API \item \code{\link[=print_validation]{print_validation()}} Methods for displaying API responses @@ -41,6 +41,7 @@ If you have any questions, comments or suggestions, please email \seealso{ Useful links: \itemize{ + \item \url{https://galaxias.ala.org.au} \item Report bugs at \url{https://github.com/AtlasOfLivingAustralia/galaxias/issues} } diff --git a/vignettes/quick_start_guide.Rmd b/vignettes/quick_start_guide.Rmd index 518b4b6..55c781c 100644 --- a/vignettes/quick_start_guide.Rmd +++ b/vignettes/quick_start_guide.Rmd @@ -121,7 +121,7 @@ in the data folder and remove your `data-raw` folder. Darwin Core Archives use `xml` files to store two metadata files; one that describes your data and ownership, and a second that stores its' structure. -We recommend using the `elm` package to manipulate these files. +We recommend using the `paperbark` package to manipulate these files. `build_schema()` example