Skip to content

Instantly share code, notes, and snippets.

@egonw
Created July 24, 2020 08:38
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 egonw/d8f9f4f034bac1e6d0f550485fd50703 to your computer and use it in GitHub Desktop.
Save egonw/d8f9f4f034bac1e6d0f550485fd50703 to your computer and use it in GitHub Desktop.
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?image ?location ?distance ?sitelink WHERE {
SERVICE wikibase:around {
?item wdt:P625 ?location.
bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
bd:serviceParam wikibase:radius "[RADIUS]".
bd:serviceParam wikibase:distance ?distance.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,es,de". }
FILTER(NOT EXISTS {
?item wdt:P18 ?image
})
MINUS { ?item wdt:P31 wd:Q79007 }
OPTIONAL {
?sitelink schema:about ?item.
FILTER(REGEX(STR(?sitelink), "[AUTO_LANGUAGE].wikipedia.org/wiki/"))
}
}
ORDER BY asc(?distance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment