{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "GeoJSON encoding of OpenSearch Response",
	"description": "Definition of document with OpenSearch Response in GeoJSON encoding.  Note that numbers in the instance should not be surrounded by double-quotes to validate against this schema. ",
	"$ref": "#/definitions/FeatureCollection",
	"definitions": {
		"Links": {
			"title": "Links",
			"description": "OGC 14-055r2",
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"Links"
					]
				}
			},
			"patternProperties": {
				"^(profiles|alternates|via|related)$": {
					"description": "OGC 14-055r2",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Link"
					}
				},
				"^(first|last|previous|next)$": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Link"
					}
				},
				"^(search|describedby)$": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Link"
					}
				}
			},
			"additionalProperties": {
				"type": "array",
				"minItems": 1,
				"items": {
					"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Link"
				}
			}
		},
		"Properties": {
			"title": "Properties",
			"type": "object",
			"allOf": [
				{
					"type": "object",
					"properties": {
						"lang": {
							"description": "OGC 14-055r2",
							"type": "string",
							"minLength": 2
						},
						"subtitle": {
							"description": "OGC 14-055r2",
							"type": "string"
						},
						"creator": {
							"description": "OGC 14-055r2",
							"type": "string"
						},
						"links": {
							"$ref": "#/definitions/Links"
						},
						"generator": {
							"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Agent"
						}
					},
					"required": [
						"lang",
						"links"
					]
				},
				{
					"$ref": "#/definitions/CommonProperties"
				}
			]
		},
		"Feature": {
			"description": "GeoJSON Feature",
			"type": "object",
			"properties": {
				"type": {
					"title": "type",
					"type": "string",
					"enum": [
						"Feature"
					]
				},
				"id": {
					"type": "string",
					"format": "uri"
				},
				"geometry": {
					"oneOf": [
						{
							"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Geometry"
						},
						{
							"type": "null"
						}
					]
				},
				"bbox": {
					"type": "array",
					"minItems": 4,
					"maxItems": 4,
					"items": {
						"type": "number"
					}
				},
				"properties": {
					"$ref": "#/definitions/Properties_"
				}
			},
			"required": [
				"type",
				"id",
				"properties"
			]
		},
		"FeatureCollection": {
			"description": "GeoJSON FeatureCollection",
			"type": "object",
			"allOf": [
				{
					"type": "object",
					"properties": {
						"@context": {
							"type": "string"
						},
						"type": {
							"description": "OGC 14-055r2",
							"type": "string",
							"enum": [
								"FeatureCollection"
							]
						},
						"id": {
							"description": "OGC 14-055r2",
							"type": "string",
							"format": "uri"
						},
						"bbox": {
							"type": "array"
						},
						"properties": {
							"$ref": "#/definitions/Properties"
						},
						"features": {
							"type": "array",
							"minItems": 0,
							"items": {
								"$ref": "#/definitions/Feature"
							}
						},
						"exceptions": {
							"type": "array",
							"minItems": 1,
							"items": {
								"$ref": "#/definitions/Exception"
							}
						}
					},
					"required": [
						"type",
						"id",
						"features"
					]
				},
				{
					"$ref": "#/definitions/ControlInformation"
				}
			]
		},
		"Queries": {
			"description": "Object with queries grouped by \"role\".  See also http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_Query_element",
			"type": "object",
			"properties": {
				"@context": {
					"type": "object"
				},
				"type": {
					"type": "string",
					"enum": [
						"Queries"
					]
				}
			},
			"patternProperties": {
				"^(request|example|correction|related|superset|subset)$": {
					"description": "OpenSearch predefined role values.",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "#/definitions/Query"
					}
				}
			},
			"additionalProperties": {
				"description": "Additional role values as per http://www.opensearch.org/Specifications/OpenSearch/1.1#Role_values.",
				"type": "array",
				"minItems": 1,
				"items": {
					"$ref": "#/definitions/Query"
				}
			}
		},
		"Query": {
			"description": "OpenSearch Query element as defined at http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_Query_element.",
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"Query"
					]
				},
				"title": {
					"type": "string"
				},
				"totalResults": {
					"type": "integer",
					"minimum": 0
				},
				"searchTerms": {
					"type": "string"
				},
				"count": {
					"type": "integer",
					"minimum": 0
				},
				"startIndex": {
					"type": "integer",
					"minimum": 0
				},
				"startPage": {
					"type": "integer",
					"minimum": 0
				},
				"language": {
					"type": "string"
				},
				"inputEncoding": {
					"type": "string"
				},
				"outputEncoding": {
					"type": "string"
				}
			},
			"additionalProperties": {
				"title": "Search parameter",
				"description": "Remaining OpenSearch query parameters and their values.",
				"type": [
					"string",
					"number"
				]
			}
		},
		"ControlInformation": {
			"type": "object",
			"properties": {
				"totalResults": {
					"type": "integer",
					"minimum": 0
				},
				"startIndex": {
					"type": "integer",
					"minimum": 0
				},
				"itemsPerPage": {
					"type": "integer",
					"minimum": 0
				},
				"queries": {
					"$ref": "#/definitions/Queries"
				}
			},
			"required": [
				"totalResults",
				"startIndex",
				"itemsPerPage"
			]
		},
		"Properties_": {
			"type": "object",
			"allOf": [
				{
					"type": "object",
					"properties": {
						"identifier": {
							"type": "string"
						},
                        "kind": {
							"description": "dct:type",
							"type": "string",
							"format": "uri"
						},
						"abstract": {
							"description": "OGC 14-055r2",
							"type": "string"
						},
						"links": {
							"$ref": "#/definitions/Links"
						}
					},
					"required": [
						"identifier"
					]
				},
				{
					"$ref": "#/definitions/CommonProperties"
				}
			]
		},
		"CommonProperties": {
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"Properties"
					]
				},
				"title": {
					"description": "OGC 14-055r2",
					"type": "string"
				},
				"updated": {
					"description": "OGC 14-055r2",
					"type": "string",
					"format": "date-time"
				},
				"date": {
					"description": "OGC 14-055r2",
					"type": "string"
				},
				"publisher": {
					"description": "OGC 14-055r2",
					"type": "string"
				},
				"rights": {
					"description": "OGC 14-055r2",
					"type": "string"
				},
				"authors": {
					"description": "OGC 14-055r2",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Agent"
					}
				},
				"categories": {
					"description": "OGC 14-055r2",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "http://geo.spacebel.be/opensearch/owc-geojson-schema.json#/definitions/Category"
					}
				}
			},
			"required": [
				"title",
				"updated"
			]
		},
		"Exception": {
			"description": "OGC 06-121r9",
			"type": "object",
			"properties": {
				"exceptionCode": {
					"description": "Represents ows:exceptionCode",
					"type": "string",
					"format": "uri"
				},
				"exceptionText": {
					"description": "Represents ows:exceptionText",
					"type": "string"
				},
				"locator": {
					"description": "Represents ows:locator.",
					"type": "string"
				}
			},
			"required": [
				"exceptionCode"
			],
			"additionalProperties": false
		},
		"ExceptionReport": {
			"description": "OGC 06-121r9",
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"ExceptionReport"
					]
				},
				"exceptions": {
					"type": "array",
					"items": {
						"$ref": "#/definitions/Exception"
					}
				}
			}
		}
	}
}