query-99ceb766f76deb0c44971ce6a57d82c6
I’d say that the first one is more straightforward, but it turns out the second one is much faster, so let’s use that:
Use at
- https://query.wikidata.org/sparql
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?dob
WHERE
{
?person wdt:P31 wd:Q5;
wdt:P569 ?dob.
FILTER("2015-01-01"^^xsd:date <= ?dob && ?dob < "2016-01-01"^^xsd:dat)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?dob"):::projected
v2("?person"):::projected
c7(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c9(["en"]):::literal
f0[["'2015-01-01^^xsd:date' <= ?dob?dob < s2016-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]]
f0 --> v1
v2 --"wdt:P31"--> c4
v2 --"wdt:P569"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end