pkgdown/analytics.html

Skip to contents

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.

Usage

validate_gldp(pkg)

Arguments

pkg

A GeoLocator Data Package object to be validated.

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:

  1. 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.

  2. Resource validation Resources are checked against their schema: columns must match the fieldsMatch rule, and each column must satisfy its declared constraints such as type, format, requiredness, uniqueness, allowed values, patterns, and numeric or length limits.

  3. Coherence validation Cross-resource consistency checks are then applied.

    Core package coherence checks require the resources tags, observations, and measurements, and verify that:

    • one ring_number is not associated with multiple scientific_name values in tags;

    • every measurements$tag_id exists in tags$tag_id;

    • every tags$ring_number appears in observations$ring_number;

    • every observations tag_id / ring_number combination exists in tags;

    • every tag declared in tags has at least one observation (reported as a warning only);

    • every tag with measurement data has both an equipment and a retrieval observation.

    Observation-sequence checks verify that:

    • one tag_id is not associated with multiple ring_number values;

    • equipment and retrieval observations always have a tag_id;

    • equipment and retrieval observations have device_status == "present";

    • capture observations with device_status "missing" or "present" have a tag_id;

    • a second tag is not attached without a prior retrieval or capture with device_status == "missing";

    • each tag_id has an equipment observation;

    • retrieval does not precede equipment for the same tag_id;

    • duplicated observations are not present for the same ring_number, datetime, and observation_type;

    • device_status transitions 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, and pressurepaths$altitude;

    • realistic year windows for datetime fields in staps, twilights, pressurepaths, and edges;

    • duration checks for staps and edges;

    • schema-declared foreign key consistency across resources;

    • warnings for unusual edges distances, durations, or wind/ground-speed magnitudes.

  4. Metadata recommendations Additional metadata quality checks are reported without affecting the final validity. These recommendations cover:

    • the title is 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$taxonomic against 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.