query-8ba88146d5d2a5aab5da440309764159

rq turtle/ttl

Most awarded Odias, #553@30JAN2021 SELECT ?item ?sitelinks ?itemLabel ?genderLabel (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. OPTIONAL { ?item wdt:P21 ?gender. } # item may have a gender SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel. ?gender rdfs:label ?genderLabel. ?award rdfs:label ?awardLabel. } OPTIONAL { ?item wikibase:sitelinks ?sitelinks. } #count sitelinks } GROUP BY ?item ?sitelinks ?itemLabel ?genderLabel ?death 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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Most awarded Odias, #553@30JAN2021 
SELECT ?item ?sitelinks ?itemLabel ?genderLabel (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.
  OPTIONAL { ?item wdt:P21 ?gender. }  # item may have a gender
SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?item rdfs:label ?itemLabel.
    ?gender rdfs:label ?genderLabel.
    ?award rdfs:label ?awardLabel.
}
  OPTIONAL { ?item wikibase:sitelinks ?sitelinks. }  #count sitelinks 
     }
GROUP BY ?item ?sitelinks ?itemLabel ?genderLabel ?death
ORDER BY DESC(?awardn)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?award"):::projected v8("?awardLabel"):::projected v11("?awardn") v10("?awards") v5("?gender") v7("?genderLabel"):::projected v2("?item"):::projected v6("?itemLabel"):::projected v3("?pob") v9("?sitelinks"):::projected c2(["wd:Q22048"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q33810"]):::iri 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; v2 --"wdt:P6886"--> c5 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P1412"--> c5 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P103"--> c5 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P19"--> v3 v3 --"wdt:P131"--> c2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P19"--> c2 end union0r <== or ==> union0l end v2 --"wdt:P166"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P21".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 v2 --"rdfs:label"--> v6 v5 --"rdfs:label"--> v7 v4 --"rdfs:label"--> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wikibase:sitelinks".-> v9 end bind2[/"?awardLabel"/] v8 --o bind2 bind2 --as--o v10 bind3[/"count(?award)"/] v4 --o bind3 bind3 --as--o v11