{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.mpai.community/OSD/V1.5/data/OfflineMapObject.json",
  "title": "Offline Map Object V1.5",
  "type": "object",
  "properties": {
    "Header": { "type": "string", "pattern": "^OSD-OMO-V[0-9]{1,2}[.][0-9]{1,2}$" },
    "MInstanceID": { "type": "string" },
    "OfflineMapObjectID": { "type": "string" },

    "OfflineMapObjectSpaceTime": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },

    "BasicOfflineMapObjectCount": { "type": "integer" },

    "BasicOfflineMapObjects": {
      "type": "array", "items": {
        "type": "object", "properties": {
          "BasicOfflineMapObjectSpaceTime": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },

          "BasicOfflineMapObjectIDOrBasicOfflineMapObject": { "type": "array", "items": {
              "oneOf": [
                { "type": "string" },
                { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/BasicOfflineMapObject.json" }
              ]
            }
          },

          "OfflineMapObjectAnnotation": {
            "type": "array", "items": {
              "type": "object", "properties": {
                "Annotation": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/Annotation.json" },
                "AnnotationTimeSpace": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
                "AnnotationRights": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      { "type": "string" },
                      { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Right.json" }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },

    "SubOfflineMapObjectCount": { "type": "integer" },

    "SubOfflineMapObjects": {
      "type": "array", "items": {
        "type": "object", "properties": {
          "SubOfflineMapObjectSpaceTime": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },

          "SubOfflineMapObjectIDOrSubOfflineMapObject": {
            "type": "array",
            "items": {
              "oneOf": [
                { "type": "string" },
                { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/OfflineMapObject.json" }
              ]
            }
          },

          "Annotations": {
            "type": "array", "items": {
              "type": "object", "properties": {
                "Annotation": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/Annotation.json" },
                "AnnotationSpaceTime": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
                "AnnotationRights": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      { "type": "string" },
                      { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Right.json" }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },

    "OfflineMapObjectOrBasicOfflineMapObject": {
      "type": "array",
      "oneOf": [
        { "type": "array", "items": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/BasicOfflineMapObject.json" } },
        { "type": "array", "items": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/OfflineMapObject.json#/properties/OfflineMapObjectOrBasicOfflineMapObject" } }
      ]
    },

    "Rights": {
      "type": "object",
      "required": ["Right"],
      "properties": { "Right": { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Right.json" } }
    },

    "Trace": { "$ref": "https://schemas.mpai.community/AIF/V3.0/data/Trace.json" },
    "DescrMetadata": { "type": "string", "maxLength": 2048 }
  }
}