{
	"title": "HTK",
	"type": "object",
	"properties": {
		"locations": {
			"type": "array",
			"items": {
				"$ref": "#/$defs/Locations/Location"
			}
		}
	},
	"$defs": {
		"Geo": {
			"Bearing": {
				"title": "Bearing",
				"description": "angle in degrees from the north line (0 degrees) between -180 and 180 degrees (positive clockwise)",
				"type": "integer",
				"minimum": -180,
				"maximum": 180
			},
			"Elevation": {
				"title": "Elevation",
				"description": "feet units",
				"type": "integer"
			},
			"Latitude": {
				"title": "Latitude",
				"type": "number",
				"minimum": -90,
				"maximum": 90,
				"examples": [38]
			},
			"Longitude": {
				"title": "Longitude",
				"type": "number",
				"maximum": 180,
				"minimum": -180,
				"examples": [-111]
			},
			"Point": {
				"title": "Point",
				"description": "geographical point",
				"type": "object",
				"required": ["latitude", "longitude"],
				"properties": {
					"latitude": {
						"$ref": "#/$defs/Geo/Latitude"
					},
					"longitude": {
						"$ref": "#/$defs/Geo/Longitude"
					}
				}
			}
		},
		"Locations": {
			"Id": {
				"title": "Id",
				"description": "UUID V5 string using url 'https://htk.ttscloud.net/locations/' (597e55dc-da70-5f5b-abdc-1fd449e7d4b7)",
				"type": "string",
				"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-5[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
			},
			"Location": {
				"title": "Location",
				"type": "object",
				"required": ["id"],
				"allOf": [
					{"$ref": "#/$defs/Geo/Point"}
				],
				"properties": {
					"id": {
						"$ref": "#/$defs/Locations/Id"
					},
					"name": {
						"title": "Name",
						"type": "string"
					},
					"elevation": {
						"$ref": "#/$defs/Geo/Elevation"
					},
					"bearing": {
						"$ref": "#/$defs/Geo/Bearing"
					},
					"folders": {
						"title": "Folders",
						"type": "array",
						"items": {
							"$ref": "#/$defs/Media/Folder"
						}
					}
				}
			}
		},

		"MatchPattern": {
			"title": "Pattern",
			"description": "matching pattern for include or exclude rules",
			"type": "string",
			"examples": [
				"*.JPG",
				"(\\\\|\\/)!"
			]
		},
		"Media": {
			"Folder": {
				"type": "object",
				"required": [
					"path"
				],
				"properties": {
					"path": {
						"title": "Path",
						"description": "Absolute path or UNC",
						"type": "string",
						"oneOf": [
							{
								"title": "Absolute Path (Windows)",
								"pattern": "^[a-zA-Z]:\\\\([^\\\\<>:\"/\\\\|?*]+\\\\)*[^\\\\<>:\"/\\\\|?*]*$"
							},
							{
								"title": "Absolute Path (*NIX)",
								"pattern": "^/([^/\\0]+(/([^/\\0]+))*)*/?$"
							},
							{
								"title": "UNC Path",
								"pattern": "^\\\\\\\\[^\\\\/:*?\"<>|\\r\\n]+\\\\[^\\\\/:*?\"<>|\\r\\n]+(\\\\[^\\\\/:*?\"<>|\\r\\n]+)*$"
							}
						]
					},
					"includes": {
						"title": "Includes",
						"description": "rules for inclusion",
						"type": "array",
						"items": {
							"$ref": "#/$defs/MatchPattern"
						}
					},
					"excludes": {
						"title": "Excludes",
						"description": "rules for exclusion",
						"type": "array",
						"items": {
							"$ref": "#/$defs/MatchPattern"
						}
					}
				}
			}
		}
	}
}
