Search code examples
sparqlwikidatawikimedia-commonswdqs

Get image summary with Wikidata SPARQL


I get some images from Wikidata, but I would like to get more information about the image.

By example, I get the image from Paris (Try it!):

SELECT ?itemLabel ?wdLabel ?ps_Label ?wdpqLabel ?pq_Label WHERE {
  VALUES ?item { wd:Q90 }
  ?item p:P18 ?statement.
  ?statement ?ps ?ps_.
  ?wd wikibase:claim ?p;
    wikibase:statementProperty ?ps.
  OPTIONAL {
    ?statement ?pq ?pq_.
    ?wdpq wikibase:qualifier ?pq.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Giving me the following result:

enter image description here

But I would like to retrieve additional data, as we can see on Wikidata page:

  • Dimension: "4,114 x 4,235"
  • Size: "9.07 MB"

And also data from the File summary:

  • Description: "Paris : La Tour Eiffel et le Champ de Mars."
  • Date: "October 2010"
  • Source: "Own work"
  • Author: "Wladyslaw (Taxiarchos228)"
  • Etc...

Is any way to do that with SPARQL?


Solution

  • There are three aproaches:

    1. MWAPI
    2. Mediainfo
    3. WCQS

    Unfortunately, WDQS doesn't allow federation to WCQS, but the opposite is possible.