{
  "$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/ridesharing_service.json",
  "$id": "https://schemas.meta-aiml.org/v3.0.0/entity/ridesharing_service.json",
  "@type": "RidesharingService",
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Ridesharing Service Entity Schema",
  "description": "v3 schema for ride-hailing and ridesharing platforms that mediate transportation transactions between riders and drivers through real-time dispatch and pricing systems.",
  "examples": [
    {
      "description": "Urban ridesharing app with dynamic pricing and instant driver matching",
      "reference": "ridesharing_service_example_urban"
    },
    {
      "description": "Regional ride platform with scheduled pickups and airport transfer flows",
      "reference": "ridesharing_service_example_regional"
    }
  ],
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "../ontology/digital_entity.json"
    },
    {
      "$ref": "../archetypes/mediated_exchange.json"
    }
  ],
  "properties": {
    "@type": {
      "const": "RidesharingService"
    },
    "ontologicalMode": {
      "const": "DigitalEntity"
    },
    "interactionArchetype": {
      "type": "array",
      "contains": {
        "const": "MediatedExchange"
      },
      "items": {
        "type": "string",
        "enum": [
          "MediatedExchange"
        ]
      }
    },
    "domain": {
      "const": "Transportation"
    },
    "businessModel": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Commission",
          "DynamicPricing",
          "Subscription"
        ]
      }
    },
    "deliveryFormat": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "MobileApp",
          "WebApp",
          "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": {
        "rideTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "economy",
              "premium",
              "shared",
              "xl",
              "eco"
            ]
          }
        },
        "supportsScheduledRides": {
          "type": "boolean"
        },
        "supportsCarpooling": {
          "type": "boolean"
        },
        "surgePricingEnabled": {
          "type": "boolean"
        },
        "driverVerificationModel": {
          "type": "string",
          "enum": [
            "basic",
            "enhanced",
            "continuous_monitoring"
          ]
        },
        "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"
        },
        "location": {
          "$ref": "../components/capability_groups.json#/$defs/LocationCapabilities"
        },
        "community": {
          "$ref": "../components/capability_groups.json#/$defs/CommunityCapabilities"
        }
      }
    },
    "modules": {
      "type": "object",
      "properties": {
        "dispatch": {
          "type": "object",
          "properties": {
            "autoMatchingEnabled": {
              "type": "boolean"
            },
            "etaPredictionEnabled": {
              "type": "boolean"
            },
            "demandRebalancingEnabled": {
              "type": "boolean"
            }
          }
        },
        "safety": {
          "type": "object",
          "properties": {
            "sosFeatureEnabled": {
              "type": "boolean"
            },
            "tripMonitoringEnabled": {
              "type": "boolean"
            },
            "anomalyAlertsEnabled": {
              "type": "boolean"
            }
          }
        },
        "payments": {
          "type": "object",
          "properties": {
            "instantDriverPayouts": {
              "type": "boolean"
            },
            "tipProcessingEnabled": {
              "type": "boolean"
            },
            "settlementCycleDays": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      }
    },
    "structuralMetadata": {
      "type": "object",
      "properties": {
        "topology": {
          "const": "triadic"
        },
        "roles": {
          "const": [
            "buyer",
            "seller",
            "platform"
          ]
        },
        "valueSource": {
          "const": "transaction_mediation"
        },
        "transactionFlow": {
          "const": "escrow"
        },
        "networkEffects": {
          "const": "cross_side"
        },
        "matchingMechanism": {
          "type": "string",
          "enum": [
            "nearest_driver",
            "score_based",
            "hybrid"
          ]
        }
      }
    },
    "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": "RidesharingService is DigitalEntity + MediatedExchange because value comes from matching riders and drivers with platform-managed transaction and routing logic.",
    "disambiguationNotes": "Different from transportation operators with owned fleet acting as DirectService. This schema models platform mediation between independent sides."
  },
  "governanceMetadata": {
    "entityVersion": "3.0.0",
    "introducedIn": "META-AIML v3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-RIDE-001: @type MUST equal \"RidesharingService\"",
      "RULE-RIDE-002: ontologicalMode MUST equal \"DigitalEntity\"",
      "RULE-RIDE-003: interactionArchetype MUST contain \"MediatedExchange\"",
      "RULE-RIDE-004: capabilities MUST include commerce, financial, interaction",
      "RULE-RIDE-005: structuralMetadata.topology MUST equal \"triadic\"",
      "RULE-RIDE-006: structuralMetadata.transactionFlow MUST equal \"escrow\""
    ]
  }
}
