Open main menu

User:Ranjithsiji/Queries

Melakartha Ragas in Carnatic MusicEdit

The following query uses these:

  • Properties: instance of (P31)    , use (P366)    
    1 #Ragas in Carnatic Music
    2 SELECT ?item ?itemLabel 
    3 WHERE 
    4 {
    5   ?item wdt:P31 wd:Q7410264.
    6   ?item wdt:P366 wd:Q956883
    7   SERVICE wikibase:label { bd:serviceParam wikibase:language "ml,en". }
    8 }
    

Janya Ragas in Carnatic MusicEdit

The following query uses these:

  • Properties: instance of (P31)    , use (P366)    
    1 #Ragas in Carnatic Music
    2 SELECT ?item ?itemLabel 
    3 WHERE 
    4 {
    5   ?item wdt:P31 wd:Q3534390.
    6   ?item wdt:P366 wd:Q956883
    7   SERVICE wikibase:label { bd:serviceParam wikibase:language "ml,en". }
    8 }
    

Female Scientists in WikidataEdit

The following query uses these:

Country ListsEdit

The following query uses these:

  • Properties: instance of (P31)    
    1 # List of countries
    2 SELECT ?country ?label_en ?label_ml
    3 WHERE
    4 {
    5   ?country wdt:P31 wd:Q6256.
    6   ?country rdfs:label ?label_en filter (lang(?label_en) = "en").
    7   ?country rdfs:label ?label_ml filter (lang(?label_ml) = "ml").
    8 }
    

Missing Labels in a DistrictEdit

The following query uses these:

  • Properties: located in the administrative territorial entity (P131)    
     1 # List of Places
     2 SELECT ?item ?itemLabel ?itemDescription WHERE {
     3 ?item wdt:P131 wd:Q2429655.
     4 
     5  SERVICE wikibase:label { bd:serviceParam wikibase:language "ml,en". }
     6  FILTER(NOT EXISTS {
     7    ?item rdfs:label ?lang_label.
     8    FILTER(LANG(?lang_label) = "en")
     9  })
    10 }
    11 ORDER BY ?itemLabel
    

US ScientistsEdit

US citizens whose occupation is a subclass of scientist:

The following query uses these:

  • Properties: instance of (P31)    , country of citizenship (P27)    , occupation (P106)    , subclass of (P279)    
     1 # List of SCientists
     2 SELECT ?item ?itemLabel ?article WHERE {
     3   ?item wdt:P31 wd:Q5.
     4   ?item wdt:P27 wd:Q30.
     5   ?item wdt:P106 ?occupation.
     6   ?occupation wdt:P279 wd:Q901.
     7   ?article schema:about ?item.
     8   ?article schema:inLanguage "en".
     9   ?article schema:isPartOf <https://en.wikipedia.org/>.
    10   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
    11 }
    12 GROUP BY ?item ?itemLabel ?article
    13 ORDER BY ?itemLabel
    14 LIMIT 1000
    

Districts in a State of IndiaEdit

The following query uses these:

The following query uses these:

Grampanchayats in KeralaEdit

The following query uses these:

Municipalities in KeralaEdit

The following query uses these:

  • Properties: instance of (P31)    , located in the administrative territorial entity (P131)    
     1 SELECT ?item ?len ?lml ?district ?dsten ?dstml ?dsthi WHERE {
     2   ?item wdt:P31 wd:Q15284.
     3   ?item wdt:P131/wdt:P131* wd:Q1186.
     4   ?item wdt:P131 ?district.
     5   OPTIONAL { ?item wdt:P131 ?division. ?division wdt:P31 wd:Q24943410 }
     6   OPTIONAL { ?item rdfs:label ?Lang. FILTER(LANG(?Lang)="ml") }
     7   OPTIONAL { ?item rdfs:label ?len. FILTER(LANG(?len)="en") }
     8   OPTIONAL { ?item rdfs:label ?lml. FILTER(LANG(?lml)="ml") }
     9   OPTIONAL { ?item schema:description ?den. FILTER(LANG(?den)="en") }
    10   OPTIONAL { ?item schema:description ?dml. FILTER(LANG(?dml)="ml") }
    11   OPTIONAL { ?district rdfs:label ?dsten. FILTER(LANG(?dsten)="en") }
    12   OPTIONAL { ?district rdfs:label ?dstml. FILTER(LANG(?dstml)="ml") }
    13   OPTIONAL { ?district rdfs:label ?dsthi. FILTER(LANG(?dsthi)="hi") }
    14 }