
Derive contextual Record Set membership
derive_record_set.RdDerive contextual Record Set membership from an observational universe using explicit contextual boundary declarations.
Usage
derive_record_set(
x,
contextual_groups,
observed_unit_var = "observed_unit",
include_subfolders = TRUE
)Arguments
- x
An observational universe, typically created with
scan_storage()orobserve_universe().- contextual_groups
A data frame containing:
- context
Identifier of the curatorial or analytical context.
- root
Observed boundary root used for contextual membership derivation.
- observed_unit_var
Name of the observational boundary variable. Defaults to
"observed_unit".- include_subfolders
Logical. If
TRUE(default), recursively include descendants of each contextual root.
Details
The function performs a curatorial aggregation step inspired by the "Records in Contexts" (RiC) conceptual model. It derives contextualized Record Set views over an observational universe by assigning observed records or instantiations to one or more meaningful analytical, operational, or curatorial contexts.
In this implementation, a context does not represent
a formally exhaustive or deterministic archival subset.
Instead, it represents a meaningful curatorial or
analytical perspective over observed records.
The same observed records may participate in multiple overlapping contexts simultaneously. This reflects the RiC move away from strict single-hierarchy archival description toward contextual, relational, and many-to-many representations of records.
Contextual membership is currently derived using recursive path-prefix inclusion heuristics based on declared contextual boundary roots.
This operation does not modify the original observational universe. It creates a contextual membership layer suitable for analytical, archival, provenance, or reporting workflows.
Examples
toy_universe <- tibble::tibble(
observed_unit = c(
"D:/projects/eviota",
"D:/projects/eviota/tests",
"D:/other"
),
inst_id = c("a", "b", "c")
)
toy_groups <- tibble::tibble(
context = "eviota",
root = "D:/projects/eviota"
)
derive_record_set(
toy_universe,
toy_groups
)
#> # A tibble: 2 × 7
#> observed_unit inst_id context context_root construction_method derived_by
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 D:/projects/eviota a eviota D:/projects… path_prefix derive_re…
#> 2 D:/projects/eviot… b eviota D:/projects… path_prefix derive_re…
#> # ℹ 1 more variable: derived_at <dttm>