query-70f3df9e4ba9edc34b4331e2f1f0b183

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?item ?date1 ?date2
WHERE {
  ?item wdt:P31 wd:Q5 .
  ?item wdt:P570 ?randomDate . # hopefully this uses some index to speed things up
  ?item p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; wikibase:timeValue ?date1 ] .
  ?item p:P570/psv:P570 [ wikibase:timePrecision "11"^^xsd:integer ; wikibase:timeValue ?date2 ] .
}
LIMIT 10000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?date1"):::projected v4("?date2"):::projected v1("?item"):::projected v2("?randomDate") a2((" ")) a1((" ")) a4((" ")) a3((" ")) c9(["11^^xsd:integer"]):::literal c2(["wd:Q5"]):::iri c5(["9^^xsd:integer"]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:direct/P570"--> v2 a1 --"wikibase:timePrecision"--> c5 a1 --"wikibase:timeValue"--> v3 v1 --"p:P570"--> a2 a2 --"p:statement/value/P570"--> a1 a3 --"wikibase:timePrecision"--> c9 a3 --"wikibase:timeValue"--> v4 v1 --"p:P570"--> a4 a4 --"p:statement/value/P570"--> a3