query-1b5d5537ccbf7186684a29d6fc8eb596

rq turtle/ttl

Odia people whose birth/death anniversary is today SELECT ?person ?personLabel ?dob ?dod WHERE { BIND(NOW() as $today) BIND(YEAR($today) AS $today_year) BIND(MONTH($today) AS $today_month) BIND(DAY($today) AS $today_day) ?person wdt:P31 wd:Q5. ?person wdt:P27 wd:Q668. {?person wdt:P103 wd:Q33810 } OPTIONAL { ?person wdt:P569 ?dob } OPTIONAL { ?person wdt:P570 ?dod } FILTER( $today_month = MONTH(?dob) && $today_day = DAY(?dob) || $today_month = MONTH(?dod) && $today_day = DAY(?dod) ) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

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#>
# Odia people whose birth/death anniversary is today
SELECT ?person ?personLabel ?dob ?dod WHERE {
  BIND(NOW() as $today)
  BIND(YEAR($today) AS $today_year)
  BIND(MONTH($today) AS $today_month)
  BIND(DAY($today) AS $today_day)
  ?person wdt:P31 wd:Q5.
  ?person wdt:P27 wd:Q668.
  {?person wdt:P103 wd:Q33810 }
    OPTIONAL { ?person wdt:P569 ?dob }
  OPTIONAL { ?person wdt:P570 ?dod }
  FILTER( $today_month = MONTH(?dob) && $today_day = DAY(?dob) ||  $today_month = MONTH(?dod) && $today_day = DAY(?dod) )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dob"):::projected v4("?dod"):::projected v7("?person"):::projected v5("?today") v7("?today_day") v7("?today_month") v6("?today_year") c10(["bd:serviceParam"]):::iri c4(["wd:Q668"]):::iri c2(["wd:Q5"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q33810"]):::iri f0[["(?today_month = month-from-dateTime(?dob)?today_day = day-from-dateTime(?dob) || ?today_month = month-from-dateTime(?dod)?today_day = day-from-dateTime(?dod))"]] f0 --> v7 f0 --> v2 f0 --> v7 f0 --> v4 bind1[/"NOW()"/] bind1 --as--o v5 bind2[/"year-from-dateTime(?today)"/] v5 --o bind2 bind2 --as--o v6 bind3[/"month-from-dateTime(?today)"/] v5 --o bind3 bind3 --as--o v7 bind4[/"day-from-dateTime(?today)"/] v5 --o bind4 bind4 --as--o v7 v7 --"wdt:P31"--> c2 v7 --"wdt:P27"--> c4 v7 --"wdt:P103"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P569".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P570".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end