Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Code for 選挙
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kwi
October 19, 2017
Technology
300
0
Share
Code for 選挙
Code for Kobe 32回資料
kwi
October 19, 2017
More Decks by kwi
See All by kwi
SmartCitizen紹介
kwi
0
350
こんなのどうかな?
kwi
1
420
加古川パスタ♡の件
kwi
0
180
給食データを味わう
kwi
0
130
rocket-up
kwi
0
67
測ってみようよ
kwi
1
470
神戸市ウェブサイト動態
kwi
0
340
Code for Japan Summit 2017 紹介
kwi
0
160
Code for Japan Summit 2017 セッション係より
kwi
0
330
Other Decks in Technology
See All in Technology
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
50k
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
110
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development with AI-DLC
yoshidashingo
0
130
チームで実践する AI-DLC 思考の軌跡を残すチェックポイント設計
belongadmin
0
2.5k
ポスター発表&デモと総括 / Poster Presentations & Demonstrations and Summary
ks91
PRO
0
190
Platform engineering for developers, architects & the rest of us (AI agents)
danielbryantuk
0
180
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
160
価格.comをAI駆動で全面刷新する ー 30年分の技術的負債を返し、次の30年の土台をつくる ー / AI Engineering Summit Tokyo 2026
tkyowa
46
50k
Sony_KMP_Journey_KotlinConf2026
sony
2
210
サイバーセキュリティ概論 / Introduction to Cybersecurity
ks91
PRO
0
140
正解のないAIプロダクトをどう導くか?dodaが挑む、ユーザーの『本音』を構造化する評価設計と検証のリアル
techtekt
PRO
0
180
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
Featured
See All Featured
Believing is Seeing
oripsolob
1
140
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
エンジニアに許された特別な時間の終わり
watany
107
250k
Chasing Engaging Ingredients in Design
codingconduct
0
210
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
Balancing Empowerment & Direction
lara
6
1.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
720
Transcript
Code for 選挙 Hiroaki KAWAI
投票しましょう • 第48回衆議院総選挙 – 小選挙区:候補者を書く – 比例区:政党名 or 候補者 •
最高裁裁判官国民審査 • 神戸市長選挙 • 神戸市議会補欠選挙
さて一体何人いるでしょうか? • 例 – 小選挙区 兵庫1区 4人 – 比例区 近畿
127人 – 裁判官 7人 – 市長選 4人 – 市議選 5人 単純合計 150 人! 比例区を除いても 20 人!
データはどこへ • 新聞や報道webには当然掲載されている • 特設サイトなんかもたくさん立ち上がる • しかし… – 公文書なのに、データ化されてない? –
各選挙管理委員会から PDF で出ていたりする – データで手に入らないこと自体が そもそも異常では?
そうだ、データしよう • Code for 選挙として立ち上がる • 事実データを整備 – 今の時代 Wikidata
があるじゃないか! – みんなで整備できるデータベース – 文章(Wikipedia)ではなく、構造化データ • 世界で共有 – 各国の議員数も取得可能
Wikidata 用語 • 「S の P は O」の形で何でも保存可能 • Sは主語、Pはプロパティ、Oは値、と呼ぶ
• P は決まっている(提案プロセスがある) • S と O は自由に作れる • 修飾子「『S P O』の Q は V」 – Q : プロパティと同様(例 出典URL) – V : 値(例 URL)
P を中心に考える • 選挙では「P3602 立候補選挙」 • S は人、O は選挙になる
検索方法(SPARQL) • 例えば「衆院選候補者の男女の人数は?」 https://github.com/codeforjapan/codeforelection/issues/70 #defaultView:BarChart SELECT (COUNT(?立候補者) AS ?立候補者数) ?性別
?性別Label WHERE { ?立候補者 wdt:P3602 wd:Q20983100. ?立候補者 wdt:P21 ?性別. SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". } } GROUP BY ?性別 ?性別Label ORDER BY DESC(?立候補者数) http://tinyurl.com/ybgxadvu
検索例(2) • 「現職最高裁判所裁判官」 SELECT ?sLabel ?任命 ?長官 WHERE { ?s
p:P39 ?st . ?st ps:P39 wd:Q11515703 . ?st pq:P580 ?任命 . OPTIONAL { ?s p:P39 ?長官 . ?長官 ps:P39 wd:Q6566884 . } FILTER NOT EXISTS { ?st pq:P582 ?o . } SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". } } http://tinyurl.com/yckhvuxy
神戸市長選データ登録しません? • 参考「2014年松戸市議会議員選挙」
FYI