659
edits
Line 1,086: | Line 1,086: | ||
</sparql> | </sparql> | ||
=== | ===Full values: dates === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # query for full values to access the timeValue and timePrecision of a date, in this case a date of birth. | ||
## simple | |||
## why is a more complex query needed? | |||
## simple value for a date doesn't differentiate between (eg) "1880" and "1 January 1880"; both are returned as 1 January 1880 (and SELECT DISTINCT will collapse them into a single result) | |||
## there are 14 codes for precision from billion years to second. 7: century, 8: decade, 9: year, 10: month, 11: day | ## there are 14 codes for precision from billion years to second. 7: century, 8: decade, 9: year, 10: month, 11: day | ||
## NB | ## NB additional bnpsv: prefix | ||
## https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Value_representation | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,106: | Line 1,109: | ||
SELECT DISTINCT ?item ?itemLabel ?date ?precision | SELECT DISTINCT ?item ?itemLabel ?date ?precision | ||
WHERE { | WHERE { | ||
?item bnp:P26 ?statement. # date of birth (these | ?item bnp:P26 ?statement. # date of birth (precision of these varies quite a bit) | ||
?statement bnpsv:P26 ?valueNode. | ?statement bnpsv:P26 ?valueNode. | ||
?valueNode wikibase:timeValue ?date. | ?valueNode wikibase:timeValue ?date. |
edits