Wikidata:WikiProject India/Queries/MKar

Monument of National Importance without image edit

The following query uses these:

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". } }

The following query uses these:

  • 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)
    

The following query uses these:

The following query uses these:

  • 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

The following query uses these:

  • 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:


Indians died in 2021 edit

The following query uses these:

  • 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:

  • 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:

  • 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:

  • 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

The following query uses these:

Districts of India edit

The following query uses these:

Awards of India edit

The following query uses these:

  • 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:

  • 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:

  • 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

The following query uses these:

Indian places without image edit

The following query uses these:

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.

The following query uses these:

  • 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

The following query uses these:

List of Indian states with their chief ministers and their ages edit

The following query uses these:

  • 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