validate_gldp() runs the full validation workflow for a GeoLocator Data Package.
It checks schema conformance, resource-level consistency, and cross-table coherence,
then reports additional metadata recommendations.
Value
An invisible logical value: TRUE when all profile, resource, and coherence checks
pass, FALSE otherwise. Metadata recommendations are always reported but do not affect this
return value.
Details
Validation runs in four steps:
Package profile validation The package metadata is checked against the GeoLocator-DP profile schema. This includes required package-level fields and schema-defined constraints such as type, format, uniqueness, enumerated values, regular-expression patterns, and minimum or maximum lengths, item counts, and numeric values.
Resource validation Resources are checked against their schema: columns must match the
fieldsMatchrule, and each column must satisfy its declared constraints such as type, format, requiredness, uniqueness, allowed values, patterns, and numeric or length limits.Coherence validation Cross-resource consistency checks are then applied.
Core package coherence checks require the resources
tags,observations, andmeasurements, and verify that:one
ring_numberis not associated with multiplescientific_namevalues intags;every
measurements$tag_idexists intags$tag_id;every
tags$ring_numberappears inobservations$ring_number;every
observationstag_id/ring_numbercombination exists intags;every tag declared in
tagshas at least one observation (reported as a warning only);every tag with measurement data has both an
equipmentand aretrievalobservation.
Observation-sequence checks verify that:
one
tag_idis not associated with multiplering_numbervalues;equipmentandretrievalobservations always have atag_id;equipmentandretrievalobservations havedevice_status == "present";captureobservations withdevice_status"missing"or"present"have atag_id;a second tag is not attached without a prior retrieval or
capturewithdevice_status == "missing";each
tag_idhas anequipmentobservation;retrieval does not precede equipment for the same
tag_id;duplicated observations are not present for the same
ring_number,datetime, andobservation_type;device_statustransitions are plausible across the observation history.
GeoPressure-specific coherence checks are applied when the corresponding resources are present. These include:
realistic ranges for
staps$stap_id,paths$j,edges$n, andpressurepaths$altitude;realistic year windows for datetime fields in
staps,twilights,pressurepaths, andedges;duration checks for
stapsandedges;schema-declared foreign key consistency across resources;
warnings for unusual
edgesdistances, durations, or wind/ground-speed magnitudes.
Metadata recommendations Additional metadata quality checks are reported without affecting the final validity. These recommendations cover:
the
titleis prefixed by "GeoLocator Data Package: ";presence of contributor roles;
record_type == "dataset";expected manufacturer names in
tags$manufacturer;presence of
relatedIdentifiers;presence of a selected GeoLocator-DP Zenodo community;
a GitHub repository URL in
codeRepository;scientific names in
pkg$taxonomicagainst the eBird taxonomy API when available.
See the GeoLocator-DP curation guide for more information.
Examples
pkg <- read_zenodo("17367319")
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ℹ Retrieve Zenodo record 17367319
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Retrieve Zenodo record 17367319 [662ms]
#>
#> ℹ Download files from Zenodo
#> Warning: Selecting ‘env’ backend. Secrets are stored in environment variables
#> ✔ Download files from Zenodo [2.2s]
#>
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Upgrading GeoLocator-DP from "main" to "v1.0".
#> ℹ Read and upgrade GeoLocator-DP
#> ✔ Read and upgrade GeoLocator-DP [506ms]
#>
#> ℹ Add metadata
#> ✔ Add metadata [86ms]
#>
validate_gldp(pkg)
#>
#> ── Check Profile
#>
#> ── Check Resources tags
#> ✔ Table tags is consistent with the schema.
#>
#> ── Check Resources observations
#> ✔ Table observations is consistent with the schema.
#>
#> ── Check Resources measurements
#> ✔ Table measurements is consistent with the schema.
#>
#> ── Check Resources staps
#> ✔ Table staps is consistent with the schema.
#>
#> ── Check Resources twilights
#> ✔ Table twilights is consistent with the schema.
#>
#> ── Check Resources paths
#> ✔ Table paths is consistent with the schema.
#>
#> ── Check Resources edges
#> ✔ Table edges is consistent with the schema.
#>
#> ── Check Resources pressurepaths
#> ✔ Table pressurepaths is consistent with the schema.
#>
#> ── Check Coherence
#> ✖ 1 value in pressurepaths$altitude must be > -200 and < 7000.
#> ✖ Coherence checks failed.
#>
#> ── Check Metadata
#> ✔ Metadata recommendations passed.
#>
#> ── Final: ──────────────────────────────────────────────────────────────────────
#> ✖ Package validation failed. Review messages above.
