Skip to contents

For data validation, Validiraptor uses rulesets specified as JSON schemas. The rulesets are divided into topical and shared rules. Topical rules apply to a specific domain (e. g., a station report or a set of observation data), while shared rules lay down general specifications (date format, pattern for site codes etc.).

Linkage between topical and shared schema

Redefine shared rules only once, in the shared schema!

Example: The valid pattern for the SITE_CODE (a primary identifier for various topical data) is defined only once, in the shared schema, so that it has to be changed in one place only, should the pattern be updated.

The shared definitions are referred from the topical schema with the $id of the shared schema and the $ref keyword in the topical schema.
 {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://velociraptor.example/station",
    "type": "object",
        "properties": {
            "SITE_CODE" : {"$ref": "shared#/definitions/SITE_CODE"},
            "STYPE" : {
                "description" : "spatial type; specified elsewhere",
                "type" : "string", "enum" : ["PT", "AREA", "VLN", "HLN"]
            },
    ...
}
A topical schema looks up the SITE_CODE in the shared schema.

Note that the URL-part of the URI (viz. https://velociraptor.example of https://velociraptor.example/station) does not resolve into an existing web domain. Its sole function is to constitute a common parent with the shared schema’s $id (https://velociraptor.example/shared).

schema location

All schemas are stored in, and read from, JSON text files named ‘.json’. These are stored in the folder schemas at https://github.com/eLTER-RI/validiraptor_schemas.

A snapshot of the schemas (as of 2024-03-19) is included in the schemas subfolder of this app’s www static asset folder. These are not read by the app, and may be outdated at the time of reading.