This project consolidates information about written questions from the Canadian House of Commons. It covers Parliaments 39 to 43 (the current Parliament), April 3, 2006 to the present day. You can run the code or access the data, or read through all the sections to understand more about the background of written questions, the data we bring together, or how you can pitch in.
Written questions are a valuable form of information about the workings of government. Compared to the very constrained back-and-forth of the oral question period, written questions allow MPs to form a detailed question to which the government can provide a detailed response. You can read about the procedural rules around written questions if you want to learn more.
The written questions for each parliamentary session are listed in the Status of House Business publication, in “Part III – Written Questions”. For example, the 42nd Parliament, 1st session had 2,532 written questions. The Status index is handy, but the information it provides is limited:
- Question number
- Question asker name, riding
- Question sitting day (hidden in the XML)
- Question date
- Question title/summary
If there are any responses, it lists limited information about them:
- Response sitting day (hidden in the XML)
- Response date
- Type of response (written, verbal, or question withdrawn)
- If a written response, the sessional paper number
- If a verbal response, the day the answer was delivered (to look up in the Debates, a.k.a. Hansard)
This information is handy for a quick reference! But if we want a more comprehensive picture of written questions, we have to pull information from a few other sources.
This project pulls that information in. In addition to the variables listed above, it draws in the following:
- Full question content (pulling from the Notice Paper for the day a question was put forward, e.g., the Notice Paper for December 7, 2015, with the first four questions from the 42nd Parliament, 1st session, listed under the “Questions” section)
- For verbal responses, the responder name and response content (pulling from the Debates, e.g., the response to Q-17 in the Debates for January 25, 2016, listed under the “Questions on the Order Paper” section)
Taking advantage of the XML data offered by the House of Commons, we can automate this parsing. It’s not perfect—e.g., there are a few question/response details missing—but this goes a long way to building a consolidated list of questions and responses. We can cover back to the 39th Parliament, the earliest with full XML coverage.
If you’d just like to use the data, I’ve saved the processed data files to their own repo. The README there explains which file is which—you probably want questions_and_responses.csv
, as it’s the most processed. You can also browse the data in a datasette instance (a straightforward database/SQL interface, in your browser).
You can download and run the R code from this repo if you’d like. To prime the data, you’ll need to run the following:
source("scripts/load/update-questions-responses-from-xml.R")
source("scripts/load/update-question-details-from-web.R")
source("scripts/load/update-verbal-responses-from-web.R")
After that, source("load.R")
should be all you need.
NB! There’s a... very decent chance this is not yet a 100% reproducible repo. I likely have some pre-loaded data or pre-created folders or so on that makes it work on my machine. If you run into any problems, don’t hesitate to create an issue or reach out on Twitter.
This project and the processed data are both in pretty good shape. A great next step would be to set up a simple interface to the data, to easily peruse the questions and responses. I’ve put together a datasette instance (check out simonw/datasette
if you don’t know it already), but invite you to run with this however you like. If you do something with it, please let me know!
This project seems to fill one data gap, but there’s still a bunch of inaccessible information from written questions. Sessional papers are the most detailed form of answer, the “written” answer. They’re also inconvenient to access: you need to email the Library of Parliament, who will send you a CD with a scanned PDF.
There was a push in 2014 to publish sessional papers by default, but as of 2018 that was held up by concerns over the legal liability of publishing inacessible PDFs.
One idea on my mind is to crowdsource this request process. I’ve already started storing sessional paper PDFs that I receive, and invite you to add yours. (If you don’t want to use GitHub, feel free to send them to me and I can post them.)