9

This question is related to this.

We have the following query:

SELECT DISTINCT ?item ?itemLabel ?AuthorLabel ?year WHERE {  
  ?item wdt:P166 wd:Q255032.
  ?item wdt:P50 ?Author .  
  ?item wdt:P577 ?year .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }    
} 

We get items and these properties, for example Author, date of publication.

But we need to get not direct property, for example date of Award.

Item has award received property and this property has point in time property.

How can we get its value?

Alexan
  • 442
  • 4
  • 13

2 Answers2

7

The point in time property of the award received is what Wikidata calls a qualifier:

Along with sources and ranks, qualifiers allow statements to be expanded on, annotated, or contextualized beyond what can be expressed in just a simple property-value pair.

Here is the modified query to access the point in time of the award received:

SELECT ?item ?itemLabel ?authorLabel ?publicationDate ?dateOfAwardReceived WHERE {
  ?item wdt:P50 ?author .  
  ?item wdt:P577 ?publicationDate .
  ?item p:P166 ?awardReceivedStatement .
  ?awardReceivedStatement ps:P166 wd:Q255032 .
  ?awardReceivedStatement pq:P585 ?dateOfAwardReceived .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }    
}

Wikidata also has a short description and some examples about how to work with qualifiers.

Patrick Hoefler
  • 5,790
  • 4
  • 31
  • 47
3

You're trying to access qualifiers, that is statements on statements, all the doc you need is here: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Working_with_qualifiers

maxlath
  • 266
  • 1
  • 3