Skip to content

Instantly share code, notes, and snippets.

@uedayou
Last active August 29, 2015 14:06
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 uedayou/6ee17b2dc921aa286f77 to your computer and use it in GitHub Desktop.
Save uedayou/6ee17b2dc921aa286f77 to your computer and use it in GitHub Desktop.
ENDPOINT:http://db.lodc.jp/sparql
QUERY
----------------------------------------------------------------------------------------
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
select distinct ?entry ?link ?title ?lat ?long where
{
graph ?entry {
?link rdfs:label ?title;
geo:lat ?lat;
geo:long ?long.
FILTER(!regex(?title, '^[0-9]+$', 'i')).
FILTER(lang(?title)='ja').
FILTER(isnumeric(?long) && isnumeric(?lat)).
FILTER(bif:st_intersects(bif:st_point(?long, ?lat), bif:st_point(139.741357, 35.658099), 1500)).
}
}
order by bif:st_distance(bif:st_point(?long, ?lat), bif:st_point(139.741357, 35.658099))
----------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment