1

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?

logi-kal
  • 7,107
  • 6
  • 31
  • 43
Guylan DIEU
  • 111
  • 8
  • I think the image data is just part of the JPG file itself, at least file size and dimension are inherently part of it in the JPG meta data – UninformedUser Apr 08 '21 at 17:57
  • @UninformedUser Maybe Wikidata store this data somewhere. I could load images with Javascript to get size or dimension... but I don't want to do that. If Wikidata store this data, I would like to know if it is possible to get them by requesting the SPARQL service. – Guylan DIEU Apr 08 '21 at 18:27
  • ok, yeah - @StanislavKralin provided the answer. This data is not part of the RDF data but can be retrieved from an external service, which can be called via SPARQL. – UninformedUser Apr 09 '21 at 07:51

1 Answers1

3

There are three aproaches:

  1. MWAPI
  2. Mediainfo
  3. WCQS

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

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
  • 1
    good answer. By the way, there is even a Linked Dataset about images of Wikimedia Commons: http://imgpedia.dcc.uchile.cl/ - indeed with [SPARQL endpoint](http://imgpedia.dcc.uchile.cl/query) but also with an [interactive browser](http://imgpedia.dcc.uchile.cl/detail/All_Gizah_Pyramids.jpg) - they also have some kind of "distance" measure between the image descriptors it looks like. I have to keep that in mind for fun stuff maybe – UninformedUser Apr 09 '21 at 07:54