query-130a902b7a068298237d607e812ac083
Query to list oblasts and republics of Russia PREFIX schema: http://schema.org/ # remember to add this SELECT DISTINCT ?region ?regionLabel ?wplink WHERE { {?region wdt:P31 wd:Q835714} UNION {?region wdt:P31 wd:Q41162} UNION {?region wdt:P31 wd:Q831740} union {?region wdt:P31 wd:Q184122} UNION {?region wdt:P31 wd:Q183342} . # region - is an instance of an oblast, republic, or krai of - Russia ?region wdt:P131 wd:Q159 . # region - is in administrative district of - Russia # BIND (wd:Q2753 AS ?region) . # Limits results to Ryazan Oblast (Q2753) # OPTIONAL {?dist wdt:P625 ?coord } # district - has geographic coordinates of - ?coord (if added column for items that exist) # OPTIONAL {?dist wdt:P18 ?pic } . # add a column for pics (p18) if there is one in WD (toggle w/next line) #MINUS {?dist wdt:P18 ?pic} . # use this instead of previous line to see items with NO PIC OPTIONAL { ?wplink schema:about ?region . # WP link - is about - ?region ?wplink schema:inLanguage "en" . ?wplink schema:isPartOf https://en.wikipedia.org/ . } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY ASC(?regionLabel)
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 bd: <http://www.bigdata.com/rdf#>
#Query to list oblasts and republics of Russia
PREFIX schema: <http://schema.org/> # remember to add this
SELECT DISTINCT ?region ?regionLabel ?wplink
WHERE {
{?region wdt:P31 wd:Q835714} UNION {?region wdt:P31 wd:Q41162} UNION {?region wdt:P31 wd:Q831740} union {?region wdt:P31 wd:Q184122}
UNION {?region wdt:P31 wd:Q183342} .
# region - is an instance of an oblast, republic, or krai of - Russia
?region wdt:P131 wd:Q159 . # region - is in administrative district of - Russia
# BIND (wd:Q2753 AS ?region) . # Limits results to Ryazan Oblast (Q2753)
# OPTIONAL {?dist wdt:P625 ?coord } # district - has geographic coordinates of - ?coord (if added column for items that exist)
# OPTIONAL {?dist wdt:P18 ?pic } . # add a column for pics (p18) if there is one in WD (toggle w/next line)
#MINUS {?dist wdt:P18 ?pic} . # use this instead of previous line to see items with NO PIC
OPTIONAL {
?wplink schema:about ?region . # WP link - is about - ?region
?wplink schema:inLanguage "en" .
?wplink schema:isPartOf <https://en.wikipedia.org/> .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ASC(?regionLabel)