Using Qualifiers in Wikidata-SPARQL

I am new to SPARQL / Wikidata and trying to figure out how I ask Angelina Jolie to start dating each of her spouses.

I see the information in the record of Jolie Wikidata, but I canโ€™t formulate the correct request for receiving it. I guess this has something to do with those โ€œqualifiersโ€ that I don't quite understand.

This is what I have already tried:

PREFIX p: <http://www.wikidata.org/prop/> PREFIX v: <http://www.wikidata.org/prop/statement/> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> SELECT ?x ?xLabel ?start WHERE { wd:Q13909 p:P26 ?x . ?xv:P26 wd:Q13909 . ?x pq:P580 ?start . } 

I know this is wrong. I just donโ€™t know how to fix it. I want to express the desire to know the attributes of a certain previous predicate

Thank you for your help!

ps: The answer to my request should be: Johnny Lee Miller 1995 Billy Bob Thornton March 2000 Brad Pitt August 23, 2014

+6
source share
1 answer

Finally, I managed to figure out what was going on. In wikidata, any predicate that has some attributes is actually a new object (node) called an operator. Attributes are also objects (nodes) that are associated with this new node. These attributes are called qualifiers.

So in the end, this request did the job for me:

 PREFIX v: <http://www.wikidata.org/prop/statement/> SELECT ?sp ?t WHERE { wd:Q13909 p:P26 ?s . # ?s is the new node (the statement node) ?sv:P26 ?sp . # that simulates the predicate ?s pq:P580 ?t . # this is an attribute (a qualifier) } 
+10
source

All Articles