Research in programming Wikidata/Subjects of Russia

From Wikiversity
Jump to: navigation, search

This article is devoted to the study of the most important properties of the object "The Subjects of Russia". Using the implementation of SPARQL-queries, data about the number of instances of the "Oblast of Russia", about the number of all currently existing subjects of the Russian Federation (oblast of Russia, republics, federal city of Russia, the region, autonomous okrug, autonomous regions, former administrative-territorial units) were received, the graph of neighboring subjects of the Russian Federation and countries was constructed, and the map with the population of certain subjects of the Russian Federation was drawn. Moreover, it was considered the task about fullness of property "shares border with". Also, fields with properties in the Wikidata were replenished. Reader will get acquainted with computer treatment of Wikidata and visualization of information about Russian districts.

List of oblast of Russia[edit]

Let's create a list of all oblasts of Russia.

#List of `instances of` "oblast of Russia" 
SELECT ?oblast ?oblastLabel
WHERE
{
    ?oblast wdt:P31 wd:Q835714.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

SPARQL query 48 results.

👍 The most complete and elaborate oblast of Russia on the Wikidata are: Moskow oblas, Tumen oblast, Kursk oblast

👎 Almost empty and uninformative oblast of Russia turned out to be: Chita oblast, Kostroma oblast, Orenburg oblast.

Subjects of Russian Federation[edit]

Let`s creatre a list of all subjects of Russian Federation - republics, krai, oblast, federal city of Russia, autonomous okrug, autonomous regions.

Used:

#List of `instances of` "subjects of Russia" 
SELECT ?subject ?subjectLabel
WHERE
{
  { ?subject wdt:P31 wd:Q835714 } UNION  # Oblast of Russia
  { ?subject wdt:P31 wd:Q41162 } UNION  # Republic of Russia
  { ?subject wdt:P31 wd:Q183342 } UNION  # Federal city of Russia
  { ?subject wdt:P31 wd:Q831740 } UNION  # Krai of Russia
  { ?subject wdt:P31 wd:Q309166 } UNION # Autonomus oblast of Russia
  { ?subject wdt:P31 wd:Q184122 } # Autonomus okrug of Russia
  
  FILTER NOT EXISTS {?subject wdt:P31 wd:Q19953632} # Former administrative territorial entity
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

SPARQL query 85 results.

Neighboring subjects[edit]

Let`s create the graph of neighboring subjects of Russian Federation with property "shares border with".

Used:

#Graph of "subjects of Russia" `shares border with`. 
#defaultView:Graph
SELECT ?subject ?subjectLabel ?sharesBorderWith ?sharesBorderWithLabel
WHERE
{
  { ?subject wdt:P31 wd:Q835714 } UNION  # Oblast of Russia
  { ?subject wdt:P31 wd:Q41162 } UNION  # Republic of Russia
  { ?subject wdt:P31 wd:Q183342 } UNION  # Federal city of Russia
  { ?subject wdt:P31 wd:Q831740 } UNION  # Krai of Russia
  { ?subject wdt:P31 wd:Q309166 } UNION # Autonomus oblast of Russia
  { ?subject wdt:P31 wd:Q184122 } # Autonomus okrug of Russia
  
  FILTER NOT EXISTS {?subject wdt:P31 wd:Q19953632} # Former administrative territorial entity
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
  
  ?subject wdt:P47 ?sharesBorderWith 
}

SPARQL query 467 results. The result of the script is represented in the figure.

The result of the script is a graph that displays neighboring subjects. Vertices of the graph are the names of regions and countries. Two adjacent subjects are connected by an edge

Fullness of Wikidata[edit]

According to the Constitution of the Russian Federation, Russia has 85 subjects - republics, krai, oblast, federal cities, autonomous regions, autonomous okrug.[1]

This task does not take subjects which are not part of Russian Federation at this moment (for example: Chita oblas (Q182902)), because such subjects are not instances of "Region of Russia", "republic of Russia", "federal city of Russia", "krai of Russia", "autonomus okrug of Russia", "autonomus oblast of Russia", but belong to the "former administrative territorial entity". For this task it is important that the total number of subjects of the Russian Federation without property "former administrative-territorial" become bigger. (We get 94 objects after completion SPARQL query).

According to the category "Federal subjects of Russia" of Russian Wikipedia there are 85 subjects of Russian Federation.

According to the category "Federal subjects of Russia" of Engish Wikipedia there are 85 subjects of Russian Federation too.

Let`s create the list of subjects with empty property "shares border with".

Used:

#List of "subjects of Russia" without `shares border with`. 
SELECT ?subject ?subjectLabel ?sharesBorderWith ?sharesBorderWithLabel
WHERE
{
  { ?subject wdt:P31 wd:Q835714 } UNION  # Oblast of Russia
  { ?subject wdt:P31 wd:Q41162 } UNION  # Republic of Russia
  { ?subject wdt:P31 wd:Q183342 } UNION  # Federal city of Russia
  { ?subject wdt:P31 wd:Q831740 } UNION  # Krai of Russia
  { ?subject wdt:P31 wd:Q309166 } UNION # Autonomus oblast of Russia
  { ?subject wdt:P31 wd:Q184122 } # Autonomus okrug of Russia
  
  FILTER NOT EXISTS {?subject wdt:P31 wd:Q19953632} # Former administrative territorial entity
  MINUS { ?subject  wdt:P47 [] } . #Shares border with 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
   
}

SPARQL query zero results.

All in all, there are no isolated subjects of the Russian Federation on the Wikidata, which corresponds to reality.

Population[edit]

Let's mark the subjects of the Russian Federation on the map, dividing them into 6 groups by the number of people. Subjects belonging to the same group will be displayed on the map in one color:

  • Subjects with a population less than 500,000 are painted in blue
  • Subjects with a population more than 500,000, but less than 1,000,000 are painted in orange
  • Subjects with a population more than 1,000,000, but less than 3,000,000 are painted in green
  • Subjects with a population more than 3,000,000, but less than 8,000,000 are painted in red
  • Subjects with a population more than 8,000,000, but less than 10,000,000 are painted in white
  • Subjects with a population more than 10,000,000 are painted in purple

Used:


#Map of `population` "subject of Russia"
#defaultView:Map
SELECT DISTINCT ?subject ?subjectLabel (SAMPLE(?location) AS ?location) (MAX(?population) AS ?population) (SAMPLE(?layer) AS ?layer)
WHERE
{
  {
    { ?subject wdt:P31 wd:Q835714 } UNION  # Oblast of Russia
  { ?subject wdt:P31 wd:Q41162 } UNION  # Republic of Russia
  { ?subject wdt:P31 wd:Q183342 } UNION  # Federal city of Russia
  { ?subject wdt:P31 wd:Q831740 } UNION  # Krai of Russia
  { ?subject wdt:P31 wd:Q309166 } UNION # Autonomus oblast of Russia
  { ?subject wdt:P31 wd:Q184122 } # Autonomus okrug of Russia
  }   
  ?subject wdt:P625 ?location .
  ?subject wdt:P1082 ?population .
  FILTER NOT EXISTS {?subject wdt:P31 wd:Q19953632}  # former administrative territorial entity
  BIND(
    IF(?population < 500000, "менее 500000",
    IF(?population < 1000000, "500000 - 1000000",
    IF(?population < 3000000, "1000000 - 3000000",
    IF(?population < 8000000, "3000000 - 8000000",
    IF(?population < 10000000, "8000000 - 10000000",
    "более 10000000")))))
    AS ?layer).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?subject ?subjectLabel
ORDER BY ?population

SPARQL query 85 results. The result of the script is represented in the figure below.

The map of the subjects of the Russian Federation, divided into 6 groups by the number of population and marked by different colors, depending on the group which the subject enters

Future work[edit]

  1. Arrange all subjects of Russian Federation by order of decreasing the number of territories which they border. On the basis of the data obtained, write your own opinion why some subjects have more neighbors, but others have less.
  2. Find the subjects of Russian Federation which border with foreign countries. Mark these subjects on the map.
  3. Group all subjects of Russian Federation according to the time zones they are located. Determine the total population for each group and then build a bubble diagram.

Test[edit]

1

This subject, located in the north-west of Russia, was appeared in 1923. It borders with Leningrad, Vologda, Arkhangelsk and Murmansk oblast. Also it borders with Finland in the west.
Select the flag of the subject from the description you read.

Flag of Leningrad Oblast.svg
Flag of Moscow oblast.svg
Flag of Karelia.svg
Flag of Murmansk Oblast.svg

2

Choose the represented entities which are currently part of the Russian Federation, and which are not.

Yes No
Adygeya republic
Kamchatka krai
Chita oblast
Chukotka autonomus region

3

There is a speech about the flag of which subject?
«The flag of this subject is a rectangular panel with a ratio of width to length of 2: 3, red color with a two-sided image in the upper corner of the main element of the emblem of this subject - the Saint George the Victorious. The overall width of the image of the main element of the emblem on the flag of this subject is 1/5 of the length of the flag».



Keys (SPARQL queries):

References[edit]

  1. Constitution of the Russian Federation 1993.