10

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?

2 Answers 2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.