{
    "$schema": "https://highvaluedata.net/fair-data-schema/dev",
    "$id": "https://example.org/schemas/mechanism-4-refinements",
    "title": "Mechanism 4: $defs Refinements Example",
    "description": "Demonstrates reusing shared keyword patterns from the FAIR refinements vocabulary via $ref. Instead of repeating annotation declarations on each property, we $ref shared definitions.",
    "type": "object",
    "required": [
        "id",
        "title",
        "population",
        "gdp",
        "region_code"
    ],
    "properties": {
        "id": {
            "$ref": "https://highvaluedata.net/fair-data-schema/dev/vocab/refinements#/$defs/FairUri",
            "title": "Record Identifier",
            "$comment": "FairUri enforces format:uri and adds fair:persistent:true annotation — both standard validation and FAIR annotation from a single $ref."
        },
        "title": {
            "type": "string",
            "title": "Record Title"
        },
        "population": {
            "type": "integer",
            "minimum": 0,
            "allOf": [
                {
                    "$ref": "https://highvaluedata.net/fair-data-schema/dev/vocab/refinements#/$defs/FairAnnotated"
                }
            ],
            "fair:concept": "https://www.wikidata.org/wiki/Q1203",
            "fair:unit": "person",
            "fair:label": {
                "en": "Population"
            },
            "$comment": "FairAnnotated mixin documents which fair: annotations are valid here. The actual annotation values are set inline."
        },
        "gdp": {
            "type": "number",
            "minimum": 0,
            "allOf": [
                {
                    "$ref": "https://highvaluedata.net/fair-data-schema/dev/vocab/refinements#/$defs/FairAnnotated"
                }
            ],
            "fair:concept": "https://www.wikidata.org/wiki/Q132821",
            "fair:unit": "USD",
            "fair:label": {
                "en": "Gross Domestic Product"
            }
        },
        "region_code": {
            "allOf": [
                {
                    "$ref": "https://highvaluedata.net/fair-data-schema/dev/vocab/refinements#/$defs/FairCodedValue"
                }
            ],
            "enum": [
                "DE",
                "FR",
                "IT",
                "ES",
                "PL"
            ],
            "fair:classification": [
                "https://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_NOM_DTL&StrNom=CL_AREA"
            ],
            "$comment": "FairCodedValue provides the SKOS concept annotation. The enum keyword (standard JSON Schema) restricts the allowed values."
        }
    },
    "$comment": "This schema uses $ref to import shared definitions from the refinements vocabulary meta-schema. The Python registry.py resolves those URIs to local files during development, while GitHub Pages resolves them in production."
}
