I'm trying to retrieve infos about birth and death corresponding to paintors with this query, however I have an empty result if I uncomment birth and death infos.

# added before 2016-10
# Recherche de tableaux avec images
SELECT ?paintingLabel ?date ?movementLabel ?pic ?painter ?painterLabel  
                            ?painterGenderLabel ?painterCountryLabel ?birthDateLabel ?birthPlaceLabel ?deathDateLabel ?deathPlaceLabel  
        WHERE {           
  ?painting wdt:P31 wd:Q3305213. 
  ?painting wdt:P18 ?pic.
  ?painting wdt:P571 ?date.
  ?painting wdt:P135 ?movement.
  ?painting wdt:P170 ?painter.
  ?painter  wdt:P21 ?painterGender.
  ?painter  wdt:P27 ?painterCountry.
  #?painter wdt:p569 ?birthDate.
  #?painter wdt:p19 ?birthPlace.
  #?painter wdt:p570 ?deathDate.
  #?painter wdt:p20 ?deathPlace.
  SERVICE wikibase:label {            # ... include the labels
        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .


How could I modify this query to get these informations?

  • 1
    wdt:P19 (not wdt:p19) etc., and maybe OPTIONAL. Jun 23 '20 at 9:59
  • Thanks you're this was simply due to the lower case!
    – Ben
    Jun 23 '20 at 11:01
  • You might want to use OPTIONAL on some of these properties anyway. As it is you won't get results for living painters or ones with some missing information.
    – chrisis
    Jun 24 '20 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.