Skip to contents

[Experimental]

update_metadata() derives a schema.org Dataset description from the canonical sources of the package and writes it as a JSON-LD block into the head of every pkgdown page, where dataset search engines read it. Nothing is hand edited: to change a value, change its source and run the function again. Running it twice produces no change. It ends by listing the fields it could not fill and where to fill them.

The sources are:

FieldSource
name, description, version, datePublished, licenseTitle, Description, Version, Date, License in DESCRIPTION
urlthe pkgdown site (a github.io entry in URL), else the repository
keywordsX-schema.org-keywords in DESCRIPTION, comma separated
spatialCoverage, temporalCoverageX-schema.org-spatialCoverage and X-schema.org-temporalCoverage in DESCRIPTION
isBasedOnthe source article DOIs in X-schema.org-isBasedOn in DESCRIPTION, comma separated
creator, maintainer, funder, publisherAuthors@R roles aut/cre, cre, fnd, cph; ORCID from the comment field. Without a cph, the publisher is the organisation with the website in Config/washr/home
includedInDataCatalogthe data catalogue of the organisation in Config/washr/catalog
identifier, sameAsthe DOI in CITATION.cff, written by update_citation()
variableMeasureddata-raw/dictionary.csv
distributionevery file in inst/extdata that belongs to a dataset, one entry per file

The JSON-LD lands in pkgdown/templates/in-header.html, which pkgdown picks up on the next site build. The file also keeps the in_header includes from _pkgdown.yml working. It is not shipped in the package tarball.

Usage

update_metadata(quiet = FALSE)

Arguments

quiet

Logical. Suppress the messages and the report of blank fields. Defaults to FALSE, or to TRUE when options(washr.quiet = TRUE) is set.

Value

The Dataset description as a list, invisibly. The "blank" attribute names the fields that could not be filled and says where to fill them.

See also

Before: update_description(), which writes the DESCRIPTION fields this reads. Next: setup_readme(). The DOI comes from update_citation().

Other metadata functions: update_citation(), update_description(), update_zenodo_json()

Examples

if (FALSE) { # \dontrun{
update_metadata()
} # }