Learn R Programming

dataset (version 0.4.1)

provenance: Get or update provenance information

Description

Retrieve or append provenance statements (in N‑Triples form) stored on a dataset_df() object.

Usage

provenance(x)

provenance(x) <- value

Value

  • provenance(x) returns the contents of the "prov" attribute (character vector of N‑Triples), or NULL if none is set.

  • provenance(x) <- value appends value to the "prov" attribute and returns the modified dataset invisibly.

Arguments

x

A dataset created with dataset_df().

value

Character vector of N‑Triples created by n_triple() or n_triples() to append to existing provenance.

Details

Provenance is stored in the "prov" attribute as N‑Triples text. Use n_triple() or n_triples() to construct valid statements that follow PROV‑O (e.g., prov:wasGeneratedBy, prov:wasInformedBy).

Examples

Run this code
provenance(orange_df)

# Add a provenance statement:
provenance(orange_df) <- n_triple(
  "https://doi.org/10.5281/zenodo.10396807",
  "http://www.w3.org/ns/prov#wasInformedBy",
  "http://example.com/source#1"
)

Run the code above in your browser using DataLab