
Validate relationships against available datasources and fields
Source:R/validators.R
validate_relationships.RdChecks that relationship endpoints reference known datasource tables and that
the predicate fields appear somewhere in the workbook (calculated, raw, or
parameter fields), using a lenient token match (e.g., INT([GEOID]) = GEOID).
Value
A list with:
- ok
TRUEif no issues;FALSEotherwise.- issues
A named list of tibbles. Possible elements:
unknown_tables: endpoints not found among known tables.unknown_fields: predicate fields not found in the field pool.
Examples
twb <- system.file("extdata", "test_for_wenjie.twb", package = "twbparser")
if (nzchar(twb) && file.exists(twb)) {
parser <- TwbParser$new(twb)
res <- validate_relationships(parser)
if (!res$ok) print(res$issues)
}
#> TWB loaded: test_for_wenjie.twb
#> TWB parsed and ready