ハンズオン WordPressとLODビジュアライズプラグイン“WP Sgv”
参考サイト
- uedayou.net
- GitHub:uedayou
- SlideShare:uedayou
- SPARQLクエリの書き方:http://www.slideshare.net/uedayou/sparql-48774553/38
WP Sgv
- 公式サイト http://midoriit.com/works/wp-sgv.html
- カスタマイズ版WP Sgv https://github.com/uedayou/wp-sgv
SPARQL Creator
- カスタマイズ版 SPARQL Creator(uedayou改)
WP Sgv x SPARQL Creator
WP Sgv に入力する前に、SPARQLクエリを書き換えます。
select ?birthPlace (count(?s) as ?num) where{
?s a <http://dbpedia.org/ontology/Comedian>.?s
<http://dbpedia.org/ontology/birthPlace> ?birthPlace.}
group by ?birthPlace ORDER BY DESC(?num) limit 10
- “?birthPlace” と “where”の間に ★(count(?s) as ?num)★ を挿入
- “limit 100” を ★group by ?birthPlace ORDER BY DESC(?num) limit 10★に置き換え
参考SPARQLクエリ
http://ja.dbpedia.org/resources/大阪府 を 大阪府にする例(1)
select ?birthPlace (count(?s) as ?num) where{
?s a <http://dbpedia.org/ontology/Comedian>.
?s <http://dbpedia.org/ontology/birthPlace> ?Place.
?Place rdfs:label ?birthPlace.}
group by ?birthPlace ORDER BY DESC(?num) limit 10
http://ja.dbpedia.org/resources/大阪府 を 大阪府にする例(2)
select ?birthPlace (count(?s) as ?num) where{
?s a <http://dbpedia.org/ontology/Comedian>.
?s <http://dbpedia.org/ontology/birthPlace> ?Place.
bind( substr(str(?Place), 32) as ?birthPlace) }
group by ?birthPlace ORDER BY DESC(?num) limit 10
円グラフで都道府県のみに限定した例
select ?birthPlace (count(?s) as ?num) where{
?s a <http://dbpedia.org/ontology/Comedian>.
?s <http://dbpedia.org/ontology/birthPlace> ?Place.
?Place rdf:type <http://schema.org/Place>.
?Place rdfs:label ?birthPlace.}
group by ?birthPlace ORDER BY DESC(?num)
検索すると面白いデータベース
DBpedia
- SPARQL Endpoint : http://ja.dbpedia.org/sparql
- GRAPH URI : なし
京都が出てくる本のデータ
- SPARQL Endpoint : http://lodcu.cs.chubu.ac.jp/SparqlEPCU/api/kyotobook_list
- GRAPH URI : なし
京都国際マンガミュージアムLOD
- SPARQL Endpoint : http://mdlab.slis.tsukuba.ac.jp/sparql
- GRAPH URI : http://purl.org/net/mdlab/kmm
青空文庫LOD
- SPARQL Endpoint : http://mdlab.slis.tsukuba.ac.jp/sparql
- GRAPH URI : http://purl.org/net/aozora/resources
※ 注意1
マンガミュージアム・青空文庫LODは“WP Sgv”でOutputを "json" から “jsonp” に変更してください。
※ 注意2
WP Sgv の 「チャートのオプション」を使うときは
'is3D':'true', 'title':'お笑い芸人の出身地'
のように書いてください。