Skip to contents

invert_contextual_grouping() transforms lightweight contextual grouping definitions into a two-column table of group membership.

This is useful when contextual roots, resources, or candidate Record Set members are first declared as a named list but later need to be used in joins, rulebooks, or reconstruction workflows.

Usage

invert_contextual_grouping(x)

Arguments

x

A named list. Each list name identifies a contextual group, and each list element contains one or more members of that group.

Value

A tibble with two columns:

group

Contextual grouping identifier.

member

Member associated with the contextual group.

Details

Convert a named list of contextual groupings into a long-form relational table.

The function performs a lightweight structural transformation.

It does not validate ontology semantics, enforce uniqueness, construct graph objects, or infer hierarchical relations.

The result is suitable for relational operations such as joins, filtering, contextual reconstruction, and candidate Record Set membership workflows.

Examples

record_sets <- list(
  conceptualisation = c(
    "D:/_packages/alpha",
    "D:/_markdown/alpha-methodology"
  ),
  beta = c(
    "D:/_packages/beta",
    "D:/_packages/prebeta"
  )
)

invert_contextual_grouping(record_sets)
#> # A tibble: 4 × 2
#>   group             member                        
#>   <chr>             <chr>                         
#> 1 conceptualisation D:/_packages/alpha            
#> 2 conceptualisation D:/_markdown/alpha-methodology
#> 3 beta              D:/_packages/beta             
#> 4 beta              D:/_packages/prebeta