Can I query Wikidata for Wikimedia images related to an entity using SPARQL?

205 Views Asked by At

I know I can query Wikipedia pages from Wikidata like this:

SELECT ?place ?article WHERE {
  SERVICE wikibase:box {
    ?place wdt:P625 ?location .
    # looks like cornerwest must be south of cornereast
    # otherwise you go around the globe
    # this is lng lat
    bd:serviceParam wikibase:cornerWest "Point(1 12)"^^geo:wktLiteral .
    bd:serviceParam wikibase:cornerEast "Point(2 13)"^^geo:wktLiteral .
  }
      ?article schema:about ?place .
      ?article schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
}

and I know that - given an article title - I can query its images using the Wikipedia API like this:

https://pl.wikipedia.org/w/api.php?action=query&titles=Pearl_Harbor&format=json&prop=images

(link to results).

I would like to do that in one go - is that possible?

0

There are 0 best solutions below