Wikidata:WikiProject US legislation
This page is outdated. . |
This page is currently inactive and is retained for historical reference. |
This WikiProject is working to import data about US legislation into Wikidata. Right now, we're working to write a bot that will import data on all bills introduced into either house of Congress from 2009 to the present from Sunlight Foundation's Congress API. The Sunlight Foundation is interested in maintaining the bot and re-running it at regular intervals.
The group was born at the Sunlight Foundation—Wikimedia DC Wikihack on 5 and 6 April 2014.
Plan
[edit]- Choose an ID scheme for US federal legislation and apply it to all the existing Wikidata items for US bills and laws 2009–present.
- Create a schema crosswalk between Sunlight's Congress API and Wikidata.
- Propose necessary new properties.
- Write a bot that fetches data from the Congress API and writes it to Wikidata according to the crosswalk. The bot must be idempotent so that it can be reused.
Proposed crosswalk
[edit]Note: The crosswalk includes fairly complex transformations as well as straight one-to-one mappings, so this proposal will dip into pseudocode when necessary.
Proposals needing input
[edit]- We should create a new property to contain the Sunlight/Govtrack bill indentifier.
- Sunlight and Govtrack: "hr3590-111" (https://github.com/unitedstates/congress/wiki/bills)
- LII Legislative Metadata proposal: "111:H.R.3590" (http://blog.law.cornell.edu/metasausage/downloads-and-related-information/)
- New York Times: "sres88" ("url_number"—session info in a different field "congress")
- What property should indicate which congressional session the bill belongs to?
- Instances of significant event (P793) should include both date and time.
- A law can be both an instance of (P31) a bill type like Q16089851 and an instance of (P31) United States public law (Q16089878)
Basic fields
[edit]- us_congress_bill_id => new P (United States Congressional bill id)
- us_congress_bill_type => instance of (P31)
- hr => "United States House of Representatives bill" (new Q)
- hres => "United States House of Representatives resolution" (new Q)
- hjres => "United States House of Representatives joint resolution" (new Q)
- hconres => "United States House of Representatives continuing resolution" (new Q)
- s => "United States Senate bill" (new Q)
- sres => "United States Senate resolution" (new Q)
- sjres => "United States Senate joint resolution" (new Q)
- sconres => "United States Senate continuing resolution" (new Q)
- bill_type number => legal citation of this text (P1031)
- "sconres" "12" => "S. Con Res. 12"
- congress => ?
- "111" => 111th United States Congress (Q170375)
- "112" => 112th United States Congress (Q170447)
- "113" => 111th United States Congress (Q170375)
- congress_url => official website (P856)
- if (enacted_as.number)
- enacted_as.law_type => instance of (P31)
- "public" => United States public law (Q16089878)
- "private" => United States private law (Q16089882)
- if (enacted_as.law_type = "public")
- "Public Law" congress enacted_as.number => legal citation of this text (P1031)
- enacted_as.law_type => instance of (P31)
Titles
[edit]- official_title: "An act entitled The Patient Protection and Affordable Care Act." => official name (new property?)
- short_title: "Patient Protection and Affordable Care Act" => LABEL
- popular_title & nicknames: "Health care reform bill" => all different values that exist become aliases
History
[edit]- history.introduced_at => new significant event (P793): Q16089828
- sponsor?
- history.introduced on => point in time (P585)
- if ( history.enacted = true )
- new significant event (P793): new Q (enactment) (there's Enactment (Q5375160) but that refers to a specific type of UK law)
- history.enacted_at => point in time (P585)
- new significant event (P793): new Q (enactment) (there's Enactment (Q5375160) but that refers to a specific type of UK law)
Actions
[edit]- for action in actions
- if ( action.type = vote ) new significant event (P793): voting (Q189760)
- acted_at => point in time (P585)
- if ( action.result = pass )
- if ( action.result = fail )
- new P (outcome): new Q (fail)
- action.chamber => new P (performer)
- veto override? (new Q)
- if (type = signed) new significant event (P793): new Q (signature)
- performer => do we have to deduce this?
- if ( type = vetoed ) new significant event (P793): veto power (Q178074)
- performer => have to deduce?
- else log the unrecognized action for analysis
- if ( action.type = vote ) new significant event (P793): voting (Q189760)
Sponsorship
[edit]The Sunlight schema provides for one sponsor (in rare cases, zero) and multiple cosponsors.
- sponsor => sponsor (P859) [this is currently used most for sports sponsors, but that's not necessarily a problem]
- sponsor_ID => new P (Bioguide ID)
- for cosponsor in cosponsors
- cosponsor.legislator => new P (cosponsor)
- consponsor.legislator.bioguide_id => new P (Bioguide ID)
- cosponsor.legislator => new P (cosponsor)
Possible future projects
[edit]- Add 'votes for' and 'votes against' qualifiers to 'voting' significant events
- One day, when there is a Bioguide–Wikidata mapping, make sponsor and cosponsor Wikidata items, not just strings
Documents
[edit]Members
[edit]- Harej (talk)
- Neil P. Quinn
- Angai369—partnerships and training director at the Sunlight Foundation
- TaraInDC
- Chandler Wiland
- Econterms—Peter Meyer
Sample Sunlight API queries
[edit]Affordable Care Act
[edit]congress.api.sunlightfoundation.com/bills?bill_id=hr3590-111
{
"results": [
{
"bill_id": "hr3590-111",
"bill_type": "hr",
"chamber": "house",
"committee_ids": [
"HSWM"
],
"congress": 111,
"cosponsors_count": 40,
"enacted_as": {
"congress": 111,
"law_type": "public",
"number": 148
},
"history": {
"active": true,
"active_at": "2009-10-07T18:35:00Z",
"awaiting_signature": false,
"enacted": true,
"enacted_at": "2010-03-23",
"house_passage_result": "pass",
"house_passage_result_at": "2010-03-22T02:48:00Z",
"senate_cloture_result": "pass",
"senate_cloture_result_at": "2009-12-23",
"senate_passage_result": "pass",
"senate_passage_result_at": "2009-12-24",
"vetoed": false
},
"introduced_on": "2009-09-17",
"last_action_at": "2010-03-23",
"last_version": {
"version_code": "enr",
"issued_on": "2010-08-25",
"version_name": "Enrolled Bill",
"bill_version_id": "hr3590-111-enr",
"urls": {
"html": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/html/BILLS-111hr3590enr.htm",
"pdf": "http://www.gpo.gov/fdsys/pkg/BILLS-111hr3590enr/pdf/BILLS-111hr3590enr.pdf"
},
"pages": 906
},
"last_version_on": "2010-08-25",
"last_vote_at": "2010-03-22T02:48:00Z",
"nicknames": [
"obamacare",
"ppaca"
],
"number": 3590,
"official_title": "An act entitled The Patient Protection and Affordable Care Act.",
"popular_title": "Health care reform bill",
"related_bill_ids": [
"hconres254-111",
"hres1203-111",
"hr3780-111",
"hr4872-111",
"s1728-111",
"s1790-111"
],
"short_title": "Patient Protection and Affordable Care Act",
"sponsor": {
"first_name": "Charles",
"last_name": "Rangel",
"middle_name": "B.",
"name_suffix": null,
"nickname": null,
"title": "Rep"
},
"sponsor_id": "R000053",
"urls": {
"congress": "http://beta.congress.gov/bill/111th/house-bill/3590",
"govtrack": "http://www.govtrack.us/congress/bills/111/hr3590",
"opencongress": "http://www.opencongress.org/bill/111-h3590/show"
},
"withdrawn_cosponsors_count": 0
}
],
"count": 1,
"page": {
"count": 1,
"per_page": 20,
"page": 1
}
}