{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "@context": [
    "https://schemas.meta-aiml.org/v3.0.0/context.jsonld"
  ],
  "@id": "https://schemas.meta-aiml.org/v3.0.0/entity/restaurant.json",
  "$id": "https://schemas.meta-aiml.org/v3.0.0/entity/restaurant.json",
  "@type": "Restaurant",
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Restaurant Entity Schema",
  "description": "v3 schema for restaurants as static website intelligence profile: stable business metadata + external source links for dynamic data (menu/reviews), so AI can fetch fresh values without manual schema rewrites.",
  "examples": [
    {
      "description": "Urban fine-dining restaurant with online reservation and tasting menus",
      "reference": "restaurant_example_fine_dining"
    },
    {
      "description": "Neighborhood casual restaurant with dine-in, takeout, and delivery support",
      "reference": "restaurant_example_casual"
    }
  ],
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "../ontology/physical_entity.json"
    },
    {
      "$ref": "../archetypes/direct_service.json"
    }
  ],
  "properties": {
    "@type": {
      "const": "Restaurant"
    },
    "ontologicalMode": {
      "const": "PhysicalEntity"
    },
    "interactionArchetype": {
      "type": "array",
      "contains": {
        "const": "DirectService"
      },
      "items": {
        "type": "string",
        "enum": [
          "DirectService"
        ]
      }
    },
    "domain": {
      "const": "Hospitality"
    },
    "businessModel": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Transactional",
          "Subscription",
          "PackagePricing"
        ]
      }
    },
    "deliveryFormat": {
      "type": "array",
      "contains": {
        "const": "PhysicalLocation"
      },
      "items": {
        "type": "string",
        "enum": [
          "PhysicalLocation",
          "WebApp",
          "MobileApp"
        ]
      }
    },
    "name": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "description": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "shortDescription": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedTextOrString"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "foundingDate": {
      "type": "string",
      "format": "date"
    },
    "properties": {
      "type": "object",
      "properties": {
        "cuisineTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "serviceStyle": {
          "type": "string",
          "enum": [
            "fine_dining",
            "casual_dining",
            "fast_casual",
            "quick_service",
            "buffet"
          ]
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "seatingCapacity": {
          "type": "integer",
          "minimum": 1
        },
        "supportsReservations": {
          "type": "boolean"
        },
        "supportsDelivery": {
          "type": "boolean"
        },
        "supportsTakeout": {
          "type": "boolean"
        },
        "contactPoints": {
          "type": "array",
          "items": {
            "$ref": "../components/common_defs.json#/$defs/ContactPoint"
          }
        },
        "socialProfiles": {
          "type": "array",
          "items": {
            "$ref": "../components/common_defs.json#/$defs/SocialProfile"
          }
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "../components/common_defs.json#/$defs/Identifier"
          }
        }
      }
    },
    "capabilities": {
      "type": "object",
      "required": [
        "interaction"
      ],
      "properties": {
        "interaction": {
          "$ref": "../components/capability_groups.json#/$defs/InteractionCapabilities"
        },
        "booking": {
          "$ref": "../components/capability_groups.json#/$defs/BookingCapabilities"
        },
        "commerce": {
          "$ref": "../components/capability_groups.json#/$defs/CommerceCapabilities"
        },
        "financial": {
          "$ref": "../components/capability_groups.json#/$defs/FinancialCapabilities"
        },
        "location": {
          "$ref": "../components/capability_groups.json#/$defs/LocationCapabilities"
        },
        "amenities": {
          "$ref": "../components/capability_groups.json#/$defs/AmenitiesCapabilities"
        },
        "content": {
          "$ref": "../components/capability_groups.json#/$defs/ContentCapabilities"
        }
      }
    },
    "modules": {
      "type": "object",
      "required": [
        "location"
      ],
      "properties": {
        "location": {
          "type": "object",
          "properties": {
            "address": {
              "$ref": "../components/address_format.json#/$defs/PostalAddress"
            },
            "geoCoordinates": {
              "$ref": "../components/address_format.json#/$defs/GeoCoordinates"
            },
            "serviceRadiusKm": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "hours": {
          "type": "object",
          "properties": {
            "operatingScheduleDefined": {
              "type": "boolean"
            },
            "specialHoursWorkflowEnabled": {
              "type": "boolean"
            },
            "holidayClosureRulesDefined": {
              "type": "boolean"
            }
          }
        },
        "menu": {
          "type": "object",
          "properties": {
            "digitalMenuEnabled": {
              "type": "boolean"
            },
            "seasonalMenuSupport": {
              "type": "boolean"
            },
            "allergenLabelsEnabled": {
              "type": "boolean"
            },
            "menuDiscovery": {
              "type": "object",
              "required": [
                "canonicalMenuUrl",
                "dataSources"
              ],
              "properties": {
                "canonicalMenuUrl": {
                  "type": "string",
                  "format": "uri"
                },
                "dataSources": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": [
                      "sourceType",
                      "sourceUrl",
                      "format"
                    ],
                    "properties": {
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "file_export",
                          "public_feed_page",
                          "public_api_endpoint",
                          "other"
                        ]
                      },
                      "sourceUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "json",
                          "xml",
                          "csv",
                          "rss",
                          "html",
                          "other"
                        ]
                      },
                      "updateCadence": {
                        "type": "string",
                        "enum": [
                          "real_time",
                          "hourly",
                          "daily",
                          "weekly",
                          "manual"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "reservations": {
          "type": "object",
          "properties": {
            "depositRulesEnabled": {
              "type": "boolean"
            },
            "noShowPolicyDefined": {
              "type": "boolean"
            },
            "tableTurnTimingEnabled": {
              "type": "boolean"
            }
          }
        },
        "reviews": {
          "type": "object",
          "properties": {
            "ratingSources": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": [
                  "provider",
                  "sourceUrl"
                ],
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "google_business_profile",
                      "yelp",
                      "tripadvisor",
                      "opentable",
                      "facebook",
                      "custom"
                    ]
                  },
                  "sourceType": {
                    "type": "string",
                    "enum": [
                      "public_page",
                      "official_export",
                      "public_api_endpoint",
                      "other"
                    ]
                  },
                  "sourceUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "xml",
                      "csv",
                      "rss",
                      "html",
                      "other"
                    ]
                  },
                  "updateCadence": {
                    "type": "string",
                    "enum": [
                      "real_time",
                      "hourly",
                      "daily",
                      "weekly",
                      "manual"
                    ]
                  }
                }
              }
            },
            "retrievalPolicy": {
              "type": "object",
              "properties": {
                "requiresLiveFetch": {
                  "type": "boolean"
                },
                "recommendedRefreshHours": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "structuralMetadata": {
      "type": "object",
      "properties": {
        "topology": {
          "const": "binary"
        },
        "roles": {
          "const": [
            "user",
            "platform"
          ]
        },
        "valueSource": {
          "const": "platform_provided"
        },
        "transactionFlow": {
          "const": "direct"
        },
        "networkEffects": {
          "const": "none"
        },
        "serviceSetting": {
          "type": "string",
          "enum": [
            "on_premises",
            "mixed_service",
            "delivery_extended"
          ]
        }
      }
    },
    "targetAudience": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "siteCapabilities": {
      "type": "object",
      "properties": {
        "supportedDevices": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "desktop",
              "mobile",
              "tablet"
            ]
          }
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "accessibilityFeatures": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "@type",
    "ontologicalMode",
    "interactionArchetype",
    "domain",
    "name",
    "description",
    "deliveryFormat",
    "modules",
    "capabilities",
    "structuralMetadata"
  ],
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "entity",
    "status": "draft",
    "lastValidated": "2026-02-20T12:00:00Z",
    "validator": "META-AIML QA"
  },
  "semanticAnnotations": {
    "classificationRationale": "Restaurant is modeled as PhysicalEntity + DirectService because food and hospitality value is delivered directly by venue staff at a physical location.",
    "disambiguationNotes": "Different from food delivery aggregators and restaurant marketplaces that mediate third-party merchants. For static website schemas, keep dynamic data out of JSON payload: ratings and menu inventory should be referenced via source links only."
  },
  "governanceMetadata": {
    "entityVersion": "3.0.0",
    "introducedIn": "META-AIML v3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-REST-001: @type MUST equal \"Restaurant\"",
      "RULE-REST-002: ontologicalMode MUST equal \"PhysicalEntity\"",
      "RULE-REST-003: interactionArchetype MUST contain \"DirectService\"",
      "RULE-REST-004: deliveryFormat MUST contain \"PhysicalLocation\"",
      "RULE-REST-005: modules.location MUST be present",
      "RULE-REST-006: capabilities.interaction MUST be present",
      "RULE-REST-007: modules.reviews.ratingSources MUST contain provider and sourceUrl for each source entry",
      "RULE-REST-008: modules.menu.menuDiscovery.dataSources MUST contain sourceType/sourceUrl/format and SHOULD avoid embedded catalogs"
    ]
  }
}
