{
  "$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/marketplace.json",
  "$id": "https://schemas.meta-aiml.org/v3.0.0/entity/marketplace.json",
  "@type": "Marketplace",
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Marketplace Entity Schema",
  "description": "v3 schema for digital marketplaces mediating transactions between buyers and sellers through listing, matching, payment orchestration, and trust workflows.",
  "examples": [
    {
      "description": "Peer-to-peer marketplace with escrow payment and dispute handling",
      "reference": "marketplace_example_p2p"
    },
    {
      "description": "Service marketplace connecting clients with verified professionals",
      "reference": "marketplace_example_services"
    }
  ],
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "../ontology/digital_entity.json"
    },
    {
      "$ref": "../archetypes/mediated_exchange.json"
    }
  ],
  "properties": {
    "@type": {
      "const": "Marketplace"
    },
    "ontologicalMode": {
      "const": "DigitalEntity"
    },
    "interactionArchetype": {
      "type": "array",
      "contains": {
        "const": "MediatedExchange"
      },
      "items": {
        "type": "string",
        "enum": [
          "MediatedExchange"
        ]
      }
    },
    "domain": {
      "const": "Commerce"
    },
    "businessModel": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Commission",
          "ListingFees",
          "Subscription",
          "Advertising"
        ]
      }
    },
    "deliveryFormat": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "WebApp",
          "MobileApp",
          "API"
        ]
      }
    },
    "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": {
        "marketType": {
          "type": "string",
          "enum": [
            "peer_to_peer",
            "business_to_consumer",
            "business_to_business",
            "hybrid"
          ]
        },
        "listingGovernanceModel": {
          "type": "string",
          "enum": [
            "open",
            "curated",
            "invite_only"
          ]
        },
        "priceFormationModel": {
          "type": "string",
          "enum": [
            "fixed_price",
            "negotiated",
            "auction",
            "mixed"
          ]
        },
        "supportsEscrow": {
          "type": "boolean"
        },
        "supportsDisputeResolution": {
          "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": [
        "commerce",
        "financial",
        "interaction"
      ],
      "properties": {
        "commerce": {
          "$ref": "../components/capability_groups.json#/$defs/CommerceCapabilities"
        },
        "financial": {
          "$ref": "../components/capability_groups.json#/$defs/FinancialCapabilities"
        },
        "interaction": {
          "$ref": "../components/capability_groups.json#/$defs/InteractionCapabilities"
        },
        "content": {
          "$ref": "../components/capability_groups.json#/$defs/ContentCapabilities"
        },
        "community": {
          "$ref": "../components/capability_groups.json#/$defs/CommunityCapabilities"
        }
      }
    },
    "modules": {
      "type": "object",
      "properties": {
        "catalog": {
          "type": "object",
          "properties": {
            "taxonomyVersioned": {
              "type": "boolean"
            },
            "bulkImportSupported": {
              "type": "boolean"
            },
            "listingModerationEnabled": {
              "type": "boolean"
            }
          }
        },
        "payments": {
          "type": "object",
          "properties": {
            "escrowEnabled": {
              "type": "boolean"
            },
            "splitPayoutsEnabled": {
              "type": "boolean"
            },
            "chargebackWorkflowEnabled": {
              "type": "boolean"
            }
          }
        },
        "trustAndSafety": {
          "type": "object",
          "properties": {
            "sellerVerificationEnabled": {
              "type": "boolean"
            },
            "fraudScreeningEnabled": {
              "type": "boolean"
            },
            "abuseAppealsEnabled": {
              "type": "boolean"
            }
          }
        }
      }
    },
    "structuralMetadata": {
      "type": "object",
      "properties": {
        "topology": {
          "const": "triadic"
        },
        "roles": {
          "const": [
            "buyer",
            "seller",
            "platform"
          ]
        },
        "valueSource": {
          "const": "transaction_mediation"
        },
        "transactionFlow": {
          "const": "escrow"
        },
        "networkEffects": {
          "const": "cross_side"
        },
        "liquidityModel": {
          "type": "string",
          "enum": [
            "demand_first",
            "supply_first",
            "balanced_growth"
          ]
        }
      }
    },
    "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",
    "capabilities",
    "structuralMetadata",
    "modules"
  ],
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "entity",
    "status": "draft",
    "lastValidated": "2026-02-20T12:00:00Z",
    "validator": "META-AIML QA"
  },
  "semanticAnnotations": {
    "classificationRationale": "Marketplace is modeled as DigitalEntity + MediatedExchange because platform value is created by orchestrating transactions between distinct market sides.",
    "disambiguationNotes": "Different from first-party ecommerce where the platform is also the sole seller."
  },
  "governanceMetadata": {
    "entityVersion": "3.0.0",
    "introducedIn": "META-AIML v3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-MRKT-001: @type MUST equal \"Marketplace\"",
      "RULE-MRKT-002: ontologicalMode MUST equal \"DigitalEntity\"",
      "RULE-MRKT-003: interactionArchetype MUST contain \"MediatedExchange\"",
      "RULE-MRKT-004: capabilities MUST include commerce, financial, interaction",
      "RULE-MRKT-005: structuralMetadata.topology MUST equal \"triadic\"",
      "RULE-MRKT-006: structuralMetadata.valueSource MUST equal \"transaction_mediation\""
    ]
  }
}
