Retrieving data from empty nodes in Wikidata

I am trying to get life expectancy data for certain people. This is problematic for people who lived some time ago. A data set, for example. Pythagoras seems to have a so-called "empty node" for date of birth (P569) . But this empty node refers to another node earliest date (P1319) , which has data that I could work very well with.

But for some reason I cannot get this node. My first attempt looked like this , but somehow this leads to a completely empty result set:

 SELECT DISTINCT ?person ?name ?dateofbirth ?earliestdateofbirth WHERE { ?person wdt:P31 wd:Q5. # This thing is Human ?person rdfs:label ?name. # Name for better conformation ?person wdt:P569 ?dateofbirth. # Birthday may result in a blank node ?dateofbirth wdt:P1319 ?earliestdateofbirth # Problem: Plausbible Birth } 

Then I found another syntax that suggested using ?person wdt:P569/wdt:P1319 ?earliestdateofbirth as a kind of β€œshortcut” syntax for explicit navigation, which I did above, but it also ends up with an empty result set .

 SELECT DISTINCT ?person ?name ?dateofbirth ?earliestdateofbirth WHERE { ?person wdt:P31 wd:Q5. # Is Human ?person rdfs:label ?name. # Name for better conformation ?person wdt:P569/wdt:P1319 ?earliestdateofbirth. } 

So, how do I access the node referenced by the empty node (in my case specifically the earliest date of birth) in Wikidata?

+1
source share
1 answer

But this empty node refers to another node ...

Everything is a little different. The earliest date property is not a _:t550690019 , but rather a property of the wd:Q10261 wdt:P569 _:t550690019 .

In the Wikidata data model, these annotations are expressed using classifiers .

Wikidat Data Model

Your request should be:

 SELECT DISTINCT ?person ?name ?dateofbirth ?earliestdateofbirth WHERE { VALUES (?person) {(wd:Q10261)} ?person wdt:P31 wd:Q5. # --Is human ?person rdfs:label ?name. # --Name for better conformation ?person p:P569/pq:P1319 ?earliestdateofbirth. FILTER (lang(?name) = "en") } 

Give it a try!


By the way, time accuracy (which is used when the date of birth is known) is another classifier:

 SELECT ?person ?personLabel ?value ?precisionLabel { VALUES (?person) {(wd:Q859) (wd:Q9235)} ?person wdt:P31 wd:Q5 ; p:P569/psv:P569 [ wikibase:timeValue ?value ; wikibase:timePrecision ?precisionInteger ] { SELECT ?precision (xsd:integer(?precisionDecimal) AS ?precisionInteger) { ?precision wdt:P2803 ?precisionDecimal . } } SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } } 

Give it a try!

+2
source

All Articles