Research in programming Wikidata/Countries

This research is devoted to the study of countries based on the knowledge base of the Wikidata international project. SPARQL queries were used in order to analyse and compare "countries" objects in Wikidata. A list of all currently existing countries, a list of countries ordered by date of creation, a list of demonyms of countries were generated. A bubble chart with the forms of government of countries and a graph of neighboring countries were constructed. In addition, conclusions were drawn regarding the completeness of the Wikidata for this topic.

#List of countries in English and RussianSELECT?country?label_en?label_ruWHERE{?countrywdt:P31wd:Q6256.?countryrdfs:label?label_enfilter(lang(?label_en)="en").?countryrdfs:label?label_rufilter(lang(?label_ru)="ru").}

According to the "Russian classification of countries of the world" there are 251 countries on earth.[1]

This task does not take into account ancient, non-existent states (for example: Assyria (Q41137)), since they are not a "country" object but a "former country" object. Let us note that the number of former countries is an order of magnitude greater than the existing countries (see SPARQL query, returning more than two thousand of these countries)

It is not always possible to specify the exact date of the country's foundation for various reasons: absence, lack or inconsistency of written sources. For example, the basis of the Old Russian state is associated with the vocation of Varangian prince Rurik in 862, but there is no exact date (object Russia (Q159)). Also, some modern countries were preceded by a number of others and the date of formation of which of them should be considered as the date of creation of the country is an open question (for example, Mongolia (Q711))

#List of `instances of` "countries without a inception" SELECT?country?countryLabelWHERE{?countrywdt:P31wd:Q6256.#countryMINUS{?countrywdt:P571[]}.#inception of countrySERVICEwikibase:label{bd:serviceParamwikibase:language"en"}}

#List of countries with demonyms in EnglishSELECT?country?countryLabelWHERE{?countrywdt:P31wd:Q6256.#country?countrywdt:P1549?demonym.#demonymFILTER((LANG(?demonym))="en")SERVICEwikibase:label{bd:serviceParamwikibase:language"en"}}GROUP BY?country?countryLabel

#List of demonyms in EnglishSELECT?country?countryLabel?demonymWHERE{?countrywdt:P31wd:Q6256.#country?countrywdt:P1549?demonym.#demonymFILTER((LANG(?demonym))="en")SERVICEwikibase:label{bd:serviceParamwikibase:language"en"}}

Let's build a list of countries which do not have demonyms in English.

#List of countries without demonyms in EnglishSELECT?country?countryLabelWHERE{?countrywdt:P31wd:Q6256.# countryMINUS{?countrywdt:P1549?demonym.# except with demonymsFILTER((LANG(?demonym))="en")# in English}SERVICEwikibase:label{bd:serviceParamwikibase:language"en"}}GROUP BY?country?countryLabel

#basic form of government ranking#defaultView:BubbleChartSELECT?bfog?form(count(*)as?count)WHERE{?countrywdt:P31wd:Q6256.?countrywdt:P122?bfog.OPTIONAL{?bfogrdfs:label?formfilter(lang(?form)="ru")}}GROUP BY?bfog?formORDER BYDESC(?count)ASC(?form)

As a result of the query, we get a bubble chart with the most popular forms of government in countries. The popular forms of government of the countries are the republic (in 20 countries), the constitutional monarchy (in 18 countries), the federal republic (in 18 countries), the parliamentary republic (in 17 countries) and the presidential system (in 11 countries).

As a result of the query, we get a graph with 787 edges, where the edge is a neighborhood between the two countries. The graph represents several connected components, since there are island countries that do not have neighbors (for example, Mauritius, Maldives, Madagascar).

Calculate the first five countries with the largest population density for each continent.

Construct a column diagram showing the distribution of the number of countries by form of government. Estimate whether this distribution is a heavy tail

Build list the countries ordered by the number of neighbors. Which countries have the maximum and minimum number of neighbors, what is the average number of neighbors? Is there a correlation between this index and some other parameter of the countries?

Area: Israel 20770 square kilometers, population 8463400 people, area Mongolia 1566000 square kilometers, population 2953190 people, area Republic of Korea 100295 Square kilometers, population 50219669 people, and the area of Singapore 719.1 square kilometers, the population of 5781728 people.
Arrange the flags of these Asian countries in order of increasing population density.