Skip to contents

Retrieves the parts of an OSF project that are not files – its wiki pages, its activity log, and its descriptive metadata – and writes them into an _osf_metadata folder inside download_to. Called by osf_file_download() when metadata = TRUE, and usable on its own.

Usage

.osf_metadata_download(osf_id, download_to, pb = NULL)

Arguments

osf_id

an OSF node ID

download_to

the project's download folder; the metadata folder is created inside it

pb

a progress bar passed from another function

Value

the path to the metadata folder, invisibly

Details

A project is often a record as much as a store: the wiki may hold the protocol or the interpretation of the results, and the activity log is the only account of when things changed. An archive of the files alone loses that.

Each thing is written in the form it actually takes:

  • wiki_<name>.md – one file per wiki page. The OSF serves wikis as Markdown, so headings and lists survive. Only the current version is downloaded.

  • logs.csv – the activity log, one row per entry. Nested fields are left to metadata.json.

  • metadata.json – title, description, tags, licence, contributors with ORCIDs, dates, citation, registrations and forks, as the API returned them.

  • README.md – a readable summary of all of the above.

Every project gets the same four kinds of file, whether or not it has anything to put in them, so a folder's structure never depends on what the project happened to contain.