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
SPARQLによる可視化 / sparql visualization
Search
fumi
August 31, 2016
Technology
1
570
SPARQLによる可視化 / sparql visualization
2016-08-31 に第10回 AIツールセミナー入門で行ったハンズオンの資料
fumi
August 31, 2016
Tweet
Share
More Decks by fumi
See All by fumi
オープンデータ5つ星の真実 (?) / 5 star open data
fumi
6
3.8k
海外の最新動向とこれから目指すもの / discovery-service
fumi
0
500
IMIデモンストレーション / IMI Demo
fumi
0
91
オープンデータの概要と現状 / open data in japan
fumi
5
840
IMI共通語彙基盤のオープンデータへの応用 / 20170912-imi
fumi
1
360
Code4Libカンファレンスカメラマン / Code4Lib Conference Photographer
fumi
2
140
とある研究者の写真生活 / researcher's photography life
fumi
3
2k
DBpedia Japaneseと日本語LODの広がり / DBpeida and LOD in Japanese
fumi
0
470
SPARQLライブラリの紹介 / SPARQL Library
fumi
0
250
Other Decks in Technology
See All in Technology
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
2
240
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
550
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
110
TypeScript、上達の瞬間
sadnessojisan
48
14k
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
170
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
120
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
10
1.4k
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Storybook との上手な向き合い方を考える
re_taro
5
1.5k
Next.jsとNuxtが混在? iframeでなんとかする!
ypresto
1
300
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
Producing Creativity
orderedlist
PRO
341
39k
Code Reviewing Like a Champion
maltzj
520
39k
Speed Design
sergeychernyshev
25
620
Become a Pro
speakerdeck
PRO
25
5k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Facilitating Awesome Meetings
lara
50
6.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Designing for humans not robots
tammielis
250
25k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Transcript
41"32-ʹΑΔՄࢹԽ ࠃཱใֶݚڀॴ Ճ౻จ 1 ୈճ"*πʔϧೖߨ࠲ 41"32-ʹΑΔ-0% -JOLFE0QFO%BUB ͷ׆༻
41"32-ͷՄࢹԽ ࣗલ w 41"32-݁Ռܾ·ͬͨߏͷ+40/9.-ͳͷͰɺ )551Ͱ͍߹Θͤͯ͑ྑ͍ w ଟ͘ͷݴޠͰ41"32-ॲཧ༻ͷϥΠϒϥϦ͋Δ w දࣔ෦ࣗલͰ࡞Δඞཁ͕͋Δ function
query(endpoint, sparql, callback) { var url = endpoint + "?query=" + encodeURIComponent(sparql); $.getJSON(url, function(json){ callback(json) } }
41"32-ՄࢹԽϥΠϒϥϦ w ϥΠϒϥϦʹԊͬͨΫΤϦΛॻ͚ͩ͘ͰՄࢹԽՄೳ w ϥΠϒϥϦ͕41"32-݁Ռܗ͔ࣜΒՄࢹԽϥΠϒ ϥϦͷσʔλߏͷมΛ͚ෛ͏ w ྫETQBSRMɺ3ɺTHWJ[MFSɺ41"32-5JNFMJOFS
ETQBSRMKT w+BWB4DSJQUϥΠϒϥϦ w41"32-݁ՌΛEKTͰՄࢹԽ wWFSTJPOͷҰ෦ʹରԠ wIUUQCJPIBDLBUIPOPSHETQBSRM wIUUQTHJUIVCDPNLUZNETQBSRM 4
IUUQTEKTPSH
IUUQTHJUIVCDPNEEXJLJ(BMMFSZ
IUUQCJPIBDLBUIPOPSHETQBSRM
8 IUUQTHJUIVCDPNLUZNETQBSRM
ରԠܗࣜ w $IBSU w #BSDIBSU w 4DBUUFSQMPU w 1JFDIBSU w
(SBQI w 'PSDFHSBQI w 4BOLFZ w 5SFF w %FOESPHSBN w 5SFFNBQ w 5SFFNBQ;PPN w 3PVOE5SFF w $JSDMFQBDL w 4VOCVSTU w .BQ w $PPSENBQ w /BNFENBQ w 5BCMF w )5.-5BCMF w )5.-)BTI 9
10
#BSDIBSUαϯϓϧ wIUUQTHJUIVCDPNGVNJEFYHJU wFYBNQMFTCBSDIBSUIUNMΛ։͘ w2VFSZϘλϯΛԡ͢ 11
None
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX yago: <http://dbpedia.org/class/yago/> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> SELECT
?label ?size WHERE { ?s a yago:PrefecturesOfJapan ; rdfs:label ?label; dbpedia-owl:areaTotal ?area_total . FILTER (lang(?label) = 'ja') BIND ((?area_total / 1000000) AS ?size) } ORDER BY DESC(?size)
function exec() { var endpoint = d3.select("#endpoint").property("value") var sparql =
d3.select("#sparql").property("value") d3sparql.query(endpoint, sparql, render) } function render(json) { var config = { "label_x": "ಓݝ", "label_y": "໘ੵ", "var_x": "label", "var_y": "size", "width": 800, "height": 400, "margin": 100, "selector": "#result" } d3sparql.barchart(json, config) } ରͷม໊ΛDPOpHͰࢦఆ #BSDIBSUͷݺͼग़͠
%#QFEJBͰΫΤϦ࣮ߦ wIUUQECQFEJBPSHTQBSRM wCBSDIBSUIUNMʹॻ͔Ε͍ͯΔΫΤϦΛ ίϐʔϖʔετ࣮ͯ͠ߦ 15
16
None
1JFDIBSU w CBSDIBSUIUNMΛQJFDIBSUIUNMʹίϐʔ w QJFDIBSUIUNMΛΤσΟλͰ։͘ w ETQBSRMKTͷதͷETQBSRMQJFDIBSUͷ ίϝϯτ෦Λࢀরͯ͠ɺQJFDIBSUIUNM ͷGVODUJPOSFOEFS Λॻ͖͑Δ
18
function render(json) { var config = { "label": "label", "size":
"size", "width": 600, "height": 600, "margin": 10, "hole": 200, // doughnut hole: 0 for pie, r > 0 for doughnut "selector": "#result" } d3sparql.piechart(json, config) }
None
w ਓޱີΛܭࢉͯ͠ਤͰՄࢹԽ w 5PQPKTPO w λεΫ w OBNFENBQIUNMΛ࣮ߦ w %#QFEJBͰ41"32-ΫΤϦ࣮ߦ
w OBNFENBQIUNMͷιʔεಡΈ /BNFENBQ
None
IUUQECQFEJBPSHTQBSRM
None
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX yago: <http://dbpedia.org/class/yago/> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> SELECT
DISTINCT ?s ?label ?population ?area ?density WHERE { ?s a yago:PrefecturesOfJapan ; rdfs:label ?label ; dbpedia-owl:populationTotal ?population ; dbpedia-owl:areaTotal ?area . BIND (xsd:float(?population)/xsd:float(?area/1000000) AS ?density) FILTER (lang(?label) = 'ja' ) } ORDER BY DESC(?density) ಛఆͷม໊ΛOBNFENBQͷDPOpHͰࢦఆ
function exec() { var endpoint = d3.select("#endpoint").property("value") var sparql =
d3.select("#sparql").property("value") d3sparql.query(endpoint, sparql, render) } function render(json) { var config = { "label": "label", "value": "density", "topojson": "https://gist.githubusercontent.com/fumi/ 521c759efe0648b3c1296c5a869b3406/raw/ 39e94dae1c46ed71d88529038f3ff45e681b257c/japan.topojson", "mapname": "japan", "color_max": "red", "color_min": "white", "center_lat": 34, "center_lng": 137, "scale": 1500, "selector": "#result" } d3sparql.namedmap(json, config) }
w ߏՄࢹԽͷҰͭ w TVOCVSTUIUNM w %#QFEJB+BQBOFTF w ిंӺؒͷྡؔΛՄࢹԽ 4VOCVSTU
None
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX
prop-ja: <http://ja.dbpedia.org/property/> SELECT ?root_name ?parent_name ?child_name WHERE { VALUES ?root_name { "౦ژӺ"@ja } ?root rdfs:label ?root_name . ?root prop-ja:࣍ͷӺ{1,5} ?child . ?parent prop-ja:࣍ͷӺ ?child . MINUS { ?child prop-ja:࣍ͷӺ ?parent . } ?parent rdfs:label ?parent_name . ?child rdfs:label ?child_name . FILTER (LANG(?parent_name) = 'ja') FILTER (LANG(?child_name) = 'ja') } GROUP BY ?root_name ?parent_name ?child_name
ଞͷπϦʔܥ ETQBSRMͷαΠτͰଞͷπϦʔܥՄࢹ ԽΛݟΔ wIUUQCJPIBDLBUIPOPSHETQBSRM wҙ ෆ۩߹ʹΑΓ2VFSZͰͳ͘6TF DBDIFΛ͏͜ͱ 4VOCVSTUͷྫ͕͑Δ͔ݟͯΈΔ
30
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/ libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css"/> <script src="https://d3js.org/d3.v3.min.js"></script> <link rel="stylesheet" type="text/css"
href="lib/bootstrap/css/bootstrap.css"/> <script src="lib/d3/d3.v3.min.js"></script> (JU)VCͷίʔυΛͱΓ͋͑ͣϩʔΧϧͰ࣮ߦ ͢ΔͨΊʹҎԼͷมߋΛ͢Δ
None
Ԡ༻ wଞͷՄࢹԽΛࢼ͢ w৽͍͠ΫΤϦΛߟ͑Δ wผͷ41"32-ΤϯυϙΠϯτͰࢼ͢ wIUUQTEBUBIVCJPEBUBTFU RSFT@GPSNBUBQJ'TQBSRM wIUUQMBCTNPOEFDBDPN TQBSRM&OEQPJOUT4UBUVT 33