{
  "$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/product.json",
  "$id": "https://schemas.meta-aiml.org/v3.0.0/entity/product.json",
  "@type": "Product",
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Product Entity Schema",
  "description": "v3 schema for standalone product artifacts represented as ProductEntity without interaction archetypes, covering physical or digital sellable items and inventory lifecycle.",
  "examples": [
    {
      "description": "Consumer electronic product with stock tracking and warranty attributes",
      "reference": "product_example_electronics"
    },
    {
      "description": "Packaged physical good with shelf-life and compliance metadata",
      "reference": "product_example_packaged_goods"
    }
  ],
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "../ontology/product_entity.json"
    }
  ],
  "properties": {
    "@type": {
      "const": "Product"
    },
    "ontologicalMode": {
      "const": "ProductEntity"
    },
    "domain": {
      "const": "Commerce"
    },
    "businessModel": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Transactional",
          "Wholesale",
          "Subscription"
        ]
      }
    },
    "deliveryFormat": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "PhysicalGoods",
          "DigitalDownload",
          "LicenseKeyDelivery"
        ]
      }
    },
    "name": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "description": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "shortDescription": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "foundingDate": {
      "type": "string",
      "format": "date"
    },
    "productType": {
      "type": "string",
      "enum": [
        "physical",
        "digital",
        "hybrid"
      ]
    },
    "inventory": {
      "type": "object",
      "required": [
        "availableQuantity",
        "stockStatus"
      ],
      "properties": {
        "availableQuantity": {
          "type": "integer",
          "minimum": 0
        },
        "stockStatus": {
          "type": "string",
          "enum": [
            "in_stock",
            "out_of_stock",
            "backorder",
            "discontinued"
          ]
        },
        "reorderPoint": {
          "type": "integer",
          "minimum": 0
        },
        "warehouseLocations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "properties": {
      "type": "object",
      "properties": {
        "productCategory": {
          "type": "string"
        },
        "brand": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "barcode": {
          "type": "string"
        },
        "warrantyMonths": {
          "type": "integer",
          "minimum": 0
        },
        "shelfLifeDays": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "capabilities": {
      "type": "object",
      "properties": {
        "commerce": {
          "$ref": "../components/capability_groups.json#/$defs/CommerceCapabilities"
        },
        "financial": {
          "$ref": "../components/capability_groups.json#/$defs/FinancialCapabilities"
        },
        "content": {
          "$ref": "../components/capability_groups.json#/$defs/ContentCapabilities"
        }
      }
    },
    "modules": {
      "type": "object",
      "properties": {
        "lifecycle": {
          "type": "object",
          "properties": {
            "supportsVersioning": {
              "type": "boolean"
            },
            "replacementPolicy": {
              "type": "string"
            },
            "endOfLifeDate": {
              "type": "string",
              "format": "date"
            }
          }
        },
        "fulfillment": {
          "type": "object",
          "properties": {
            "leadTimeDays": {
              "type": "integer",
              "minimum": 0
            },
            "returnWindowDays": {
              "type": "integer",
              "minimum": 0
            },
            "supportsDropShipping": {
              "type": "boolean"
            }
          }
        },
        "compliance": {
          "type": "object",
          "properties": {
            "certifications": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "hazmatClassification": {
              "type": "string"
            },
            "countryRestrictions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "structuralMetadata": {
      "type": "object",
      "properties": {
        "entityNature": {
          "const": "product_item"
        },
        "distributionModel": {
          "type": "string",
          "enum": [
            "physical_distribution",
            "digital_distribution",
            "hybrid"
          ]
        },
        "versioningModel": {
          "type": "string",
          "enum": [
            "none",
            "semantic_versioning",
            "calendar_versioning",
            "custom"
          ]
        },
        "contentOwnership": {
          "const": "platform"
        }
      }
    },
    "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",
    "domain",
    "name",
    "description",
    "deliveryFormat",
    "productType",
    "inventory",
    "capabilities",
    "structuralMetadata",
    "modules"
  ],
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "entity",
    "status": "draft",
    "lastValidated": "2026-02-20T12:00:00Z",
    "validator": "META-AIML QA"
  },
  "semanticAnnotations": {
    "classificationRationale": "Product is modeled as ProductEntity because the schema describes the product artifact itself (type, inventory, lifecycle) rather than an interaction platform.",
    "disambiguationNotes": "ProductEntity intentionally does not declare interactionArchetype. Service behavior belongs to separate platform entities such as ecommerce_store or marketplace."
  },
  "governanceMetadata": {
    "entityVersion": "3.0.0",
    "introducedIn": "META-AIML v3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-PROD-001: @type MUST equal \"Product\"",
      "RULE-PROD-002: ontologicalMode MUST equal \"ProductEntity\"",
      "RULE-PROD-003: interactionArchetype MUST NOT be present",
      "RULE-PROD-004: productType and inventory MUST be present",
      "RULE-PROD-005: allOf MUST reference only product_entity ontology",
      "RULE-PROD-006: inventory.availableQuantity and inventory.stockStatus MUST be present"
    ]
  }
}
