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
creator, maintainer, funder, publisherAuthors@R roles aut/cre, cre, fnd, cph; ORCID from the comment field
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.

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()

Examples

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