Skip to content

Instantly share code, notes, and snippets.

@fumi
Last active April 10, 2017 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fumi/433dde77c8dcc467713aa6e2c468acd0 to your computer and use it in GitHub Desktop.
Save fumi/433dde77c8dcc467713aa6e2c468acd0 to your computer and use it in GitHub Desktop.
Wikidataで都道府県オープンデータサイト
# endpoint: https://query.wikidata.org
# result: http://tinyurl.com/mjrokvw
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?id ?idLabel ?url
WHERE {
?id p:P856 ?rank .
?rank a wikibase:BestRank ;
ps:P856 ?url ;
pq:P642 wd:Q309901 .
SERVICE wikibase:label {
bd:serviceParam wikibase:language 'ja' .
?id rdfs:label ?idLabel .
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment