{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "A structured topology dataset with named arrays for each topological dimension. Points carry explicit coordinates; all higher-order features (edges, faces, shells, solids) use null geometry with topology defined via references or directed_references. Each array is restricted to its corresponding building block schema.",
  "$defs": {
    "PointFeatures": {
      "$anchor": "PointFeatures",
      "type": "array",
      "items": {
        "properties": {
          "geometry": {
            "type": "object",
            "required": [
              "type",
              "coordinates"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "Point"
              },
              "coordinates": {
                "type": "array",
                "minItems": 2
              }
            }
          }
        },
        "required": [
          "geometry"
        ]
      }
    },
    "EdgeFeatures": {
      "$anchor": "EdgeFeatures",
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-line/schema.json"
          },
          {
            "properties": {
              "topology": {
                "properties": {
                  "references": {
                    "minItems": 2,
                    "maxItems": 2
                  }
                }
              }
            }
          }
        ]
      }
    }
  },
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "FeatureCollection"
    },
    "metadata": {
      "type": "object",
      "description": "Optional dataset metadata (units, coordinate precision, source info, etc.)",
      "additionalProperties": true
    },
    "points": {
      "type": "array",
      "description": "Point features providing base coordinate geometry for the topology",
      "items": {
        "oneOf": [
          {
            "$ref": "#PointFeatures"
          },
          {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "$ref": "#PointFeatures"
                  }
                }
              }
            ]
          }
        ]
      },
      "x-jsonld-id": "https://purl.org/geojson/topo#points",
      "x-jsonld-container": "@list"
    },
    "edges": {
      "oneOf": [
        {
          "$ref": "#EdgeFeatures"
        },
        {
          "type": "array",
          "description": "Edge (LineString) features referencing two point nodes via topology.references.",
          "items": {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "$ref": "#EdgeFeatures"
                  }
                }
              }
            ]
          }
        }
      ],
      "x-jsonld-id": "https://purl.org/geojson/topo#edges",
      "x-jsonld-container": "@list"
    },
    "rings": {
      "type": "array",
      "description": "Ring features whose boundary segments reference edges via directed_references. geometry is null.",
      "items": {
        "oneOf": [
          {
            "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-ring/schema.json"
          },
          {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "type": "array",
                    "items": {
                      "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-ring/schema.json"
                    }
                  }
                }
              }
            ]
          }
        ]
      }
    },
    "faces": {
      "type": "array",
      "description": "Face features whose boundary rings reference edges via directed_references. geometry is null.",
      "items": {
        "oneOf": [
          {
            "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-face/schema.json"
          },
          {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "type": "array",
                    "items": {
                      "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-face/schema.json"
                    }
                  }
                }
              }
            ]
          }
        ]
      }
    },
    "shells": {
      "type": "array",
      "description": "Shell features referencing faces via directed_references. geometry is null.",
      "items": {
        "oneOf": [
          {
            "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-shell/schema.json"
          },
          {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "type": "array",
                    "items": {
                      "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-shell/schema.json"
                    }
                  }
                }
              }
            ]
          }
        ]
      }
    },
    "solids": {
      "type": "array",
      "description": "Solid features whose shells reference faces via directed_references. geometry is null.",
      "items": {
        "oneOf": [
          {
            "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-solid/schema.json"
          },
          {
            "allOf": [
              {
                "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature-collection/schema.json#FeatureCollectionOptions"
              },
              {
                "properties": {
                  "features": {
                    "type": "array",
                    "items": {
                      "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-solid/schema.json"
                    }
                  }
                }
              }
            ]
          }
        ]
      },
      "x-jsonld-id": "https://purl.org/geojson/topo#solids",
      "x-jsonld-container": "@list"
    }
  },
  "x-jsonld-prefixes": {
    "topo": "https://purl.org/geojson/topo#"
  }
}