Ensures structural requirements, adds a required column if missing,
runs validate_dictionary(), and reports measurement rows missing
term_iri. Also flags non-canonical Salmon ontology IRIs so source
boundaries stay explicit (smn under https://w3id.org/smn/, gcdfo
under https://w3id.org/gcdfo/salmon#). In non-strict mode
(require_iris = FALSE), semantic gaps emit warnings but do not fail
the overall call.
Usage
validate_semantics(
dict,
require_iris = FALSE,
entity_defaults = NULL,
vocab_priority = NULL
)Arguments
- dict
Dictionary tibble/data frame, a package directory, or a path to
column_dictionary.csv.- require_iris
Logical; if TRUE, require non-empty semantic fields (
term_iri,property_iri,entity_iri,unit_iri) for measurement rows.- entity_defaults
Deprecated and ignored. Previously reserved for future default entity mapping.
- vocab_priority
Deprecated and ignored. Previously reserved for future vocabulary ordering.
Value
A list with elements:
dict: normalized dictionary withrequiredcolumn.issues: tibble of structural issues (empty if none).missing_terms: tibble of measurement rows missingterm_iri.
Examples
dictionary <- system.file(
"extdata", "column_dictionary.csv", package = "metasalmon"
)
result <- validate_semantics(dictionary, require_iris = FALSE)
#> ✔ Dictionary validation passed
nrow(result$missing_terms)
#> [1] 0
