{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/zarr-conventions/stac/refs/tags/v0.1/schema.json", "title": "STAC Zarr Convention", "description": "Schema for STAC Zarr convention - embedding or referencing STAC objects in Zarr group metadata with relative asset URLs", "type": "object", "properties": { "zarr_format": { "type": "integer", "description": "Zarr format version" }, "node_type": { "type": "string", "enum": ["group"], "description": "Type of Zarr node - must be 'group' for STAC convention" }, "attributes": { "type": "object", "description": "Zarr attributes containing convention metadata and STAC objects", "properties": { "zarr_conventions": { "type": "array", "description": "Array of convention metadata objects", "contains": { "$ref": "#/$defs/conventionMetadata" } } }, "required": ["zarr_conventions"], "allOf": [ { "$ref": "#/$defs/stacAttributes" } ] } }, "required": ["zarr_format", "node_type", "attributes"], "additionalProperties": true, "$defs": { "conventionMetadata": { "type": "object", "description": "STAC convention metadata object for use in zarr_conventions array", "properties": { "schema_url": { "type": "string", "const": "https://raw.githubusercontent.com/zarr-conventions/stac/refs/tags/v0.1/schema.json", "description": "URL to the JSON Schema definition for this convention" }, "spec_url": { "type": "string", "const": "https://github.com/zarr-conventions/stac/blob/v0.1/README.md", "description": "URL to the full specification document" }, "uuid": { "type": "string", "const": "b3703368-7e7e-4e8e-9e0e-6d0f0d5e8e8e", "description": "UUID that permanently identifies this convention" }, "name": { "type": "string", "const": "stac:", "description": "Convention name using key-prefixed pattern" }, "description": { "type": "string", "const": "STAC convention for embedding or referencing STAC objects in Zarr group metadata", "description": "Brief description of the convention's purpose and usage" } }, "anyOf": [ { "required": ["schema_url"] }, { "required": ["spec_url"] }, { "required": ["uuid"] } ], "additionalProperties": false }, "stacAttributes": { "type": "object", "description": "STAC convention attributes using key-prefixed pattern. Exactly one of stac:item, stac:collection, stac:key, or stac:link MUST be present; each has a single, fixed shape, so no separate encoding discriminator is needed.", "properties": { "zarr_conventions": true, "stac:item": { "description": "A complete, embedded STAC Item. Authoritative for every asset it lists. See README 'Scope of the STAC Object'.", "oneOf": [ { "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json" }, { "$ref": "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json" } ] }, "stac:collection": { "description": "A complete, embedded STAC Collection. Authoritative for every asset it lists. See README 'Scope of the STAC Object'.", "oneOf": [ { "$ref": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json" }, { "$ref": "https://schemas.stacspec.org/v1.1.0/collection-spec/json-schema/collection.json" } ] }, "stac:key": { "type": "string", "description": "A key (Unicode string), relative to the group carrying this attribute, referencing a separate JSON value elsewhere in the same Zarr store that holds the STAC object. The referenced document is authoritative for every asset it lists, on the same terms as an embedded object: see README 'Scope of the STAC Object'. See README 'Choosing a Field' for when to prefer this over stac:item/stac:collection or stac:link." }, "stac:link": { "$ref": "#/$defs/stacLink" } }, "oneOf": [ { "required": ["stac:item"] }, { "required": ["stac:collection"] }, { "required": ["stac:key"] }, { "required": ["stac:link"] } ], "additionalProperties": true }, "stacLink": { "type": "object", "description": "A STAC Link Object identifying the canonical, external location of a STAC Item or Collection. Which of the two it is is not conveyed here; follow href and inspect the retrieved object's own type.", "properties": { "href": { "type": "string", "format": "uri", "description": "REQUIRED. Absolute URL to the canonical STAC Item or Collection. MUST NOT be relative to the Zarr store, since the target lives outside it." }, "rel": { "type": "string", "description": "Link relation type. Defaults to 'self' when omitted." }, "type": { "type": "string", "description": "Media type of the target, e.g. 'application/geo+json' for an Item or 'application/json' for a Collection." } }, "required": ["href"], "additionalProperties": true } } }