Skip to contents

Reads a package from disk, checks that metadata/data files stay aligned, verifies coded values against codes.csv when present, and then runs validate_dictionary() plus validate_semantics(). This is the quickest pre-flight check before sharing a package-first submission.

Usage

validate_salmon_datapackage(path, require_iris = FALSE)

Arguments

path

Character; directory containing the Salmon Data Package.

require_iris

Logical; if TRUE, require non-empty semantic IRIs for measurement fields (term_iri, property_iri, entity_iri, and unit_iri).

Value

Invisibly returns a list with components:

Examples

# \donttest{
# `path` is explicit: without it `create_sdp()` writes `<dataset_id>-sdp/`
# into the working directory, which an example must never do.
pkg_path <- create_sdp(
  mtcars,
  path = file.path(tempdir(), "demo-1-sdp"),
  dataset_id = "demo-1",
  table_id = "counts",
  overwrite = TRUE
)
#>  Seeding semantic suggestions from online vocabularies. This may take a few minutes for wider tables. Code-level semantic suggestions are limited to factor and low-cardinality character columns for this first pass. Use `seed_semantics = FALSE` for the fastest first pass.
#>  Seeding semantic suggestions during infer_salmon_datapackage_artifacts().
#> Warning: Vocabulary lookup was incomplete: "gbif" and "worms" did not answer.
#>  Treat an empty or short result as unknown rather than as an ontology gap.
#>  See `attr(result, "diagnostics")` for per-source detail.
#> Semantic suggestions stored in attr('semantic_suggestions') for downstream
#> review.
#>  Dictionary validation passed
#>  Created Salmon Data Package at /var/folders/pm/twz8_z1j6_zb996w0b17bz2r0000gn/T//RtmpC4skYL/demo-1-sdp
#> Created review-ready one-shot package with `create_sdp()`.
#>  Prefilled semantic values were written directly into the metadata CSVs only
#>   where target fields were blank. Compatible table observation-unit drafts can
#>   be auto-applied using observation-unit/description first and otherwise table
#>   label/id fallback. Any "REVIEW:" entries already live in the metadata CSVs
#>   and must be confirmed or edited there.
#>  Open README-review.txt, then review metadata/column_dictionary.csv and
#>   metadata/tables.csv in Excel first. Use semantic_suggestions.csv only if you
#>   want more context or a better match.
#>  Next: replace placeholders, remove any "REVIEW:" markers once final, rebuild
#>   EDH XML if needed, then run `validate_salmon_datapackage(pkg_path,
#>   require_iris = TRUE)`.
validate_salmon_datapackage(pkg_path, require_iris = FALSE)
#>  Loaded Salmon Data Package from /var/folders/pm/twz8_z1j6_zb996w0b17bz2r0000gn/T//RtmpC4skYL/demo-1-sdp
#> Warning: 8 metadata fields still hold a placeholder.
#>  column_dictionary.csv$column_description, dataset.csv$contact_email,
#>   dataset.csv$contact_name, dataset.csv$creator, dataset.csv$description,
#>   dataset.csv$license
#>  Replace them before publication; `require_iris = TRUE` reports these as
#>   errors.
#>  Dictionary validation passed
#>  Dictionary validation passed
#>  Salmon Data Package validation passed
# }