Skip to contents

Check referential integrity across all corpus tables and report issues. Checks work, author, source and institution links, duplicate lookup IDs, and duplicate or orphan embedding row names. A locked corpus with a stored hash is also checked for changed content.

Usage

sm_validate(corpus, call = rlang::caller_env())

Arguments

corpus

An sm_corpus object.

call

Caller environment for error reporting.

Value

A tibble with table, issue and n_affected, or a 0-row tibble with the same columns if clean. Missing links count distinct unresolved IDs; duplicates count surplus rows.

Examples

corpus <- sm_example_corpus()
issues <- sm_validate(corpus)
nrow(issues)
#> [1] 0