{
  "$schema": "https://highvaluedata.net/fair-data-schema/dev",
  "$id": "https://example.org/schemas/missing-and-clamped-values",
  "title": "Microdata & Survey Missing Values and Clamping",
  "description": "Demonstrates user-defined missing codes (sentinels) and privacy top/bottom-coding (clamping) using standard Draft 2020-12 keywords and FAIR annotations.",
  "type": "object",
  "fair:resourceType": "dataset",
  "fair:structureType": "wide",
  "fair:license": "https://creativecommons.org/licenses/by/4.0/",
  "fair:contributors": [
    {
      "name": "National Statistical Center",
      "role": "Producer",
      "type": "Organization"
    }
  ],
  "properties": {
    "respondent_id": {
      "type": "string",
      "title": "Respondent Identifier",
      "description": "Unique pseudonymized respondent identifier."
    },
    "employment_status": {
      "type": "integer",
      "title": "Employment Status",
      "description": "Labor force classification showing discrete substantive categories and discrete non-response codes.",
      "fair:conceptRef": "http://uri.suomi.fi/codelist/fair/employment-status",
      "oneOf": [
        { "const": 1, "title": "Employed full-time" },
        { "const": 2, "title": "Employed part-time" },
        { "const": 3, "title": "Unemployed seeking work" },
        { "const": 4, "title": "Retired" },
        { "const": 98, "title": "Don't know", "fair:sentinel": true },
        { "const": 99, "title": "Refused / No answer", "fair:sentinel": true }
      ]
    },
    "respondent_age": {
      "type": "integer",
      "title": "Age of Respondent",
      "description": "Demographic age bracket (5-99) with bottom-coding at 5 and under, single years 6-98, top-coding at 99 and older, and negative refusal code.",
      "oneOf": [
        {
          "minimum": 0,
          "maximum": 5,
          "title": "5 years and under (bottom-coded for confidentiality)",
          "fair:clamped": true
        },
        {
          "minimum": 6,
          "maximum": 98,
          "title": "Recorded age in single years (6 to 98)"
        },
        {
          "minimum": 99,
          "title": "99 years and older (top-coded for confidentiality)",
          "fair:clamped": true
        },
        {
          "const": -1,
          "title": "Refused / Not reported",
          "fair:sentinel": true
        }
      ]
    },
    "weekly_hours_worked": {
      "type": "integer",
      "title": "Weekly Hours Worked",
      "description": "Weekly hours showing bottom-coding at 5 hours or fewer and a closed non-response interval.",
      "fair:unit": "http://qudt.org/vocab/unit/HR",
      "fair:quantityRef": "https://qudt.org/vocab/quantitykind/Time",
      "oneOf": [
        {
          "minimum": 0,
          "maximum": 5,
          "title": "5 hours or fewer (bottom-coded)",
          "fair:clamped": true
        },
        {
          "minimum": 6,
          "maximum": 89,
          "title": "Recorded hours worked (6 to 89)"
        },
        {
          "minimum": 90,
          "maximum": 99,
          "title": "Suppressed / Non-response range (90 to 99)",
          "fair:sentinel": true
        }
      ]
    },
    "annual_income_thousands": {
      "type": "number",
      "title": "Annual Gross Income (Thousands USD)",
      "description": "Earnings in thousands showing top-coding at $250k+, negative processing error range (-99 to -90), and discrete refusal (-1).",
      "oneOf": [
        {
          "minimum": 0,
          "maximum": 249,
          "title": "Recorded earnings under $250k"
        },
        {
          "minimum": 250,
          "title": "$250,000 and above (top-coded for privacy)",
          "fair:clamped": true
        },
        {
          "minimum": -99,
          "maximum": -90,
          "title": "Negative processing error range (-99 to -90)",
          "fair:sentinel": true
        },
        {
          "const": -1,
          "title": "Refused / Not reported",
          "fair:sentinel": true
        }
      ]
    },
    "satisfaction_score": {
      "type": "integer",
      "title": "Life Satisfaction Score",
      "description": "10-point scale with zero representing not applicable.",
      "oneOf": [
        {
          "minimum": 1,
          "maximum": 10,
          "title": "Satisfaction rating (1 = lowest, 10 = highest)"
        },
        {
          "const": 0,
          "title": "Not applicable / Did not evaluate",
          "fair:sentinel": true
        }
      ]
    }
  },
  "required": [
    "respondent_id",
    "employment_status",
    "respondent_age"
  ]
}
