{ "$schema":                                  "https://json-schema.org/draft/2020-12/schema",
  "$id":                                      "https://schemas.mpai.community/OSD/V1.5/data/SpeechSceneGeometry.json",
  "title":                                    "SpeechScene Geometry V1.5",
  "description":                              "Includes Objects, Basic Scene geom. & Scene geom.",
  "type":                                     "object",
  "required":                                 [ "Header", "SpeechSceneGeometryID", "SpeechSceneGeometrySpaceTime" ],
  "additionalProperties":                     false,
  "properties":                               {

    "Header":                                 { "type": "string", "pattern": "^OSD-SSG-V[0-9],{1,2},[.][0-9],{1,2}$" },
    "MInstanceID":                            { "type": "string" },
    "EnvironmentID":                          { "type": "string" },
    "SpeechSceneGeometryID":                  { "type": "string" },
    "SpeechSceneGeometrySpaceTime":           { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },

    "ObjectCount":                            { "type": "integer", "minimum": 0 },
    "Objects":                                { "type": "array", "items": { "type": "object", "additionalProperties": false,
                                                "properties": {
      "ObjectSpaceTime":                      { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
      "ObjectIDOrGeometry":                   { "$ref": "#/$defs/ObjectIDOrGeometry" } } } },

    "SubSpeechSceneCount":                    { "type": "integer", "minimum": 0 },
    "SubSpeechScenes":                        { "type": "array", "items": { "type": "object", "additionalProperties": false,
                                                "properties": {
        "SubSpeechSceneSpaceTime":            { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
        "SubSpeechSceneIDOrSubSpeechScene":   { "$ref": "#/$defs/SubSpeechSceneIDOrSubSpeechScene" } } } },

    "BasicSpeechSceneOrSpeechScene":          { "$ref": "#/$defs/BasicSpeechSceneOrSpeechScene" },

    "DataXMData":                             { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":                          { "type": "string", "maxLength": 2048 } },

  "$defs":                                    {

    "GeometryObject":                         { "type": "object", "required": [ "ObjectSpaceTime", "ObjectQualifier" ],
                                                "additionalProperties": false, "properties": {
      "ObjectSpaceTime":                      { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
      "ObjectQualifier":                      { "$ref": "https://schemas.mpai.community/TFA/V1.5/data/SpeechQualifier.json" } } },

    "ObjectIDOrGeometry":                     { "type": "array", "minItems": 1, "maxItems": 1, "items": { "oneOf": [
                                                { "$ref": "#/$defs/GeometryObject" },
                                                { "type": "string" } ] } },

    "SubSpeechSceneIDOrSubSpeechScene":         { "type": "array", "minItems": 1, "maxItems": 1, "items": { "oneOf": [
                                                { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpeechSceneGeometry.json" },
                                                { "type": "string" } ] } },

    "BasicSpeechSceneOrSpeechScene":            { "type": "array", "items": { "oneOf": [
                                                { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/BasicSpeechSceneGeometry.json" },
                                                { "$ref": "#/$defs/BasicSpeechSceneOrSpeechScene" } ] } } } }
