Mechanism 3: Custom Dialect ($schema)

Mechanism 3: Custom Dialect ($schema)#

A dialect is a named bundle of vocabularies. Setting $schema to the FAIR dialect URI opts a schema into all registered FAIR vocabularies with a single declaration:

{
  "$schema": "https://highvaluedata.net/fair-data-schema/0.1.0",
  "$id": "https://example.org/schemas/my-dataset",
  ...
}

The dialect URI resolves to the composite meta-schema. We offer two main tracks:

  • Stable: https://highvaluedata.net/fair-data-schema/0.1.0

  • Development: https://highvaluedata.net/fair-data-schema/dev

These URIs serve the index.json file at their respective locations.

Specification#

Technical details about dialect identification and resolution are covered in the SPEC.md.

Schema authors can always replace this $schema URI with the standard Draft 2020-12 value to ensure maximum compatibility with any validator; the fair: keywords will simply be treated as ignored annotations.

How it works#

        graph LR
    S["Data schema\n$schema → FAIR dialect"] --> D["index.json\n(composite dialect)"]
    D --> V1["vocab/annotations\nmeta-schema.json"]
    D --> VN["vocab/... (future)\nmeta-schema.json"]
    D --> STD["JSON Schema 2020-12\nstandard meta-schema"]
    

Working Example File#

../../../examples/mechanism-3-dialect.json

{
    "$schema": "https://highvaluedata.net/fair-data-schema/dev",
    "$id": "https://example.org/schemas/mechanism-3-dialect",
    "title": "Mechanism 3: Custom Dialect ($schema) Example",
    "description": "Demonstrates opting into the full FAIR dialect with a single $schema declaration. All FAIR annotation keywords are now available and documented in the meta-schema at the dialect URI.",
    "type": "object",
    "required": [
        "id",
        "title",
        "variables"
    ],
    "properties": {
        "id": {
            "type": "string",
            "format": "uri",
            "title": "Dataset URI",
            "fair:concept": "https://www.dublincore.org/specifications/dublin-core/dcmi-terms/identifier",
            "fair:label": {
                "en": "Dataset Identifier"
            }
        },
        "title": {
            "type": "string",
            "title": "Dataset Title",
            "fair:label": {
                "en": "Title",
                "fr": "Titre"
            }
        },
        "publisher": {
            "type": "string",
            "format": "uri",
            "title": "Publisher URI",
            "fair:provider": "https://ror.org/02y3ad647"
        },
        "license": {
            "type": "string",
            "format": "uri",
            "fair:license": "https://creativecommons.org/licenses/by/4.0/"
        },
        "variables": {
            "type": "object",
            "title": "Variable Definitions",
            "description": "Map of variable names to their schemas. Each variable may carry full FAIR annotations.",
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "fair:concept": {
                        "type": "string"
                    },
                    "fair:label": {},
                    "fair:unit": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "$comment": "Notice the $schema field at the top. By pointing to the FAIR dialect URI rather than the standard 2020-12 URI, this schema document opts into all registered FAIR vocabularies. Changing back to 'https://json-schema.org/draft/2020-12/schema' still works — fair: keywords are simply ignored."
}