{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opengastronomy.org/schema/v0.5/ingredient.schema.json",
  "title": "OGS Ingredient",
  "description": "A single culinary ingredient with category, sensory profile, and origin. See spec/ogs-core.md and spec/ogs-sense.md.",
  "type": "object",
  "required": [
    "id",
    "ogs_version",
    "name",
    "category"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^ogs:[a-z0-9-]+:ingredient:[a-z0-9-]+$",
      "description": "OGS identifier: ogs:<namespace>:ingredient:<id>."
    },
    "ogs_version": {
      "$ref": "common.schema.json#/$defs/ogs_version"
    },
    "primary_language": {
      "$ref": "common.schema.json#/$defs/primary_language"
    },
    "available_languages": {
      "$ref": "common.schema.json#/$defs/available_languages"
    },
    "name": {
      "$ref": "common.schema.json#/$defs/lstring",
      "description": "Human-readable ingredient name."
    },
    "description": {
      "$ref": "common.schema.json#/$defs/lstring",
      "description": "Longer description of the ingredient."
    },
    "category": {
      "type": "string",
      "enum": [
        "protein",
        "vegetable",
        "fruit",
        "grain",
        "dairy",
        "fat",
        "herb",
        "spice",
        "fungus",
        "legume",
        "nut",
        "seed",
        "sweetener",
        "acid",
        "salt",
        "other"
      ],
      "description": "Primary ingredient category."
    },
    "subcategory": {
      "type": "string",
      "description": "More specific classification within the category."
    },
    "sensory_profile": {
      "$ref": "common.schema.json#/$defs/sensory_profile"
    },
    "origin": {
      "type": "object",
      "description": "Where and when the ingredient comes from.",
      "properties": {
        "region": {
          "$ref": "common.schema.json#/$defs/lstring"
        },
        "season": {
          "$ref": "common.schema.json#/$defs/lstring"
        },
        "terroir_notes": {
          "$ref": "common.schema.json#/$defs/lstring"
        }
      },
      "additionalProperties": true
    },
    "notes": {
      "$ref": "common.schema.json#/$defs/lstring"
    },
    "dietary": {
      "$ref": "common.schema.json#/$defs/dietary"
    },
    "metadata": {
      "$ref": "common.schema.json#/$defs/metadata"
    }
  },
  "additionalProperties": true
}
