Hi!
I have a problem with a SPARQL query. Hopefully you can help me.
I'd like to get wikidata articles which use a specific image in the P18 property. I'm using this simple query: SELECT ?item WHERE { ?item wdt:P18 "item.jpg". }
This works for some items, but not all.
Example 1: SELECT ?item WHERE { ?item wdt:P18 "1936-ChirkovAntonNikolaevich.jpg". } -> returns "wd:Q16718402" (https://www.wikidata.org/wiki/Q16718402)
Example 2: SELECT ?item WHERE { ?item wdt:P18 "GuentherZ 2010-02-27 0207 Wien10 Scheunenstrasse2 Bildstock.jpg". } -> returns nothing, although it is used by https://www.wikidata.org/wiki/Q33231166
This might be related to the following fact:
Example 1A: SELECT ?item ?image WHERE { ?item wdt:P18 ?image. ?item wdt:P214 "307433452". } -> the field "image" shows a string "1936-ChirkovAntonNikolaevich.jpg"
Example 2A: SELECT ?item ?foo WHERE { ?item wdt:P18 ?image. ?item wdt:P2951 "86578". } -> the field "image" shows a link to https://commons.wikimedia.org/wiki/File:GuentherZ%202010-02-27%200207%20Wien... with the text "commons:GuentherZ 2010-02-27 0207 Wien10 Scheunenstrasse2 Bildstock.jpg"
(I also tried prefixing the query image name by 'commons:', like "?item wdt:P18 "commons:image.jpg")
Please tell me if you have an idea how to solve this problem!
greetings, Stephan