query-e02edea9684f032707814202784e97a1
Whose birthday is today? SELECT ?entityLabel (YEAR(?date) AS ?year) (((YEAR(NOW())) - (YEAR(?date))) / 10 AS ?anniversary) WHERE { BIND(MONTH(NOW()) AS ?nowMonth) BIND(DAY(NOW()) AS ?nowDay) ?entity wdt:P569 ?date. SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } FILTER(((MONTH(?date)) = ?nowMonth) && ((DAY(?date)) = ?nowDay)) } LIMIT 10
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Whose birthday is today?
SELECT ?entityLabel (YEAR(?date) AS ?year) (((YEAR(NOW())) - (YEAR(?date))) / 10 AS ?anniversary) WHERE {
BIND(MONTH(NOW()) AS ?nowMonth)
BIND(DAY(NOW()) AS ?nowDay)
?entity wdt:P569 ?date.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
FILTER(((MONTH(?date)) = ?nowMonth) && ((DAY(?date)) = ?nowDay))
}
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?anniversary")
v1("?date"):::projected
v4("?entity")
v4("?nowDay")
v4("?nowMonth")
v5("?year")
c3(["bd:serviceParam"]):::iri
c5(["en"]):::literal
f0[["month-from-dateTime(?date) = ?nowMonthday-from-dateTime(?date) = ?nowDay"]]
f0 --> v1
f0 --> v4
f0 --> v4
bind1[/"month-from-dateTime(NOW())"/]
bind1 --as--o v4
bind2[/"day-from-dateTime(NOW())"/]
bind2 --as--o v4
v4 --"wdt:P569"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c3 --"wikibase:language"--> c5
end
bind3[/"year-from-dateTime(?date)"/]
v1 --o bind3
bind3 --as--o v5
bind4[/"year-from-dateTime(NOW()) - year-from-dateTime(?date) / '10^^xsd:integer'"/]
v1 --o bind4
bind4 --as--o v6