Skip to contents

Features that may have been renamed between two versions. Features are matched by name, so a renamed feature looks like one removed and one added. This function pairs each removed feature with the added feature whose links to the kept features are most alike (Jaccard index of their typed neighbours), one to one (a maximum matching). With file, the pairs whose names are alike too (name_similarity >= name_threshold) are written to it, one old<tab>new per line, ready for vp_rename() (and for the command strong4vm diff --rename).

Usage

vp_rename_candidates(
  old,
  new,
  threshold = 0.5,
  file = NULL,
  name_threshold = 0.7
)

Arguments

old

The older version of a model (from vp_generate() or vp_read()).

new

The newer version of the same model.

threshold

The smallest similarity (of the links) to report.

file

A file to write the accepted renames to; NULL (the default) writes nothing.

name_threshold

The smallest name_similarity of a pair written to file.

Value

A tibble with old, new, similarity (of their links, 1 = the same) and name_similarity (of the names, 1 = equal), the most similar first.

Examples

old <- vp_generate(vp_example("miband3_planned.uvl"), or_graph = TRUE)
new <- vp_generate(vp_example("miband3_realized.uvl"), or_graph = TRUE)
vp_rename_candidates(old, new, threshold = 0.3)
#> # A tibble: 0 × 4
#> # ℹ 4 variables: old <chr>, new <chr>, similarity <dbl>, name_similarity <dbl>