Wikidata:WikiProject India/Queries/MKar
Monument of National Importance without image edit
The following query uses these:
- Properties: heritage designation (P1435) , coordinate location (P625) , image (P18)
Features: map (Q24515275)
# Monument of National Importance without image
#defaultView:Map
SELECT ?q ?qLabel ?coords { ?q wdt:P1435 wd:Q17047615 ; wdt:P625 ?coords
MINUS { ?q wdt:P18 [] } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
- Related Wikiproject: Wikidata Names
- source query: Given name (JULY 2020)
- A list with all values of given name (P735) for persons that country of citizenship (P27) -> India (Q668)
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , country of citizenship (P27) , given name (P735)
#First name of Indians, 1937 items@27 JULY 2020 SELECT ?givenName ?givenNameLabel (COUNT(DISTINCT ?item) AS ?count) WHERE { ?item wdt:P31 wd:Q5. ?item wdt:P27 wd:Q668 . ?item wdt:P735 ?givenName . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?givenName ?givenNameLabel ORDER BY DESC(?count)
- source query: Given name (JULY 2020)
- A list for all persons that country of citizenship (P27) -> India (Q668), without given name (P735)
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , country of citizenship (P27) , given name (P735)
# Indians without first name, 41932 items@27 JUL 2020 SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5. ?item wdt:P27 wd:Q668 . FILTER NOT EXISTS { ?item wdt:P735 [] } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
- Source query: Latest items with no given names
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , country of citizenship (P27) , given name (P735)
#Indians with no first name SELECT ?item ?itemLabel WHERE { ?item wdt:P31 wd:Q5 . ?item wdt:P27 wd:Q668 . OPTIONAL {?item wdt:P735 ?givenname} . FILTER (!bound(?givenname)) . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } } ORDER BY ASC(?itemLabel)
Wikilar Indians (living) without an image edit
- Related Wikiproject: Wikidata Images
The following query uses these:
- Items: India (Q668)
- Properties: country of citizenship (P27) , image (P18) , date of death (P570) , X username (P2002)
# Most 'wikilar' living Indians citizens without an image # Wikilar as per sitelinks SELECT ?item ?itemLabel ?itemDescription (COUNT(?sitelink) AS ?sitelinks) ?twitter WHERE { ?item wdt:P27 wd:Q668 . # item is a citizen of India MINUS { ?item wdt:P18 [] }. # without an image linked at Wikidata MINUS { ?item wdt:P570 [] } . # without date of death statement ?sitelink schema:about ?item . OPTIONAL {?item wdt:P2002 ?twitter .} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } } GROUP BY ?itemLabel ?itemDescription ?twitter ?item HAVING(?sitelinks >= 10) #sitelink count to focus on the “most wikilar” people ORDER BY DESC(?sitelinks)
Indian centenarians edit
- Related Wikiproject:
The following query uses these:
- Items: human (Q5) , India (Q668) , centenarian (Q2944360)
- Properties: instance of (P31) , country of citizenship (P27) , significant event (P793) , date of birth (P569) , date of death (P570)
#Indian centenarians SELECT ?person ?personLabel ?age WHERE { ?person wdt:P31 wd:Q5. ?person wdt:P27 wd:Q668. ?person wdt:P793 wd:Q2944360. OPTIONAL { ?person wdt:P569 ?born.} OPTIONAL { ?person wdt:P570 ?died.} BIND(FLOOR((?died - ?born)/365.2425) AS ?age). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?age)
Indians died in 2021 edit
- SOURCE QUERY: https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#BIND,_BOUND,_IF
- Related Wikiproject:
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , country of citizenship (P27) , date of birth (P569) , date of death (P570)
#title:Indians deceased in 2021 ordered by the number of sitelinks SELECT ?person ?sitelinks ?personLabel ?personDescription ?born ?died ?age WHERE{ ?person wdt:P31 wd:Q5; wdt:P27 wd:Q668; wdt:P569 ?born; wdt:P570 ?died. FILTER ( ?died >= "2021-01-01T00:00:00Z"^^xsd:dateTime && ?died <= "2021-12-31T00:00:00Z"^^xsd:dateTime ) BIND(?died - ?born AS ?ageInDays). BIND(?ageInDays/365.2425 AS ?ageInYears). BIND(FLOOR(?ageInYears) AS ?age). # or, as one expression: #BIND(FLOOR((?died - ?born)/365.2425) AS ?age). # (https://en.wikibooks.org/wiki/SPARQL/Expressions_and_Functions#COUNT,_MIN,_MAX,_AVG_and_SUM) ?person wikibase:sitelinks ?sitelinks. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". } } ORDER BY DESC(?sitelinks)
Indian rails without Indian Railways train number (P8180) edit
The following query uses these:
- Items: train service (Q15141321) , India (Q668)
- Properties: instance of (P31) , country (P17) , Indian Railways train number (P8180) , start point (P1427) , destination point (P1444)
# Indian rails without Indian Railways train number (P8180) SELECT ?item ?itemLabel ?strt ?dest ?itemDescription (COUNT(?sitelink) AS ?sitelinks) ?irtno WHERE { ?item wdt:P31 wd:Q15141321. ?item wdt:P17 wd:Q668. # MINUS { ?item wdt:P8180 [] } . # without Indian Railways train number ?sitelink schema:about ?item. OPTIONAL {?item wdt:P8180 ?irtno .} OPTIONAL {?item wdt:P1427 ?strt .} OPTIONAL {?item wdt:P1444 ?dest .} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?itemLabel ?itemDescription ?twitter ?item ?irtno ?strt ?dest ORDER BY DESC (?sitelinks) #ORDER BY DESC (?irtno)
Indian participants at the 2020 Summer Olympics edit
The following query uses these:
- Items: human (Q5) , India (Q668) , 2020 Summer Olympics (Q181278)
- Properties: instance of (P31) , country for sport (P1532) , participant in (P1344) , subclass of (P279) , part of (P361) , sex or gender (P21) , sport (P641) , Olympedia people ID (P8286) , image (P18)
#title:Indian participants at the 2020 Summer Olympics SELECT ?item ?linkcount ?itemLabel ?genderLabel ?sportsLabel ?eventLabel ?olympedia_people_id WHERE { ?item wdt:P31 wd:Q5. # <<<<<< Item = Human ?item wdt:P1532 wd:Q668. # <<<<<< Country for sports = India ?item wdt:P1344 ?event. ?event ((wdt:P31/wdt:P279*)?/wdt:P361*) wd:Q181278. OPTIONAL { ?item wdt:P21 ?gender } OPTIONAL { ?item wdt:P641 ?sports } OPTIONAL {?item wdt:P8286 ?olympedia_people_id .} OPTIONAL { ?item wikibase:sitelinks ?linkcount.} #count sitelinks # MINUS{?item wdt:P18 [] .} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # for generating label } GROUP BY ?item ?statements ?linkcount ?itemLabel ?genderLabel ?sportsLabel ?eventLabel ?olympedia_people_id ORDER BY DESC(?linkcount)
Unmarried persons edit
Unknown or no values edit
There are times when an item has either no value or an unknown value for a given property. Depending on the property, these data values still provide important information about an item and should still be recorded in Wikidata. For example, we could say that Narendra Modi (Q1058) had no value for the child (P40) property, which is quite different than not recording anything at all. We could also say that Sai Baba of Shirdi (Q260440) has an unknown value for the date of birth (P569) property.
The majority of values in Wikidata will be custom values, and are entered in the usual fashion. Unknown values and no values are added to statements by clicking on the icon beside the value field that looks like this .
Unmarried Indians edit
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , country of citizenship (P27) , sex or gender (P21) , date of birth (P569) , spouse (P26)
#Unmarried Indians SELECT ?human ?humanLabel ?genderLabel ?humanDescription ?dob WHERE { ?human wdt:P31 wd:Q5 . ?human wdt:P27 wd:Q668 . ?human p:P26 ?spouceStatement . ?spouceStatement a wdno:P26 . OPTIONAL { ?human wdt:P21 ?gender. } OPTIONAL { ?human wdt:P569 ?dob. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?human ?humanLabel ?gender ?genderLabel ?humanDescription ?dob ORDER BY ?dob LIMIT 123
Newpapers of India with URL edit
- Related Wikiproject: Wikidata:WikiProject Periodicals
The following query uses these:
- Items: newspaper (Q11032) , India (Q668)
- Properties: instance of (P31) , subclass of (P279) , country (P17) , official website (P856)
#Newpapers of India having URL SELECT ?item ?itemLabel ?url WHERE { ?item wdt:P31/wdt:P279* wd:Q11032. ?item wdt:P17 wd:Q668. ?item wdt:P856 ?url. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?itemLabel
Districts of India edit
- Related Wikiproject: Wikidata:Country subdivision task force/India
The following query uses these:
- Items: district of India (Q1149652)
- Properties: instance of (P31) , located in the administrative territorial entity (P131)
#districts of India SELECT ?item ?itemLabel ?division ?divisionLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } # for generating label ?item wdt:P31 wd:Q1149652 . OPTIONAL { ?item wdt:P131 ?division. } } ORDER BY ?divisionLabel
Awards of India edit
- Related Wikiproject: WikiProject Award
The following query uses these:
- Items: India (Q668)
- Properties: award received (P166) , country (P17)
# awards of India SELECT ?award ?awardLabel ?awardDescription ?recepients { { SELECT ?award (COUNT(?person) as ?recepients) { ?person wdt:P166 ?award. ?award wdt:P17 wd:Q668. # of India } GROUP BY ?award ORDER BY DESC(?recepients) LIMIT 123 } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } } ORDER BY DESC(?recepients)
Awards without any recepient edit
The following query uses these:
- Items: award (Q618779) , India (Q668)
- Properties: instance of (P31) , country (P17) , award received (P166)
# Indian awards without a recepient, 134 items @18Aug2020 SELECT ?award ?linkcount ?awardLabel WHERE { ?award wdt:P31 wd:Q618779. ?award wdt:P17 wd:Q668. OPTIONAL{ ?recipient wdt:P166 ?award } FILTER( !BOUND(?recipient)) OPTIONAL { ?award wikibase:sitelinks ?linkcount. } #count sitelinks SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY DESC(?linkcount)
Padma Awardees of India edit
The following query uses these:
- Items: human (Q5) , Padma Vibhushan (Q672392) , Padma Vibhushan in Public Affairs (Q84042880) , Padma Vibhushan in literature & education (Q30143915) , Padma Vibhushan in science & engineering (Q30147268) , Padma Vibhushan in trade & industry (Q30147343) , Padma Bhushan (Q932650) , Padma Bhushan in science & engineering (Q30197118) , Padma Bhushan in literature & education (Q63877754) , Padma Bhushan in trade and industry (Q110686881) , Padma Shri (Q949193) , Padma Shri in arts (Q30132541) , Padma Shri in literature and education (Q30132621) , Padma Shri in Medicine (Q30132672) , Padma Shri in science & engineering (Q30132492) , Padma Shri in sports (Q30133065) , Padma Shri in social work (Q30132984) , Padma Shri in trade and industry (Q60671348) , Padma Shri in civil service (Q30132589) , Padma Shri in other fields (Q60671291) , Padma Shri in public affairs (Q60671325)
- Properties: instance of (P31) , award received (P166) , point in time (P585)
# Padma awardees (using UNION), 3759 items @26JAN2022 SELECT ?item ?linkcount ?itemLabel ?itemDescription ?awardvalLabel ?year WHERE { ?item wdt:P31 wd:Q5. # <<<<<< Item = Human ?item p:P166 ?award. ?award ps:P166 ?awardval. { ?award ps:P166 wd:Q672392. } # <<<<<< Award = Padma Vibhushan UNION { ?award ps:P166 wd:Q84042880.} # <<<<<< Padma Vibhushan_Public Affairs UNION { ?award ps:P166 wd:Q30143915 } # <<<<<< Padma Vibhushan_Literature UNION { ?award ps:P166 wd:Q30147268 } # <<<<<< Padma Vibhushan_Science and Engineering UNION { ?award ps:P166 wd:Q30147343} # <<<<<< Padma Vibhushan_Trade and Industry UNION { ?award ps:P166 wd:Q932650. } # <<<<<< Award = Padma Bhushan UNION { ?award ps:P166 wd:Q30197118} # <<<<<< Padma Bhushan in Sc. & Eng. UNION { ?award ps:P166 wd:Q63877754} # <<<<<< Award = Padma Bhushan in Lit. & Education UNION { ?award ps:P166 wd:Q110686881} # <<<<<< Award = Padma Bhushan in Trade & Industry UNION { ?award ps:P166 wd:Q949193. } # <<<<<< Award = Padma Shri UNION { ?award ps:P166 wd:Q30132541} # Art UNION { ?award ps:P166 wd:Q30132621} # Literature & Edu UNION { ?award ps:P166 wd:Q30132672} # Medicine UNION { ?award ps:P166 wd:Q30132492} # Science & Engineering UNION { ?award ps:P166 wd:Q30133065} # Sports UNION { ?award ps:P166 wd:Q30132984} # Social Work UNION { ?award ps:P166 wd:Q60671348} # Trade & Industry UNION { ?award ps:P166 wd:Q30132589} # Civil UNION { ?award ps:P166 wd:Q60671291} # Other UNION { ?award ps:P166 wd:Q60671325} # <<<<<< Padma Shri in Public Aff. OPTIONAL { ?item wikibase:sitelinks ?linkcount. } # <<<<<< Link count # Award given in year filter OPTIONAL { ?award pq:P585 ?time. }# <<<<<< Award has a time statement BIND(YEAR(?time) AS ?year) # filter(year(?time)=2022) # <<<<<< Filter for Award time = 2022 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Items without the qualifer point in time # Source: Qualifers on a Heritage Register Item (Wikidata:Request_a_query/Archive/2019/01) #filter not exists {?item p:P166 [pq:P585 [] ].} # <<<<<< filter for items without the qualifier point in time } #ORDER BY ASC(?itemLabel) ORDER BY DESC(?year) #ORDER BY DESC(?linkcount)
Airports of India edit
- Related Wikiproject: WikiProject Aviation
The following query uses these:
- Items: airport (Q1248784) , India (Q668)
- Properties: instance of (P31) , country (P17) , IATA airport code (P238) , ICAO airport code (P239) , place served by transport hub (P931) , coordinate location (P625)
# airports of India SELECT ?item ?itemLabel ?iata ?icao ?coord ?LocationLabel WHERE { ?item wdt:P31 wd:Q1248784. ?item wdt:P17 wd:Q668. ?item wdt:P238 ?iata. OPTIONAL { ?item wdt:P239 ?icao. } OPTIONAL { ?item wdt:P931 ?Location. } OPTIONAL { ?item wdt:P625 ?coord. OPTIONAL { ?item wdt:P625 ?coord1. FILTER(?coord1 < ?coord) } FILTER(!BOUND(?coord1)) } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY ?iata
Indian places without image edit
- Related page: Coordinates tracking
The following query uses these:
- Items: India (Q668)
- Properties: located in the administrative territorial entity (P131) , image (P18) , coordinate location (P625)
Features: map (Q24515275)
#defaultView:Map
# Places under Indian jurisdiction that has no photo
SELECT DISTINCT ?item ?coord {
?item wdt:P131+ wd:Q668 .
MINUS { ?item wdt:P18 [] } .
OPTIONAL { ?item wdt:P625 ?coord } .
}
Indian Biographical films edit
This query will help to find Hindi movies without IMDb.
- Related Wikiproject: WikiProject Movies
The following query uses these:
- Items: film (Q11424) , biographical film (Q645928) , India (Q668)
- Properties: instance of (P31) , genre (P136) , country of origin (P495) , publication date (P577) , subtitle (P1680) , original language of film or TV show (P364) , based on (P144) , director (P57) , composer (P86)
# Indian Biographical films, 266 items @ 02 AUG 2020 SELECT ?item ?wikis ?itemLabel ?subtitle ?langLabel (GROUP_CONCAT(DISTINCT ?year; SEPARATOR = ", ") AS ?released) ?directorLabel ?composerLabel ?basedonLabel WHERE{ ?item wdt:P31 wd:Q11424 . ?item wdt:P136 wd:Q645928. ?item wdt:P495 wd:Q668. OPTIONAL { ?item wikibase:sitelinks ?wikis. } #count sitelinks OPTIONAL { ?item wdt:P577 ?date . BIND(YEAR(?date) as ?year) } OPTIONAL { ?item wdt:P1680 ?subtitle } OPTIONAL { ?item wdt:P364 ?lang } OPTIONAL { ?item wdt:P144 ?basedon } OPTIONAL { ?item wdt:P57 ?director } OPTIONAL { ?item wdt:P86 ?composer } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?item ?itemLabel ?subtitle ?langLabel ?directorLabel ?composerLabel ?wikis ?basedonLabel ORDER BY DESC(?released)
Tenue of the former Prime Ministers of India (Bar Chart) edit
- Related Wikiproject: WikiProject Politicians
The following query uses these:
- Items: human (Q5) , India (Q668)
- Properties: instance of (P31) , office held by head of government (P1313) , position held (P39) , start time (P580) , end time (P582)
#defaultView:BarChart SELECT ?person ?personLabel (xsd:integer(FLOOR(SUM(DISTINCT ?end-?start)/365.2425)) AS ?totalYears) WHERE { ?person wdt:P31 wd:Q5; p:P39 [ ps:P39/^wdt:P1313 wd:Q668; pq:P580 ?start; pq:P582 ?end ]. BIND(xsd:integer(FLOOR((?end-?start)/365.2425)) AS ?years). SERVICE wikibase:label { bd:serviceParam wikibase:language "it", "en". } } GROUP BY ?person ?personLabel ORDER BY DESC(?totalYears)
List of Indian states with their chief ministers and their ages edit
- Source query:List of African countries with their current leaders and their ages (Source) (Wikidata weekly query #416)
The following query uses these:
- Items: state of India (Q13390680)
- Properties: instance of (P31) , head of government (P6) , date of birth (P569)
# List of Indian states with their chief ministers and their ages SELECT ?state ?stateLabel ?leader ?leaderLabel ?birthdate ?age WHERE { ?state wdt:P31 wd:Q13390680. ?state wdt:P6 ?leader. OPTIONAL { ?leader wdt:P569 ?birthdate. BIND(YEAR(NOW()) - YEAR(?birthdate) - IF(MONTH(NOW()) < MONTH(?birthdate) || (MONTH(NOW()) = MONTH(?birthdate) && DAY(NOW()) < DAY(?birthdate)), 1, 0) AS ?age) . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?stateLabel ?leaderLabel