| prelabel | R Documentation |
Attach provisional semantic assertions to an observational vector.
prelabel(x, labels, unmatched = "keep", missing_label = "<NA>")
x |
A vector. |
labels |
Candidate semantic mappings describing provisional semantic assertions.
|
unmatched |
Behaviour for unmatched observational values. One of:
|
missing_label |
Semantic assertion used internally for missing observational values. |
prelabel() creates lightweight semantic mappings that support
iterative semantic refinement workflows before values mature
into formally defined variables created with
labelled::labelled() or dataset::defined().
Unlike strictly defined semantic vectors, prelabelled
vectors tolerate:
incomplete semantic mappings;
unresolved observational values;
contextual ambiguity;
incremental semantic stabilisation.
This design is particularly useful in provenance-aware, contextual reconstruction, and archival workflows where semantic interpretations emerge gradually through iterative refinement.
The class supports workflows inspired by RiC-O and PROV-O, where observational evidence and semantic interpretation remain explicitly separated.
prelabelled vectors intentionally separate:
observational evidence;
semantic operationalisation;
contextual semantic refinement.
Original observational values remain unchanged while semantic assertions may evolve through iterative refinement workflows.
Semantic operationalisation is available through:
as.character() for lightweight semantic coercion;
as_character() for provenance-preserving semantic
workspaces.
A vector with:
class "prelabelled";
attached provisional semantic vocabulary stored in the
"prelabel" attribute.
Lebo, T., Sahoo, S., McGuinness, D. et al. (2013). PROV-O: The PROV Ontology. https://www.w3.org/TR/prov-o/
International Council on Archives Expert Group on Archival Description (2023). Records in Contexts (RiC). https://www.ica.org/ica-network/expert-groups/egad/records-in-contexts-ric/
dataset::prelabel(),
dataset::defined(),
dataset::as_value_key()
x <- c("R", "png", "csv", "unknown")
extension_map <- c(
R = "functional_programming",
png = "visualisation",
csv = "tabular_data"
)
x <- prelabel(x, labels = extension_map)
x
as.character(x)
semantic_workspace <- as_character(x)
attributes(semantic_workspace)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.