query-fa788da6fbf62cefcceb41fc290d1f24

rq turtle/ttl

PRASANGA PANJIKA: Odia people whose birth/death anniversary is in a desired month SELECT ?item ?sitelinks ?orwiki ?itemDescription ?dob ?dod (GROUP_CONCAT(DISTINCT ?awardLabel; SEPARATOR = ", ") AS ?awards) (COUNT(DISTINCT ?award) AS ?awardn) WHERE { {?item wdt:P19 wd:Q22048 .} UNION { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q22048 } UNION {?item wdt:P103|wdt:P1412|wdt:P6886 wd:Q33810 } # native/ spoken/ written/ signed = Odia ?item wdt:P166 ?award. # item must have received an award

BIRTH AND DEATH

OPTIONAL { ?item wdt:P569 ?dob } OPTIONAL { ?item wdt:P570 ?dod } FILTER(MONTH(?dob)= 9 || MONTH(?dod) = 9)

____Odia Wiki link and article name__

?item ^schema:about ?article . ?article schema:isPartOf https://or.wikipedia.org/ ; # the sitelink points to or.wikipedia schema:name ?orwiki . # and has an article name

____Label service__

SERVICE wikibase:label { bd:serviceParam wikibase:language "or,[AUTO_LANGUAGE]". ?item schema:description ?itemDescription . ?award rdfs:label ?awardLabel. } OPTIONAL { ?item wikibase:sitelinks ?sitelinks. } #count sitelinks } GROUP BY ?item ?sitelinks ?orwiki ?itemDescription ?dob ?dod ORDER BY DESC(?awardn)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# PRASANGA PANJIKA: Odia people whose birth/death anniversary is in a desired month
SELECT ?item ?sitelinks ?orwiki ?itemDescription ?dob ?dod 
(GROUP_CONCAT(DISTINCT ?awardLabel; SEPARATOR = ", ") AS ?awards) (COUNT(DISTINCT ?award) AS ?awardn) 
WHERE {
   {?item wdt:P19 wd:Q22048 .}
   UNION  { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q22048 } 
   UNION {?item wdt:P103|wdt:P1412|wdt:P6886 wd:Q33810 } # native/ spoken/ written/ signed = Odia
 ?item wdt:P166 ?award.  # item must have received an award
#___BIRTH AND DEATH___
  OPTIONAL { ?item wdt:P569 ?dob }
  OPTIONAL { ?item wdt:P570 ?dod }
  FILTER(MONTH(?dob)= 9 || MONTH(?dod) = 9)
# ____Odia Wiki link and article name__
  ?item ^schema:about ?article .
  ?article schema:isPartOf <https://or.wikipedia.org/> ; # the sitelink points to or.wikipedia
  schema:name ?orwiki .                   # and has an article name
# ____Label service__
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "or,[AUTO_LANGUAGE]".
    ?item schema:description ?itemDescription .
    ?award rdfs:label ?awardLabel.
}
OPTIONAL { ?item wikibase:sitelinks ?sitelinks. }  #count sitelinks 
     }
GROUP BY ?item ?sitelinks ?orwiki ?itemDescription ?dob ?dod 
ORDER BY DESC(?awardn)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?article") v6("?award"):::projected v10("?awardLabel"):::projected v13("?awardn") v12("?awards") v2("?dob"):::projected v3("?dod"):::projected v4("?item"):::projected v9("?itemDescription"):::projected v8("?orwiki"):::projected v5("?pob") v11("?sitelinks"):::projected c14([https://or.wikipedia.org/]):::iri c3(["wd:Q22048"]):::iri c17(["bd:serviceParam"]):::iri c19(["or,#91;AUTO_LANGUAGE#93;"]):::literal c6(["wd:Q33810"]):::iri f0[["(month-from-dateTime(?dob) = '9^^xsd:integer' || month-from-dateTime(?dod) = '9^^xsd:integer')"]] f0 --> v2 f0 --> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P6886"--> c6 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P1412"--> c6 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P103"--> c6 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P19"--> v5 v5 --"wdt:P131"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P19"--> c3 end union0r <== or ==> union0l end v4 --"wdt:P166"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P569".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P570".-> v3 end v7 --"schema:about"--> v4 v7 --"schema:isPartOf"--> c14 v7 --"schema:name"--> v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 v4 --"schema:description"--> v9 v6 --"rdfs:label"--> v10 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wikibase:sitelinks".-> v11 end bind3[/"?awardLabel"/] v10 --o bind3 bind3 --as--o v12 bind4[/"count(?award)"/] v6 --o bind4 bind4 --as--o v13