query-44a82f6ab41f51a83801bf3e4714722a

rq turtle/ttl

Query dates with instance of statement with Gregorian date earlier than 1584 ).contribs • [[User talk:|talk]] ([[User:|?]] comment was added byunsignedThe preceding – What's the best way to query date of birth (P569) that are instances of statement with Gregorian date earlier than 1584 (Q26961029)? Try: 10 LIMIT } } ."[AUTO_LANGUAGE],en" language:wikibase serviceParam:bd { label:wikibase SERVICE ] ?dob P569:ps ; Q26961029:wd P31:pq [ P569:p ?item { WHERE ?dob ?itemLabel ?item SELECT 17:42, 14 June 2019 (UTC) JuraCurrently gives 50412 items. --- 18:26, 14 June 2019 (UTC)) talk (Clifford Anderson: Thanks so much for the quick response! This query is exactly what I was looking for. May I ask another quick follow up question? Is it possible to filter these by certain inexact date ranges, e.g. '14. century BCE'. Jura@

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?dob ?a ?b ?precision
WHERE
{
    ?item p:P569 [ pq:P31 wd:Q26961029 ; ps:P569 ?dob ]
    FILTER ( YEAR( ?dob) > -1400  && YEAR( ?dob) < -100 )     
    ?item p:P569 ?st .
    ?st ps:P569 ?dob ; psv:P569/wikibase:timePrecision ?precision . 
    FILTER( ?precision = 11) 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dob"):::projected v3("?item"):::projected v1("?precision"):::projected v4("?st") a1((" ")) a2((" ")) c5(["wd:Q26961029"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?precision = '11^^xsd:integer'"]] f0 --> v1 f1[["year-from-dateTime(?dob) > '-1400^^xsd:integer'year-from-dateTime(?dob) < '-100^^xsd:integer'"]] f1 --> v2 a1 --"p:qualifier/P31"--> c5 a1 --"p:statement/P569"--> v2 v3 --"p:P569"--> a1 v3 --"p:P569"--> v4 v4 --"p:statement/P569"--> v2 v4 --"p:statement/value/P569"--> a2 a2 --"wikibase:timePrecision"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end