query-f6ad39f7492291faf8d559cf11ca3a42

rq turtle/ttl

TARIKHA PRASANGA:Odia people whose birth/death anniversary is on a desired date
SELECT ?item ?sitelinks ?itemLabel ?genderLabel ?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 OPTIONAL { ?item wdt:P166 ?award.} # item may have an award OPTIONAL { ?item wdt:P21 ?gender. } # item may have a gender

BIRTH AND DEATH

OPTIONAL { ?item wdt:P569 ?dob } OPTIONAL { ?item wdt:P570 ?dod } FILTER(MONTH(?dob)= 2 && DAY(?dob) = 10 || MONTH(?dod)= 2 && DAY(?dod) = 10 )

____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 rdfs:label ?itemLabel. ?item schema:description ?itemDescription . ?gender rdfs:label ?genderLabel. ?award rdfs:label ?awardLabel. } OPTIONAL { ?item wikibase:sitelinks ?sitelinks. } #count sitelinks } GROUP BY ?item ?sitelinks ?itemLabel ?itemDescription ?genderLabel ?dob ?dod ORDER BY DESC(?sitelinks)

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#>
# TARIKHA PRASANGA:Odia people whose birth/death anniversary is on a desired date  
SELECT ?item ?sitelinks ?itemLabel ?genderLabel ?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
  OPTIONAL { ?item wdt:P166 ?award.}  # item may have an award
  OPTIONAL { ?item wdt:P21 ?gender. }  # item may have a gender
#___BIRTH AND DEATH___
  OPTIONAL { ?item wdt:P569 ?dob }
  OPTIONAL { ?item wdt:P570 ?dod }
  FILTER(MONTH(?dob)= 2 && DAY(?dob) = 10 || MONTH(?dod)= 2 && DAY(?dod) = 10 )
# ____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 rdfs:label ?itemLabel.
    ?item schema:description ?itemDescription .
    ?gender rdfs:label ?genderLabel.
    ?award rdfs:label ?awardLabel.
}
  OPTIONAL { ?item wikibase:sitelinks ?sitelinks. }  #count sitelinks 
     }
GROUP BY ?item ?sitelinks ?itemLabel ?itemDescription ?genderLabel ?dob ?dod 
ORDER BY DESC(?sitelinks)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?article") v6("?award"):::projected v13("?awardLabel"):::projected v15("?awardn") v14("?awards") v2("?dob"):::projected v3("?dod"):::projected v7("?gender") v12("?genderLabel"):::projected v4("?item"):::projected v11("?itemDescription"):::projected v10("?itemLabel"):::projected v9("?orwiki") v5("?pob") v1("?sitelinks"):::projected c16([https://or.wikipedia.org/]):::iri c4(["wd:Q22048"]):::iri c19(["bd:serviceParam"]):::iri c21(["or,#91;AUTO_LANGUAGE#93;"]):::literal c7(["wd:Q33810"]):::iri f0[["(month-from-dateTime(?dob) = '2^^xsd:integer'day-from-dateTime(?dob) = '10^^xsd:integer' || month-from-dateTime(?dod) = '2^^xsd:integer'day-from-dateTime(?dod) = '10^^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"--> c7 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P1412"--> c7 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P103"--> c7 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P19"--> v5 v5 --"wdt:P131"--> c4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P19"--> c4 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P166".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P21".-> v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P569".-> v2 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P570".-> v3 end v8 --"schema:about"--> v4 v8 --"schema:isPartOf"--> c16 v8 --"schema:name"--> v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c19 --"wikibase:language"--> c21 v4 --"rdfs:label"--> v10 v4 --"schema:description"--> v11 v7 --"rdfs:label"--> v12 v6 --"rdfs:label"--> v13 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v4 -."wikibase:sitelinks".-> v1 end bind3[/"?awardLabel"/] v13 --o bind3 bind3 --as--o v14 bind4[/"count(?award)"/] v6 --o bind4 bind4 --as--o v15