{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/dchandan/stac-extension-cmip6/v1.0.0/json-schema/schema.json#", "title": "CMIP6 Extension", "description": "STAC CMIP6 Extension for STAC Items and STAC Collections.", "oneOf": [ { "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", "allOf": [ { "$ref": "#/definitions/stac_extensions" }, { "type": "object", "required": [ "type", "properties", "assets" ], "properties": { "type": { "const": "Feature" }, "properties": { "allOf": [ { "$comment": "Require fields here for Item Properties.", "required": [ "cmip6:Conventions", "cmip6:activity_id", "cmip6:data_specs_version", "cmip6:experiment", "cmip6:experiment_id", "cmip6:forcing_index", "cmip6:frequency", "cmip6:further_info_url", "cmip6:grid", "cmip6:grid_label", "cmip6:initialization_index", "cmip6:institution", "cmip6:institution_id", "cmip6:license", "cmip6:mip_era", "cmip6:nominal_resolution", "cmip6:physics_index", "cmip6:product", "cmip6:realization_index", "cmip6:realm", "cmip6:source", "cmip6:source_id", "cmip6:source_type", "cmip6:sub_experiment", "cmip6:sub_experiment_id", "cmip6:table_id", "cmip6:variant_label" ] }, { "$ref": "#/definitions/fields" } ] }, "assets": { "$comment": "This validates the fields in Item Assets, but does not require them.", "type": "object", "additionalProperties": { "$ref": "#/definitions/fields" } } } } ] }, { "$comment": "This is the schema for STAC Collections.", "type": "object", "allOf": [ { "required": [ "type" ], "properties": { "type": { "const": "Collection" } } }, { "$ref": "#/definitions/stac_extensions" } ], "anyOf": [ { "$comment": "This is the schema for the top-level fields in a Collection. Remove this if this extension does not define top-level fields for Collections.", "allOf": [ { "$comment": "Require fields here for Collections (top-level).", "required": [] }, { "$ref": "#/definitions/fields" } ] }, { "$comment": "This validates the fields in Collection Assets, but does not require them.", "required": [ "assets" ], "properties": { "assets": { "type": "object", "not": { "additionalProperties": { "not": { "allOf": [ { "$ref": "#/definitions/require_any_field" }, { "$ref": "#/definitions/fields" } ] } } } } } }, { "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", "required": [ "item_assets" ], "properties": { "item_assets": { "type": "object", "not": { "additionalProperties": { "not": { "allOf": [ { "$ref": "#/definitions/require_any_field" }, { "$ref": "#/definitions/fields" } ] } } } } } }, { "$comment": "This is the schema for the fields in Summaries. By default, only checks the existance of the properties, but not the schema of the summaries.", "required": [ "summaries" ], "properties": { "summaries": { "$ref": "#/definitions/require_any_field" } } } ] } ], "definitions": { "stac_extensions": { "type": "object", "required": [ "stac_extensions" ], "properties": { "stac_extensions": { "type": "array", "contains": { "const": "https://raw.githubusercontent.com/dchandan/stac-extension-cmip6/v1.0.0/json-schema/schema.json" } } } }, "require_any_field": { "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", "anyOf": [ {"required": ["cmip6:Conventions"]}, {"required": ["cmip6:activity_id"]}, {"required": ["cmip6:data_specs_version"]}, {"required": ["cmip6:experiment"]}, {"required": ["cmip6:experiment_id"]}, {"required": ["cmip6:forcing_index"]}, {"required": ["cmip6:frequency"]}, {"required": ["cmip6:further_info_url"]}, {"required": ["cmip6:grid"]}, {"required": ["cmip6:grid_label"]}, {"required": ["cmip6:initialization_index"]}, {"required": ["cmip6:institution"]}, {"required": ["cmip6:institution_id"]}, {"required": ["cmip6:license"]}, {"required": ["cmip6:mip_era"]}, {"required": ["cmip6:nominal_resolution"]}, {"required": ["cmip6:physics_index"]}, {"required": ["cmip6:product"]}, {"required": ["cmip6:realization_index"]}, {"required": ["cmip6:realm"]}, {"required": ["cmip6:source"]}, {"required": ["cmip6:source_id"]}, {"required": ["cmip6:source_type"]}, {"required": ["cmip6:sub_experiment"]}, {"required": ["cmip6:sub_experiment_id"]}, {"required": ["cmip6:table_id"]}, {"required": ["cmip6:variant_label"]} ] }, "fields": { "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", "type": "object", "properties": { "cmip6:Conventions": {"type": "string"}, "cmip6:activity_id": {"type": "string"}, "cmip6:data_specs_version": {"type": "string"}, "cmip6:experiment": {"type": "string"}, "cmip6:experiment_id": {"type": "string"}, "cmip6:forcing_index": {"type": "number"}, "cmip6:frequency": {"type": "string"}, "cmip6:further_info_url": {"type": "string"}, "cmip6:grid": {"type": "string"}, "cmip6:grid_label": {"type": "string"}, "cmip6:initialization_index": {"type": "number"}, "cmip6:institution": {"type": "string"}, "cmip6:institution_id": {"type": "string"}, "cmip6:license": {"type": "string"}, "cmip6:mip_era": {"type": "string"}, "cmip6:nominal_resolution": {"type": "string"}, "cmip6:physics_index": {"type": "number"}, "cmip6:product": {"type": "string"}, "cmip6:realization_index": {"type": "number"}, "cmip6:realm": {"type": "array", "items": {"type": "string"}}, "cmip6:source": {"type": "string"}, "cmip6:source_id": {"type": "string"}, "cmip6:source_type": {"type": "array", "items": {"type": "string"}}, "cmip6:sub_experiment": {"type": "string"}, "cmip6:sub_experiment_id": {"type": "string"}, "cmip6:table_id": {"type": "string"}, "cmip6:variant_label": {"type": "string"}, "cmip6:creation_date": {"type": "string"}, "cmip6:tracking_id": {"type": "string"}, "cmip6:variable_id": {"type": "string"}, "cmip6:version": {"type": "string"} }, "patternProperties": { "^(?!cmip6:)": {} }, "additionalProperties": false } } }