Template:Wikidata check/List page

From OpenStreetMap Wiki
Jump to: navigation, search
prefix osmt: <https://wiki.openstreetmap.org/wiki/Key:>
prefix osmm: <https://www.openstreetmap.org/meta/>

SELECT ?osmId ?wdLabel ?osmType ?wd WHERE {
  # Limit to subjects that have an OSM type ('n', 'r', 'w').
  # Replace ?osmType with a string 'r' to show only relations.
  ?osmId osmm:type ?osmType .

  # Limit to subjects that have a tag called "wikidata"
  ?osmId osmt:wikidata ?wd .

  # Optionally, restrict OSM objects to those that have a specific tag (and value)
  # ?osmId osmt:place 'city' .        # exact string matching
  # ?osmId osmt:name:en ?nameen .     # unless filtered, matches all objects with this tag
  # FILTER( regex(?nameen, "A.b") )    # not very efficient

  # ?wd must be "instance of" list page, or instance of an item which is a subclass(es) of it.
  ?wd wdt:P31/wdt:P279* wd:Q13406463 .

  # Pick the first available language for the wikidata entry (creates ?wdLabel value)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,fr,it,pl,ru,es,sv,nl" . }
Run it