Skip to content

Instantly share code, notes, and snippets.

@ewg118
Created September 22, 2023 17:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Wikdata Geonames and label place query
SELECT ?place ?placeLabel ?geonames ?country ?countryLabel ?region ?regionLabel WHERE {
BIND (<http://www.wikidata.org/entity/Q1930> as ?place)
OPTIONAL { ?place wdt:P1566 ?geonames }
OPTIONAL {?place wdt:P17 ?country }
OPTIONAL {?place wdt:P131+ ?region .
{?region wdt:P31 wd:Q35657}
UNION {?region wdt:P31 wd:Q11828004}}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment