{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://cityresourcegraph.com/schemas/match_response.json", "title": "Match Response", "description": "Response schema for resource match results", "type": "object", "properties": { "matches": { "type": "array", "items": { "$ref": "#/definitions/match" }, "description": "Array of matching opportunities" }, "metadata": { "type": "object", "properties": { "total_count": { "type": "integer", "minimum": 0, "description": "Total matches found" }, "query_time_ms": { "type": "integer", "minimum": 0, "description": "Query execution time" }, "cache_hit": { "type": "boolean", "description": "Whether result came from cache" }, "precision_levels": { "type": "object", "properties": { "measured": {"type": "integer"}, "estimated": {"type": "integer"}, "rough": {"type": "integer"} }, "description": "Breakdown by data precision" } }, "required": ["total_count"] } }, "required": ["matches", "metadata"], "definitions": { "match": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Match identifier" }, "compatibility_score": { "type": "number", "minimum": 0, "maximum": 1, "description": "Overall compatibility score (0-1)" }, "economic_value": { "type": "number", "description": "Estimated annual economic value (€)" }, "distance_km": { "type": "number", "minimum": 0, "description": "Distance between sites (km)" }, "source_resource": { "$ref": "https://cityresourcegraph.com/schemas/resource_flow.json" }, "target_resource": { "$ref": "https://cityresourcegraph.com/schemas/resource_flow.json" }, "transportation_estimate": { "type": "object", "properties": { "cost_per_year": {"type": "number"}, "method": {"type": "string"}, "feasibility_score": {"type": "number", "minimum": 0, "maximum": 1} } }, "risk_assessment": { "type": "object", "properties": { "technical_risk": {"type": "number", "minimum": 0, "maximum": 1}, "regulatory_risk": {"type": "number", "minimum": 0, "maximum": 1}, "market_risk": {"type": "number", "minimum": 0, "maximum": 1} } }, "partner_packet_url": { "type": "string", "format": "uri", "description": "URL to detailed partner information packet" } }, "required": ["id", "compatibility_score", "economic_value", "source_resource", "target_resource"] } }, "additionalProperties": false }