query-f6ad39f7492291faf8d559cf11ca3a42
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
- https://query.wikidata.org/sparql
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)