Last active
December 2, 2015 00:04
-
-
Save sasaujp/487ab450220d8c033dea to your computer and use it in GitHub Desktop.
日本の野球選手の出身高校を列挙するクエリの例 ref: http://qiita.com/sasau/items/d5cb1b4cf552489cbb31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX dbp-owl: <http://dbpedia.org/ontology/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX dbpprop-ja: <http://ja.dbpedia.org/property/> | |
PREFIX dbp-category: <http://ja.dbpedia.org/resource/Category:> | |
PREFIX dbp-template: <http://ja.dbpedia.org/resource/Template:> | |
select distinct ?label ?team_label | |
where { | |
#対象は日本人の野球選手 | |
{ | |
?person dcterms:subject dbp-category:日本の野球選手 . | |
} union { | |
?person dcterms:subject dbp-category:MLBの日本人選手 . | |
} union { | |
?person dcterms:subject dbp-category:在日外国人の野球選手 . | |
} union { | |
?person dcterms:subject dbp-category:日系人の野球選手 . | |
} | |
?person rdfs:label ?label ; | |
dbp-owl:team ?team. | |
# リダイレクトページの可能性を疑う | |
{ | |
?team dbp-owl:wikiPageRedirects ?redirects . | |
?redirects dbpprop-ja:wikiPageUsesTemplate dbp-template:日本の高等学校 ; | |
rdfs:label ?team_label . | |
} union { | |
?team dbpprop-ja:wikiPageUsesTemplate dbp-template:日本の高等学校 ; | |
rdfs:label ?team_label . | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment