{"database": "uap_deploy", "private": false, "path": "/uap_deploy", "size": 481046528, "tables": [{"name": "access_tokens", "columns": ["token_id", "token_secret", "email", "name", "note", "granted_at", "expires_at", "revoked", "last_used_at"], "primary_keys": ["token_id"], "count": 0, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "event_links", "columns": ["id", "event_id_1", "event_id_2", "distance_km", "days_apart", "link_type", "source_1", "source_2", "notes", "created_at"], "primary_keys": ["id"], "count": null, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}, {"name": "events", "columns": ["id", "canonical_id", "datetime_utc", "datetime_original", "datetime_confidence", "city", "state", "country", "latitude", "longitude", "geo_confidence", "shape", "duration_seconds", "witness_count", "witness_type", "description", "credibility_score", "anomaly_score", "scoring_version", "scoring_updated_at", "created_at", "updated_at", "content_hash"], "primary_keys": ["id"], "count": 362123, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "evidence", "column": "id", "other_column": "event_id"}], "outgoing": []}, "private": false}, {"name": "evidence", "columns": ["id", "event_id", "report_id", "evidence_type", "description", "source_url", "file_path", "confidence", "created_at"], "primary_keys": ["id"], "count": 208, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": [{"other_table": "reports", "column": "report_id", "other_column": "id"}, {"other_table": "events", "column": "event_id", "other_column": "id"}]}, "private": false}, {"name": "reports", "columns": ["id", "event_id", "source_id", "original_id", "raw_file", "access_date", "ingestion_script"], "primary_keys": [], "count": null, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [{"other_table": "evidence", "column": "id", "other_column": "report_id"}], "outgoing": []}, "private": false}, {"name": "sources", "columns": ["id", "name", "tier", "license", "base_url", "description", "created_at"], "primary_keys": ["id"], "count": 53, "hidden": false, "fts_table": null, "foreign_keys": {"incoming": [], "outgoing": []}, "private": false}], "hidden_count": 0, "views": [], "queries": [{"sql": "SELECT e.id, e.datetime_utc, CAST(SUBSTR(e.datetime_utc,1,4) AS INTEGER) as year, e.city, e.state, e.country, e.latitude, e.longitude, e.shape, e.duration_seconds, e.description, e.credibility_score, e.witness_type, s.name as source, s.tier as source_tier FROM events e JOIN reports r ON r.event_id = e.id JOIN sources s ON s.id = r.source_id WHERE e.credibility_score >= 5 AND e.latitude IS NOT NULL AND e.longitude IS NOT NULL ORDER BY e.credibility_score DESC LIMIT 5000", "title": "High Credibility Cases", "name": "high_credibility_cases", "private": false}, {"sql": "SELECT e.id, e.datetime_utc, CAST(SUBSTR(e.datetime_utc,1,4) AS INTEGER) as year, e.city, e.state, e.country, e.latitude, e.longitude, e.shape, e.duration_seconds, e.description, e.credibility_score, e.witness_type, s.name as source, s.tier as source_tier FROM events e JOIN reports r ON r.event_id = e.id JOIN sources s ON s.id = r.source_id WHERE e.latitude IS NOT NULL AND e.longitude IS NOT NULL ORDER BY e.credibility_score DESC LIMIT 5000", "title": "All Geolocated Events", "name": "events_map", "private": false}, {"sql": "SELECT DISTINCT e.id, e.datetime_utc, CAST(SUBSTR(e.datetime_utc,1,4) AS INTEGER) as year, e.city, e.state, e.country, e.latitude, e.longitude, e.shape, e.duration_seconds, e.description, e.credibility_score, e.witness_type, s.name as source, s.tier as source_tier FROM events e JOIN reports r ON r.event_id = e.id JOIN sources s ON s.id = r.source_id JOIN event_links el ON (el.event_id_1 = e.id OR el.event_id_2 = e.id) WHERE e.latitude IS NOT NULL AND e.longitude IS NOT NULL ORDER BY e.credibility_score DESC LIMIT 5000", "title": "Corroborated Cases", "name": "corroborated_cases", "private": false}, {"sql": "SELECT e.id, e.datetime_utc, \nCAST(SUBSTR(e.datetime_utc,1,4) AS INTEGER) as year,\ne.city, e.state, e.country, e.latitude, e.longitude, e.shape,\ne.duration_seconds, e.description, e.credibility_score, e.witness_type,\ns.name as source, s.tier as source_tier\nFROM events e\nJOIN reports r ON r.event_id = e.id\nJOIN sources s ON s.id = r.source_id\nWHERE s.name = :source\n  AND e.latitude IS NOT NULL\n  AND e.longitude IS NOT NULL\nORDER BY \n  CASE WHEN e.datetime_utc IS NOT NULL AND e.datetime_utc != '' THEN 0 ELSE 1 END,\n  e.credibility_score DESC\nLIMIT 5000", "title": "Events by source", "description": "All geolocated events for a specific source, dated records first", "name": "source_events", "private": false}, {"sql": "SELECT e.id, e.datetime_utc, CAST(SUBSTR(e.datetime_utc,1,4) AS INTEGER) as year,\ne.city, e.state, e.country, e.latitude, e.longitude, e.shape,\ne.duration_seconds, e.description, e.credibility_score, e.witness_type,\ns.name as source, s.tier as source_tier\nFROM events e\nJOIN reports r ON r.event_id = e.id\nJOIN sources s ON s.id = r.source_id\nWHERE e.latitude IS NOT NULL AND e.longitude IS NOT NULL\nORDER BY RANDOM()\nLIMIT 5000", "title": "Balanced random sample", "description": "Random 5000 geolocated events across all sources", "name": "events_map_balanced", "private": false}, {"sql": "SELECT DISTINCT e.id, e.datetime_utc, e.city, e.state, e.country, e.shape,\n       e.credibility_score, s.name as source, COUNT(el.id) as link_count\nFROM events e\nJOIN reports r ON r.event_id = e.id\nJOIN sources s ON s.id = r.source_id\nJOIN event_links el ON (el.event_id_1 = e.id OR el.event_id_2 = e.id)\nJOIN events e2 ON (CASE WHEN el.event_id_1 = e.id THEN el.event_id_2 ELSE el.event_id_1 END) = e2.id\nWHERE e.credibility_score >= 5 AND e2.credibility_score >= 5\nGROUP BY e.id\nORDER BY e.credibility_score DESC\nLIMIT 2000", "title": "Graph nodes \u2014 all credibility >= 5 corroborated events", "name": "graph_nodes", "private": false}, {"sql": "SELECT el.event_id_1, el.event_id_2, el.distance_km, el.days_apart, el.source_1, el.source_2\nFROM event_links el\nJOIN events e1 ON e1.id = el.event_id_1\nJOIN events e2 ON e2.id = el.event_id_2\nWHERE e1.credibility_score >= 5 AND e2.credibility_score >= 5\nORDER BY e1.credibility_score + e2.credibility_score DESC\nLIMIT 3000", "title": "Graph links \u2014 credibility >= 5 pairs", "name": "graph_links", "private": false}], "allow_execute_sql": true, "query_ms": 2301.619028672576}