query-763cbc92bbe59f39c3ed8e331962e8dc

rq turtle/ttl

Classical scholars born or dead today SELECT ?person ?personLabel ?personDescription (YEAR(?dateBirth) as ?yearBirth) (YEAR(?dateDeath) as ?yearDeath) WHERE { { ?person wdt:P106 wd:Q2468727 . } UNION { ?person wdt:P106 ?occ . ?occ wdt:P279 wd:Q2468727 } { ?person wdt:P569 ?dateBirth . BIND(MONTH(NOW()) AS ?nowMonthBirth) BIND(DAY(NOW()) AS ?nowDayBirth) FILTER (MONTH(?dateBirth) = ?nowMonthBirth && DAY(?dateBirth) = ?nowDayBirth) } UNION { ?person wdt:P570 ?dateDeath . BIND(MONTH(NOW()) AS ?nowMonthDeath) BIND(DAY(NOW()) AS ?nowDayDeath) FILTER (MONTH(?dateDeath) = ?nowMonthDeath && DAY(?dateDeath) = ?nowDayDeath) } SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". } } ORDER BY ?yearDeath ?yearBirth

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#>
# Classical scholars born or dead today
SELECT ?person ?personLabel ?personDescription (YEAR(?dateBirth) as ?yearBirth) (YEAR(?dateDeath) as ?yearDeath)
WHERE {
    { ?person wdt:P106 wd:Q2468727 . } UNION { ?person wdt:P106 ?occ . ?occ wdt:P279 wd:Q2468727 }
    { ?person wdt:P569 ?dateBirth . 
    BIND(MONTH(NOW()) AS ?nowMonthBirth)
    BIND(DAY(NOW()) AS ?nowDayBirth)
    FILTER (MONTH(?dateBirth) = ?nowMonthBirth && DAY(?dateBirth) = ?nowDayBirth) }
    UNION { ?person wdt:P570 ?dateDeath . 
    BIND(MONTH(NOW()) AS ?nowMonthDeath)
    BIND(DAY(NOW()) AS ?nowDayDeath)
    FILTER (MONTH(?dateDeath) = ?nowMonthDeath && DAY(?dateDeath) = ?nowDayDeath) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }
}
ORDER BY ?yearDeath ?yearBirth

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?dateBirth"):::projected v8("?dateDeath"):::projected v8("?nowDayBirth") v11("?nowDayDeath") v8("?nowMonthBirth") v11("?nowMonthDeath") v4("?occ") v3("?person"):::projected v11("?yearBirth") v11("?yearDeath") c2(["wd:Q2468727"]):::iri c7(["bd:serviceParam"]):::iri c9(["en,#91;AUTO_LANGUAGE#93;"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P106"--> v4 v4 --"wdt:P279"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P106"--> c2 end union0r <== or ==> union0l end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; f0[["month-from-dateTime(?dateDeath) = ?nowMonthDeathday-from-dateTime(?dateDeath) = ?nowDayDeath"]] f0 --> v8 f0 --> v11 f0 --> v11 v3 --"wdt:P570"--> v8 bind1[/"month-from-dateTime(NOW())"/] bind1 --as--o v11 bind2[/"day-from-dateTime(NOW())"/] bind2 --as--o v11 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; f3[["month-from-dateTime(?dateBirth) = ?nowMonthBirthday-from-dateTime(?dateBirth) = ?nowDayBirth"]] f3 --> v5 f3 --> v8 f3 --> v8 v3 --"wdt:P569"--> v5 bind4[/"month-from-dateTime(NOW())"/] bind4 --as--o v8 bind5[/"day-from-dateTime(NOW())"/] bind5 --as--o v8 end union1r <== or ==> union1l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind6[/"year-from-dateTime(?dateBirth)"/] v5 --o bind6 bind6 --as--o v11 bind7[/"year-from-dateTime(?dateDeath)"/] v8 --o bind7 bind7 --as--o v11