
Add contextual identifiers to snapshot observations
add_snapshot_context.RdEnriches filesystem observations with deterministic contextual identifiers used for longitudinal, cross-storage, and forensic reconstruction workflows.
Arguments
- df
A snapshot
data.framecreated byscan_storage()orread_snapshot().
Details
The function preserves the original observational rows and adds contextual identifiers derived from:
storage context;
filesystem location;
observation time.
The package deliberately separates filesystem observation from later analytical interpretation and documentary aggregation.
The function therefore:
enriches filesystem observations with contextual identifiers;
supports repeated observation tracking across time;
supports comparison across storage systems;
does not construct Record Sets or higher-level documentary aggregations.
The added identifiers support:
reconstruction of distributed work environments;
provenance-aware analytical workflows;
longitudinal filesystem analysis;
cross-storage comparison of observations.
Added variables:
storage_full_path: globally contextualised filesystem locator (storage_id::full_path);storage_path_id: deterministic storage-scoped filesystem identifier (storage_id::rel_path);observation_id: deterministic identifier of a specific filesystem observation, combining storage context, relative path, and observation time.
Examples
data("fscontextdemo_snapshot_02")
snapshots <- add_snapshot_context(fscontextdemo_snapshot_02)
head(
snapshots[
,
c(
"storage_full_path",
"storage_path_id",
"observation_id"
)
]
)
#> storage_full_path
#> 1 fscontextdemo::D:/_packages/fscontextdemo/.github/.gitignore
#> 2 fscontextdemo::D:/_packages/fscontextdemo/.github/workflows/pkgdown.yaml
#> 3 fscontextdemo::D:/_packages/fscontextdemo/.gitignore
#> 4 fscontextdemo::D:/_packages/fscontextdemo/.Rbuildignore
#> 5 fscontextdemo::D:/_packages/fscontextdemo/data/fscontextdemo_snapshot_01.rda
#> 6 fscontextdemo::D:/_packages/fscontextdemo/data/fsdemo_country_data.rda
#> storage_path_id
#> 1 fscontextdemo::.github/.gitignore
#> 2 fscontextdemo::.github/workflows/pkgdown.yaml
#> 3 fscontextdemo::.gitignore
#> 4 fscontextdemo::.Rbuildignore
#> 5 fscontextdemo::data/fscontextdemo_snapshot_01.rda
#> 6 fscontextdemo::data/fsdemo_country_data.rda
#> observation_id
#> 1 fscontextdemo::.github/.gitignore::20260525-174640
#> 2 fscontextdemo::.github/workflows/pkgdown.yaml::20260525-174640
#> 3 fscontextdemo::.gitignore::20260525-174640
#> 4 fscontextdemo::.Rbuildignore::20260525-174640
#> 5 fscontextdemo::data/fscontextdemo_snapshot_01.rda::20260525-174640
#> 6 fscontextdemo::data/fsdemo_country_data.rda::20260525-174640