{
  "$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/components/common_defs.json",
  "@type": [
    "Thing",
    "ComponentSchema"
  ],
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Common Definitions Component",
  "description": "Reusable definitions and common schemas",
  "type": "object",
  "$defs": {
    "Identifier": {
      "type": "object",
      "title": "Identifier",
      "description": "Unique identifier with type",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "url",
            "uuid",
            "sku",
            "ean",
            "upc",
            "isbn",
            "issn",
            "doi",
            "custom"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "ContactPoint": {
      "type": "object",
      "title": "Contact Point",
      "description": "Contact information",
      "properties": {
        "contactType": {
          "type": "string",
          "enum": [
            "support",
            "sales",
            "billing",
            "customer_service",
            "technical",
            "general"
          ]
        },
        "telephone": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "areaServed": {
          "type": "string"
        },
        "availableLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Rating": {
      "type": "object",
      "title": "Rating",
      "description": "Rating with score and count",
      "properties": {
        "ratingValue": {
          "type": "number",
          "minimum": 0,
          "maximum": 10
        },
        "reviewCount": {
          "type": "integer",
          "minimum": 0
        },
        "bestRating": {
          "type": "number",
          "default": 5
        },
        "worstRating": {
          "type": "number",
          "default": 1
        }
      },
      "required": [
        "ratingValue"
      ]
    },
    "Price": {
      "type": "object",
      "title": "Price",
      "description": "Price with currency",
      "properties": {
        "price": {
          "type": "number",
          "minimum": 0
        },
        "priceCurrency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "priceValidFrom": {
          "type": "string",
          "format": "date"
        },
        "priceValidUntil": {
          "type": "string",
          "format": "date"
        }
      },
      "required": [
        "price",
        "priceCurrency"
      ]
    },
    "Schedule": {
      "type": "object",
      "title": "Schedule",
      "description": "Operating hours schedule",
      "properties": {
        "dayOfWeek": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday",
              "Sunday"
            ]
          }
        },
        "opens": {
          "type": "string",
          "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$"
        },
        "closes": {
          "type": "string",
          "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$"
        }
      }
    },
    "SocialProfile": {
      "type": "object",
      "title": "Social Profile",
      "description": "Social media profile",
      "properties": {
        "platform": {
          "type": "string",
          "enum": [
            "facebook",
            "twitter",
            "instagram",
            "linkedin",
            "youtube",
            "tiktok",
            "github",
            "yelp"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "username": {
          "type": "string"
        }
      }
    }
  },
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "phase_1",
    "status": "draft",
    "lastValidated": "2026-02-19",
    "validator": "META-AIML QA"
  },
  "$id": "https://schemas.meta-aiml.org/v3.0.0/components/common_defs.json",
  "semanticAnnotations": {
    "componentPurpose": "common_defs.json provides reusable definitions for META-AIML v3 schemas.",
    "interoperabilityNotes": "Definitions are intended for reuse through $ref across entity schemas."
  },
  "governanceMetadata": {
    "schemaVersion": "3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-COMP-001: $defs MUST be present and resolvable",
      "RULE-COMP-002: Component versions MUST match schemaVersion/aimlVersion"
    ]
  },
  "examples": [
    {
      "scenario": "Component usage example #1",
      "note": "Referenced by an entity schema via $ref."
    },
    {
      "scenario": "Component usage example #2",
      "note": "Demonstrates alternative valid composition."
    }
  ]
}
