[
  {
    "tag": "Cross-dataset",
    "question": "Is Ontario on track to build 1.5 million homes by 2031?",
    "answer": "Downloads 2023 and 2024 housing supply CSVs for 50 municipalities with provincial targets. Joins by municipality to compare year-over-year performance against ten-year goals.",
    "punchline": "Only 15 of 50 municipalities exceeded their 2024 housing target -- down from 19 in 2023. Twelve that were on track last year fell to 'Not met'. Toronto dropped from 31,656 starts in 2023 to 20,999 in 2024. Province-wide, just 20% of the 1.3 million home target has been started.",
    "sources": [
      {
        "title": "Ontario's housing supply progress",
        "url": "https://data.ontario.ca/dataset/ontario-s-housing-supply-progress",
        "org": "Municipal Affairs and Housing"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "77ac513f"
        },
        {
          "tool": "download_resource",
          "description": "2023 + 2024 CSVs"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT a.Municipality,\n  a.\"Total 2023 housing progress\" AS starts_2023,\n  b.\"Total 2024 housing progress\" AS starts_2024,\n  a.\"Housing Target Status\" AS status_2023,\n  b.\"Housing target status\" AS status_2024\nFROM housing_2023 a\nJOIN housing_2024 b\n  ON a.Municipality = b.Municipality\nORDER BY b.\"Ten-year housing target\" DESC"
    },
    "followup": {
      "question": "Which municipalities actually exceeded their targets?",
      "answer": "Re-uses the cached 2024 data. Filters to municipalities where actual starts exceeded the annual target.",
      "punchline": "Pickering hit 173.6% of its 2024 target (1,880 starts vs 1,083 target). Oakville (133.8%), Milton (129.1%), and Waterloo (129.2%) also outperformed. But none of the five largest -- Toronto, Ottawa, Mississauga, Brampton, Hamilton -- exceeded their 2024 annual target.",
      "sources": [
        {
          "title": "Ontario's housing supply progress",
          "url": "https://data.ontario.ca/dataset/ontario-s-housing-supply-progress",
          "org": "Municipal Affairs and Housing"
        }
      ]
    }
  },
  {
    "tag": "Time series",
    "question": "How much time do Toronto subway riders lose to delays?",
    "answer": "Downloads 28,191 TTC subway delay records for 2025. Groups by line and station to find the worst bottlenecks.",
    "punchline": "10,087 delays in 2025 totalled 1,385 hours of lost service. The Yonge-University line alone racked up 46,921 minutes across 5,628 incidents. Eglinton Station had the most cumulative delay (3,122 min), while Sheppard West averaged 15.3 minutes per incident -- the longest in the system.",
    "sources": [
      {
        "title": "TTC Subway Delay Data",
        "url": "https://ckan0.cf.opendata.inter.prod-toronto.ca/dataset/ttc-subway-delay-data",
        "org": "City of Toronto"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "996cfe8d"
        },
        {
          "tool": "download_resource",
          "description": "2025 CSV, 28k rows"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT Station,\n  COUNT(*) AS delay_count,\n  SUM(\"Min Delay\") AS total_delay_min,\n  ROUND(AVG(\"Min Delay\"), 1) AS avg_delay_min\nFROM ttc_delays_2025\nWHERE \"Min Delay\" > 0\nGROUP BY Station\nORDER BY total_delay_min DESC\nLIMIT 10"
    },
    "followup": {
      "question": "Which subway line is the most unreliable?",
      "answer": "Groups the same 2025 delay data by line. Compares total delay minutes and average incident duration.",
      "punchline": "Yonge-University dominates with 56% of all delay minutes (46,921 of 83,120). Bloor-Danforth adds another 40% (32,875 min). The Sheppard line is small but troubled: 390 delays averaging 8.5 minutes each.",
      "sources": [
        {
          "title": "TTC Subway Delay Data",
          "url": "https://ckan0.cf.opendata.inter.prod-toronto.ca/dataset/ttc-subway-delay-data",
          "org": "City of Toronto"
        }
      ]
    }
  },
  {
    "tag": "Investigation",
    "question": "What are the most common food safety violations in Toronto?",
    "answer": "Downloads 149,938 DineSafe inspection records covering 22,254 establishments. Groups 92,705 rated infractions by violation type and severity.",
    "punchline": "Unsanitized equipment surfaces top the list at 13,269 occurrences. Dirty floors in food-handling rooms (11,664) and unsanitary room conditions (7,497) round out the top three. Of the 92,705 infractions with a severity rating, 4,016 were crucial -- the most serious category before closure. Total fines collected: $238,303.",
    "sources": [
      {
        "title": "Dinesafe",
        "url": "https://ckan0.cf.opendata.inter.prod-toronto.ca/dataset/dinesafe",
        "org": "City of Toronto"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "b6b4f3fb"
        },
        {
          "tool": "download_resource",
          "description": "150k inspection rows"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT \"Infraction Details\",\n  COUNT(*) AS occurrences\nFROM dinesafe\nWHERE \"Infraction Details\" IS NOT NULL\n  AND \"Infraction Details\" != ''\nGROUP BY \"Infraction Details\"\nORDER BY occurrences DESC\nLIMIT 10"
    },
    "followup": {
      "question": "How are violations enforced?",
      "answer": "Groups the same 149,938 records by severity level and enforcement action.",
      "punchline": "54,150 minor infractions, 28,750 significant, and 4,016 crucial. The most common enforcement is 'Notice to Comply' (74,035 times). Only 6 full closure orders were issued, but 457 tickets and 71 summonses were handed out.",
      "sources": [
        {
          "title": "Dinesafe",
          "url": "https://ckan0.cf.opendata.inter.prod-toronto.ca/dataset/dinesafe",
          "org": "City of Toronto"
        }
      ]
    }
  },
  {
    "tag": "Time series",
    "question": "Is voter turnout in Ontario municipal elections improving or declining?",
    "answer": "Downloads municipal election data from 2014, 2018, and 2022 -- three CSVs spanning 444 municipalities and over 10 million electors. Compares turnout across election cycles, with a focus on Ottawa versus the province.",
    "punchline": "Province-wide turnout fell from 38.6% in 2014 to 31.5% in 2022. Toronto plunged from 45.1% (2018) to 29.7% (2022). Ottawa bucked the trend entirely -- rising from 39.9% to 42.6% to 43.8% across all three elections, the only large municipality (>100,000 electors) where turnout improved.",
    "sources": [
      {
        "title": "Municipal election results",
        "url": "https://data.ontario.ca/dataset/municipal-election-results",
        "org": "Municipal Affairs and Housing"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "a5871234"
        },
        {
          "tool": "download_resource",
          "description": "2014 + 2018 + 2022 CSVs"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT a.\"MUNICIPALITY NAME\" AS city,\n  ROUND(a.voted_2018 * 100.0 /\n    a.electors_2018, 1) AS turnout_2018,\n  ROUND(b.voted_2022 * 100.0 /\n    b.electors_2022, 1) AS turnout_2022\nFROM election_2018 a\nJOIN election_2022 b\n  ON a.\"MUNICIPALITY NAME\" = b.MUNICIPALITY\nWHERE a.electors_2018 > 100000\nORDER BY turnout_2022 - turnout_2018 DESC"
    },
    "followup": {
      "question": "How does Ottawa's turnout compare to other large cities?",
      "answer": "Joins the 2018 and 2022 election tables. Filters to municipalities with over 100,000 electors and ranks by change in turnout.",
      "punchline": "Of 14 large municipalities, Ottawa is the only one where turnout rose (+1.2 points). Toronto saw the steepest decline: -15.4 points. London (-14.0), Burlington (-12.2), and Brampton (-9.9) also suffered major drops.",
      "sources": [
        {
          "title": "Municipal election results",
          "url": "https://data.ontario.ca/dataset/municipal-election-results",
          "org": "Municipal Affairs and Housing"
        }
      ]
    }
  },
  {
    "tag": "Scale callout",
    "question": "How much energy do Ontario's public buildings consume?",
    "answer": "Downloads the 2024 Broader Public Sector energy report -- 11,857 property records from 491 organizations across municipalities, hospitals, and universities. Ranks by GHG emissions.",
    "punchline": "Ontario's public sector reported 1.89 million tonnes of CO2e in 2024 across 11,238 buildings. Public hospitals lead at 682,415 tonnes, municipalities follow at 678,341, and post-secondary institutions at 529,849. Toronto's 637 municipal properties emit the most of any city at 67,309 tonnes.",
    "sources": [
      {
        "title": "Energy use and greenhouse gas emissions for the Broader Public Sector",
        "url": "https://data.ontario.ca/dataset/energy-use-and-greenhouse-gas-emissions-for-the-broader-public-sector",
        "org": "Energy, Northern Development and Mines"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "5e976319"
        },
        {
          "tool": "download_resource",
          "description": "2024 XLSX, 11.8k rows"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT Sector, Subsector,\n  COUNT(*) AS n_properties,\n  SUM(\"Number of Buildings\") AS buildings,\n  ROUND(SUM(TRY_CAST(\n    \"GHG Emissions (Metric Tons CO2e)\"\n    AS DOUBLE)), 0) AS total_ghg\nFROM bps_energy_2024\nGROUP BY Sector, Subsector\nORDER BY total_ghg DESC"
    },
    "followup": {
      "question": "Which cities have the highest-emitting municipal buildings?",
      "answer": "Groups the same 2024 data by city, filtering to municipal-sector properties.",
      "punchline": "Toronto leads with 67,309 tonnes from 637 properties. Scarborough (42,188 tonnes), Brampton (39,886), and Ottawa (39,059) round out the top four. The top 10 cities account for nearly half of all municipal emissions.",
      "sources": [
        {
          "title": "Energy use and greenhouse gas emissions for the Broader Public Sector",
          "url": "https://data.ontario.ca/dataset/energy-use-and-greenhouse-gas-emissions-for-the-broader-public-sector",
          "org": "Energy, Northern Development and Mines"
        }
      ]
    }
  },
  {
    "tag": "Geospatial",
    "question": "How much is Ontario spending on transit expansion -- and how much goes to Ottawa?",
    "answer": "Downloads the Ontario Builds transit dataset -- 610 projects with estimated budgets, coordinates, and completion dates. Groups by city and status to compare transit investment across the province.",
    "punchline": "610 transit projects worth $106.7 billion across Ontario. Toronto dominates at $88.4 billion across 126 projects. Ottawa's 44 O-Train projects total $4.5 billion -- Stage 1 (Confederation Line) is complete at $2.13 billion, and Stage 2 (Trillium Line extension, $2.37 billion) is under construction targeting 2026.",
    "sources": [
      {
        "title": "Ontario Builds: key infrastructure projects",
        "url": "https://data.ontario.ca/dataset/ontario-builds-key-infrastructure-projects",
        "org": "Infrastructure"
      }
    ],
    "hood": {
      "steps": [
        {
          "tool": "search_datasets",
          "description": "aefd72d3"
        },
        {
          "tool": "download_resource",
          "description": "610 transit projects"
        },
        {
          "tool": "query_cached",
          "description": ""
        }
      ],
      "sql": "SELECT Community,\n  COUNT(*) AS n_projects,\n  SUM(\"Estimated Total Budget ($)\")\n    AS total_budget,\n  SUM(CASE WHEN Status = 'Complete'\n    THEN 1 ELSE 0 END) AS completed\nFROM ontario_builds_transit\nGROUP BY Community\nORDER BY total_budget DESC"
    },
    "followup": {
      "question": "What is the status of Ottawa's O-Train expansion?",
      "answer": "Filters to Ottawa's 44 transit projects. Lists Stage 1 (complete), Stage 2 (under construction), and future planned stations.",
      "punchline": "Stage 1 (Confederation Line) opened with 13 stations at $2.13 billion. Seven Trillium Line stations are also complete. Stage 2 (Trillium Line extension, $2.37 billion) is the only project under construction. Beyond that, 22 stations are in planning -- 11 on Confederation Line West, 5 on Confederation Line East -- but none have budgets or target dates yet.",
      "sources": [
        {
          "title": "Ontario Builds: key infrastructure projects",
          "url": "https://data.ontario.ca/dataset/ontario-builds-key-infrastructure-projects",
          "org": "Infrastructure"
        }
      ]
    }
  }
]
