2

I have an example query of

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?person ?personLabel ?image WHERE {
  ?person wdt:P31 wd:Q5.
  ?person wdt:P18 ?image.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }

}

And I want to use a credit below the picture as in

Foto: Martina Nolte Lizenz: Creative Commons by-sa 3.0 de / Kurz

How do I add columns for each part, ie

name of photographer - link to profile - license - short version of license

I tried too much to list.

Termininja
  • 6,620
  • 12
  • 48
  • 49
Aurelius Schnitzler
  • 511
  • 2
  • 8
  • 18

1 Answers1

1

I don't think you can get those credits data from Wikidata Query at the moment, but there is a tool on wmflabs.org that offers just that: http://tools.wmflabs.org/magnus-toolserver/commonsapi.php

So P18 gives you the file name on Commons, then you just have to request: http://tools.wmflabs.org/magnus-toolserver/commonsapi.php?image=Eduardo%20Frei%20Chiledebate.jpg

It respond in XML only unfortunately.

maxlath
  • 1,804
  • 15
  • 24