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%20Wien10%20Scheunenstrasse2%20Bildstock.jpg
  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
-- 
Seid unbequem, seid Sand, nicht Öl im Getriebe der Welt! - Günther Eich
,----------------------------------------------------------------------.
| Stephan Bösch-Plepelits  ❤ code ❤ urbanism ❤ free software ❤ cycling |
| Projects:                                                            |
| > OpenStreetMap: openstreetbrowser.org > openstreetmap.at            |
| > Urbanism: Radlobby Wien > Platz für Wien                           |
| Contact:                                                             |
| > Mail: [email protected] > Blog: plepe.at > Code: github.com/plepe |
| > Twitter: twitter.com/plepe > Jabber: [email protected]               |
| > Mastodon: @[email protected]                                       |
`----------------------------------------------------------------------'

_______________________________________________
Wikidata-tech mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech

Reply via email to