1

I would like all books in Wikipedia along with their authors and/or creator. My query should return a row for each cooperation on a book, along with the labels of the book, of the author/creator, and their role in the book

SELECT ?book ?bookLabel ?role ?roleLabel ?person ?personLabel WHERE {
  ?book wdt:P31 wd:Q571.
  ?book wdt:P50|wdt:P2085381 ?person.
  ?book ?role ?person
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .

   }
}

Labels for books and authors are printed correctly, but I cannot get a proper Label for the property role, which maps to a wdt property. For instance:

| book      | bookLabel       |  role | roleLabel                             | person  | personLabel |
| ------    | -------         | ------| ------                                | -----   |      ------ |                          
|wd:Q1213472|  The Sea Serpent|wdt:P50|http://www.wikidata.org/prop/direct/P50|wd:Q33977|  Jules Verne|

How to go about it ?

Diego Amicabile
  • 579
  • 4
  • 12

0 Answers0