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-level properties the GeoLocator-DP profile declares are checked against it. From GeoLocator-DP v1.0 the profile declares only
$schema, so this checks that$schemais a GeoLocator-DP profile URL. Earlier profiles also declare package metadata, checked for presence, type, format, enumerated values, regular-expression patterns, item counts, and numeric bounds. Neither the Data Package profile that GeoLocator-DP extends nor the profile's rules on resource descriptors (type,path,$schema,schema, at least three resources) are checked.Resource validation File-backed tables are loaded for field and foreign-key checks; source files are not modified. Resources are checked against their schema: columns must match the
fieldsMatchrule, and each column must satisfy its declared constraints such as type, requiredness, uniqueness, allowed values, patterns, and numeric or length limits. Rows must be unique on the schemaprimaryKey. Schema-declared foreign keys must resolve to rows of their parent resource, for all resources, core ones included. The tables GeoLocator-DP defines (tags,observations, ...) must be tabular resources with a table schema. Theparamsresource and custom resources are checked when they carry a table schema, and are otherwise reported as not checked.Coherence validation Cross-resource consistency checks are then applied.
Core package coherence checks require the resources
tags,observations, andmeasurements. A missingmeasurementsfails validation, but the checks that do not need it still run. They 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"(a missingdevice_statusfails);device_status"none"and"missing"are used only forcaptureobservations, and"unknown"only forsightingobservations;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;massabove 10,000 g is reported as a warning only, a guideline rather than a limit.
GeoPressure-specific coherence checks are applied when the corresponding resources are present. These include:
realistic ranges for
edges$n;duration checks for
stapsandedges;warnings for unusual
edgesdistances, durations, or wind/ground-speed magnitudes, forpressurepaths$altitudeoutside -200 to 10,000 m, forstaps$stap_idof 300 or more, forpaths$jof 500 or more, and for datetime fields instaps,twilights,pressurepaths, andedgesdated before 1990 or after the current year. These are guidelines, not limits.
Metadata recommendations Additional metadata quality checks are reported without affecting the final validity. These recommendations cover:
the
titleis prefixed by "GeoLocator Data Package: ", which the GeoLocator-DP Zenodo community expects;presence of contributor roles;
record_type == "dataset";expected manufacturer names in
tags$manufacturer: those GeoPressureR can import ("Swiss Ornithological Institute", "Migrate Technology Limited", "Lund University", "British Antarctic Survey", "PresTag");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
if (FALSE) { # \dontrun{
pkg <- read_zenodo("17367319", quiet = TRUE)
validate_gldp(pkg)
} # }
