Skip to content

Commit 6b60f24

Browse files
committed
0.1.9 documentation
1 parent 112b4f9 commit 6b60f24

49 files changed

Lines changed: 1046 additions & 1352 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Package: fscontext
22
Title: Filesystem Contextualisation and Record Set Reconstruction
3-
Version: 0.2.0
3+
Version: 0.1.9
44
Language: en-GB
55
Authors@R:
6-
person(given = "Daniel", family = "Antal",
6+
person(given = "Daniel",
7+
family = "Antal",
78
email = "daniel.antal@dataobservatory.eu",
89
role = c("aut", "cre"),
910
comment = c(ORCID = "0000-0001-7513-6760"))

NAMESPACE

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(add_snapshot_context)
4-
export(add_structural_groups)
54
export(as_character)
65
export(as_recordset_df)
76
export(as_value_key)
@@ -11,44 +10,31 @@ export(construct_structural_paths)
1110
export(context_roots)
1211
export(coverage_roots)
1312
export(coverage_rules_path)
14-
export(create_github_commit_journal)
15-
export(create_journal)
16-
export(create_observation_set)
1713
export(create_record_set)
18-
export(derive_record_set)
19-
export(derive_reuse_metrics)
2014
export(derive_structural_groups)
2115
export(detect_generated_artifacts)
2216
export(exclude_operational_noise)
23-
export(find_repo_root)
24-
export(get_git_branch)
25-
export(get_git_remote)
2617
export(invert_contextual_grouping)
2718
export(invert_value_key)
2819
export(is.prelabelled)
29-
export(normalise_snapshot_schema)
3020
export(observe_universe)
31-
export(path_prefix)
3221
export(prelabel)
33-
export(project_record_events)
3422
export(quick_signature)
3523
export(read_snapshot)
3624
export(recordset_df)
3725
export(refine)
3826
export(refine_by_rulebook)
3927
export(save_scan)
4028
export(scan_storage)
41-
export(semantic_stabilisation)
4229
export(semantic_stabilization)
4330
export(snapshot_storage)
4431
export(snapshot_to_reconstruction_context)
4532
export(snapshot_to_recordset_df)
46-
export(strip_storage_prefix)
4733
export(subset_snapshot)
48-
export(summarise_activity)
4934
export(summarise_duplicates)
50-
export(summarize_activity)
35+
export(summarise_observed_activity)
5136
export(summarize_duplicates)
37+
export(summarize_observed_activity)
5238
importFrom(dataset,"provenance<-")
5339
importFrom(dataset,as_character)
5440
importFrom(dataset,as_value_key)
@@ -63,14 +49,12 @@ importFrom(dataset,subject_create)
6349
importFrom(digest,digest)
6450
importFrom(dplyr,across)
6551
importFrom(dplyr,all_of)
66-
importFrom(dplyr,any_of)
6752
importFrom(dplyr,arrange)
6853
importFrom(dplyr,bind_cols)
6954
importFrom(dplyr,bind_rows)
7055
importFrom(dplyr,case_when)
7156
importFrom(dplyr,cross_join)
7257
importFrom(dplyr,desc)
73-
importFrom(dplyr,distinct)
7458
importFrom(dplyr,filter)
7559
importFrom(dplyr,group_by)
7660
importFrom(dplyr,group_split)
@@ -83,17 +67,14 @@ importFrom(dplyr,relocate)
8367
importFrom(dplyr,row_number)
8468
importFrom(dplyr,select)
8569
importFrom(dplyr,semi_join)
70+
importFrom(dplyr,slice_head)
8671
importFrom(dplyr,summarise)
8772
importFrom(fs,dir_create)
8873
importFrom(fs,dir_exists)
8974
importFrom(fs,file_info)
9075
importFrom(glue,glue)
9176
importFrom(here,here)
9277
importFrom(labelled,labelled)
93-
importFrom(lubridate,day)
94-
importFrom(lubridate,month)
95-
importFrom(lubridate,year)
96-
importFrom(lubridate,ymd_hms)
9778
importFrom(magrittr,"%>%")
9879
importFrom(purrr,imap_dfr)
9980
importFrom(purrr,map)
@@ -102,7 +83,6 @@ importFrom(purrr,map_chr)
10283
importFrom(purrr,map_dfr)
10384
importFrom(purrr,map_int)
10485
importFrom(purrr,map_lgl)
105-
importFrom(purrr,pmap_dfr)
10686
importFrom(purrr,reduce)
10787
importFrom(rlang,":=")
10888
importFrom(rlang,.data)
@@ -112,12 +92,9 @@ importFrom(stats,setNames)
11292
importFrom(stringr,fixed)
11393
importFrom(stringr,str_detect)
11494
importFrom(stringr,str_ends)
115-
importFrom(stringr,str_replace)
116-
importFrom(stringr,str_replace_all)
11795
importFrom(stringr,str_starts)
11896
importFrom(tibble,as_tibble)
11997
importFrom(tibble,tibble)
120-
importFrom(tidyr,pivot_longer)
12198
importFrom(tidyr,pivot_wider)
12299
importFrom(tidyr,unnest)
123100
importFrom(tools,file_ext)

R/add_structural_groups.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#' @seealso [derive_structural_groups()]
5656
#'
5757
#' @importFrom dplyr bind_cols
58-
#' @export
58+
#' @keywords internal
5959

6060
add_structural_groups <- function(df) {
6161
if (!"rel_path" %in% names(df)) {

R/as_value_key.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#' - semantic stabilisation;
1010
#' - lightweight semantic harmonisation.
1111
#'
12+
#' @details
13+
#'
1214
#' `as_value_key()` standardizes:
1315
#'
1416
#' - named vectors;

R/classify_operational_file_type.R

Lines changed: 62 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,77 @@
1-
#' Classify operational file types from observed resources
1+
#' Classify operational file types
22
#'
3-
#' @description
4-
#' Classifies observed digital resources into operational file types
5-
#' using workflow-oriented classification profiles.
6-
#'
7-
#' Unlike simple MIME-type or extension lookups, the function is
8-
#' designed for provenance-aware analytical and reconstruction
9-
#' workflows where file meaning depends on operational context.
10-
#'
11-
#' The function supports lightweight operational classification for:
12-
#'
13-
#' - filesystem reconstruction;
14-
#' - digital preservation review;
15-
#' - repository analytics;
16-
#' - synchronized workspace inspection;
17-
#' - web archive inventories;
18-
#' - and Heritage Digital Twin workflows.
19-
#'
20-
#' The current implementation provides a small set of built-in
21-
#' profiles intended as operational starting points.
22-
#'
23-
#' These profiles are intentionally lightweight and extensible.
24-
#'
25-
#' Future versions may support:
26-
#'
27-
#' - user-defined profiles;
28-
#' - YAML-based vocabularies;
29-
#' - institutional review profiles;
30-
#' - preservation-oriented classification schemes;
31-
#' - workflow-specific semantic enrichment.
32-
#'
33-
#' The function is designed to work together with:
34-
#'
35-
#' - [read_snapshot()]
36-
#' - [snapshot_to_reconstruction_context()]
37-
#' - [create_record_set()]
38-
#'
39-
#' as part of layered provenance-aware reconstruction workflows.
3+
#' Classify observed resources into operational categories that support
4+
#' contextual reconstruction and Record Set derivation.
405
#'
41-
#' @param x A `data.frame` or tibble containing observed resources.
42-
#'
43-
#' @param extension Character scalar identifying the column containing
44-
#' file extensions.
45-
#'
46-
#' Defaults to `"extension"`.
47-
#'
48-
#' @param profile Character scalar defining the operational
49-
#' classification profile.
50-
#'
51-
#' Current built-in profiles include:
52-
#'
53-
#' - `"r_development"`
54-
#'
55-
#' The `"r_development"` profile is designed for:
56-
#'
57-
#' - R package development;
58-
#' - Quarto and R Markdown workflows;
59-
#' - reproducible research repositories;
60-
#' - analytical reporting pipelines.
61-
#'
62-
#' @return
63-
#' A character vector containing operational file type
64-
#' classifications.
6+
#' @description
7+
#' `classify_operational_file_type()` assigns observed files to
8+
#' broad operational categories such as code, data, documents,
9+
#' generated website files, and other artefacts.
6510
#'
66-
#' Typical output categories include:
11+
#' The current implementation provides an `"r_development"` profile
12+
#' derived from software development, reproducible research,
13+
#' and analytical repository workflows.
6714
#'
68-
#' - `"code"`
69-
#' - `"markdown"`
70-
#' - `"workspace"`
71-
#' - `"data"`
72-
#' - `"artifact"`
73-
#' - `"document"`
74-
#' - `"website_generated"`
75-
#' - `"other"`
15+
#' The broader objective of operational classification is to
16+
#' introduce an intermediate semantic layer between filesystem
17+
#' observations and contextual reconstruction.
7618
#'
7719
#' @details
78-
#' The function intentionally performs lightweight operational
79-
#' classification only.
20+
#' In many digital collections, archives, and research
21+
#' environments, files participate in operational roles that
22+
#' cannot be inferred from directory structure alone. Examples
23+
#' include source materials, preservation masters, derivative
24+
#' artefacts, metadata records, rights documentation, analytical
25+
#' outputs, and publication-ready resources.
26+
#'
27+
#' Operational classification provides a lightweight mechanism
28+
#' for assigning observed resources to such workflow-oriented
29+
#' categories before higher-level contextualisation, Record Set
30+
#' construction, or semantic stabilisation takes place.
31+
#'
32+
#' Classification is currently based on extension patterns and
33+
#' workflow-specific heuristics. The function does not inspect
34+
#' file contents, infer authoritative media types, determine
35+
#' archival significance, or perform provenance reasoning.
36+
#'
37+
#' The resulting classifications should therefore be interpreted
38+
#' as operational hypotheses that support exploration,
39+
#' reconstruction, and contextualisation workflows rather than
40+
#' authoritative documentary assertions.
41+
#'
42+
#' Future classification profiles may support archival,
43+
#' audiovisual, heritage, research-data, and Records in Contexts
44+
#' workflows, where operational roles provide an important bridge
45+
#' between low-level filesystem observations and higher-level
46+
#' documentary interpretation.
47+
#'
48+
#' @param x A `data.frame` or tibble containing observed files.
49+
#'
50+
#' @param extension Character scalar identifying the column that
51+
#' contains file extensions. Defaults to `"extension"`.
52+
#'
53+
#' @param profile Character scalar defining the classification
54+
#' profile. Currently only `"r_development"` is implemented.
8055
#'
81-
#' It does not:
56+
#' @return
57+
#' A character vector of operational file type labels.
8258
#'
83-
#' - infer authoritative media types;
84-
#' - inspect file contents;
85-
#' - perform preservation risk assessment;
86-
#' - infer documentary semantics;
87-
#' - replace curatorial review.
59+
#' Possible values for the `"r_development"` profile include:
8860
#'
89-
#' Classification is based primarily on operational workflow
90-
#' heuristics derived from file extensions and workflow profiles.
61+
#' \describe{
62+
#' \item{code}{R source files.}
63+
#' \item{markdown}{Markdown, R Markdown, or Quarto files.}
64+
#' \item{workspace}{R workspace or serialized R objects.}
65+
#' \item{data}{Tabular spreadsheet or delimited data files.}
66+
#' \item{artifact}{Image artefacts.}
67+
#' \item{document}{PDF or word-processing documents.}
68+
#' \item{website_generated}{Generated website assets.}
69+
#' \item{other}{Files not matched by the selected profile.}
70+
#' }
9171
#'
9272
#' @examples
9373
#' toy_files <- tibble::tibble(
94-
#' extension = c(
95-
#' "R",
96-
#' "qmd",
97-
#' "csv",
98-
#' "png",
99-
#' "woff2"
100-
#' )
74+
#' extension = c("R", "qmd", "csv", "png", "woff2")
10175
#' )
10276
#'
10377
#' classify_operational_file_type(

0 commit comments

Comments
 (0)