Skip to content

Instantly share code, notes, and snippets.

@tsunagun
Last active March 1, 2020 13:52
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 tsunagun/41fed0770fa00bcbf961 to your computer and use it in GitHub Desktop.
Save tsunagun/41fed0770fa00bcbf961 to your computer and use it in GitHub Desktop.
日本国内の図書館の緯度経度を取得するSPARQL式。NDLのISIL試行版LODデータセット( https://www.ndl.go.jp/jp/dlib/standards/opendataset/index.html#ISIL_trial )が対象。エンドポイントURLは https://lib-lod.tsunagun.org/sparql/isil-lod-jp/query 。Webブラウザ上で利用する場合は https://tsunagun.github.io/lib-lod/sparql/ にアクセスし、下図に従って操作してください。
prefix schema: <http://schema.org/>
prefix org: <http://www.w3.org/ns/org#>
prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT ?library ?name ?lat ?long
WHERE {
?library schema:name ?name .
OPTIONAL {
?library org:hasSite/geo:lat ?lat .
?library org:hasSite/geo:long ?long .
}
FILTER ( lang(?name) = 'ja' )
}
@tsunagun
Copy link
Author

tsunagun commented Jan 11, 2020

Webブラウザ上で使用する場合は、 https://tsunagun.github.io/lib-lod/sparql/ を開き、下記の手順でSPARQL式を実行します。

YASGUIの使い方

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment