A country without war

I saw the question “Is the a country that has never been in a war?” qui renvoie à

World peace? These are the only 11 countries in the world that are actually free from conflict

and I thought that’s a good exercise for the semantic web. I think it will help me to illustrate the power and limitations of large masses of data made freely available on the web and machine-readable (LOD, Linked Open Data).

The references above suggest a particular dimension of the issue: the time dimension! What period are we talking about? More later. But first interrogate some concepts: country, war, region.


First, consider what we have as a country in DBPedia. Let’s start with the concept Country

select count(distinct ?pays) where {
?pays a <http://dbpedia.org/ontology/Country> .

giving 3294. Surprising! I had in mind that there are just under 200 countries in the World. A google search “countries count in the world” gives further guidance. We find for example that the IEP considers 162 countries in a recent study. And the UN seems to recognize 197 (see https://www.countries-ofthe-world.com/how-many-countries.html). In this case, it is only countries constituting sovereign states (see https://en.wikipedia.org/wiki/List_of_sovereign_states).

Wikipedia gives us an indication of a time dimension. The french article Liste des pays du Monde evokes the evolution of the number of countries over time.

While DBpedia identifies missing today states, the disparity is huge. We’ll have to understand what differentiates the Country concept in DBPedia and, for example, countries recognized by the UN and how to reconcile the two approaches.

For example we see on http://dbpedia.org/resource/Venezuela many types associated with this entity, including: Country by Yago (5528 entities), schema.org  (5506 entities), umbel (2385 entities) wikidata: Q6256 (5506 units). These variations probably will not help.


Let military conflicts listed by DBPedia. I retained the MilitaryConflict concept.

select count(distinct ?conflict) where {
?conflict a <http://dbpedia.org/ontology/MilitaryConflict> .

gives 13354 (at 29.05.2016).

Now, let’s explicitly linked to a conflict countries

select count(distinct ?conflict) where {
?conflict a <http://dbpedia.org/ontology/MilitaryConflict> .
?conflict ?p ?pays .
?pays a <http://dbpedia.org/ontology/Country>

gives 7750. And the number of countries involved in these conflicts is given by

select count(distinct ?pays) where {
?conflict a <http://dbpedia.org/ontology/MilitaryConflict> .
?conflict ?p ?pays .
?pays a <http://dbpedia.org/ontology/Country>

is limited to 1115. By viewing just 100 countries, we find, for example, “Province of Quebec”. To arrive at a form of aggregation by attaching a conflict to countries existing today, we have to see if a ‘country’ associated with a conflict can be identified as a part of an country existing today.

32 different properties are used for these links and I have a little trouble with the interpretation of them. Some are understandable well enough. For example: Place property is probably used to indicate the place of the conflict; the combatant property probably indicates the origin of the fighters involved. In both cases, we may well consider that the named countries were involved in the conflict concerned.

Another look can be worn on DBPedia of data noting that some conflicts are associated with the property wordnet_type synset https://www.w3.org/2006/03/wn/wn20/instances/synset-war -noun-1.rdf.


The idea is to specify the time on which we will focus our interest.

Are there any dates or times associated with conflicts recorded by DBPedia?

Some are associated with one or more dates (start? end?); others with endDate and startDate, others without direct evidence, but with links to battles with date indication.

When this information is available we can say that a country was at war within the periods concerned. Otherwise, we can not say anything: we do not know at what time the country has been affected by the conflict observed.

We’ll have to try to identify countries that have been involved in a conflict identified by DBPedia (which probably lack of contemporary conflicts).


For simplicity, I have sought to identify the countries recognized by the UN. There is a concept in which DBPedia must help us: Member State of the United Nations. But on a few examples, I see that this concept is associated with country by the dc: subject property, which is a little vague. This gives me the opportunity to see that countries are associated with the rdf: type yago: MemberStatesOfTheUnitedNations, which seems more accurate.

select count(distinct ?pays) where {
?pays a <http://dbpedia.org/class/yago/MemberStatesOfTheUnitedNations> .

gives us 186 countries.

I will focus on these countries to assess whether they were involved in a military conflict at one time or another.

select count(distinct ?pays) where {
?pays a <http://dbpedia.org/class/yago/MemberStatesOfTheUnitedNations> .
?conflict a <http://dbpedia.org/ontology/MilitaryConflict> .
{ ?conflict ?p1 ?pays } UNION { ?pays ?p2 ?conflict }

gives 139, suggesting that 47 UN countries are or was not related to military conflict to the attention of DBPedia as far as we can judge by knowledge directly represented in DBPedia (not induced knowledge).

We will have to express a negation: countries that are not in the list of countries that had military conflict.

I think the request

select distinct ?country where {
?country a yago:MemberStatesOfTheUnitedNations .
   ?conflict a dbo:MilitaryConflict .
   { ?country ?p1 ?conflict } UNION {?conflict ?p2 ?country }

will give us the countries not bound by any DBPedia property with a military conflict. This gives 15 results:


2 results are not country obviously (but it would make it detectable in the request). Rest 13 results that we need to look a little closer. I do not go review every result, but watch a few significant examples.

Monaco is a tiny state. The city-state was annexed by Julius Caesar, for example; without a fight? without use of force? Monaco has managed to maintain some neutrality during World War II. Did Monaco really avoided any armed conflict?

Micronesia consists of a group of Pacific islands. In particular, it was invaded by Japan during World War II. I think she has experienced at least one armed conflict. But it does not appear as such in DBPedia.

An interesting case is the Ivory Coast. Wikipedia knows that this country is experiencing political and military problems (see https://en.wikipedia.org/wiki/First_Ivorian_Civil_War) but DBPedia seems to ignore it. Perhaps the question is too recent and current?


We see through this example that data are available that can help answer questions -and this is already a big progress-but there is still much to do, a lot of intelligence to put to the data path to answer to a specific question. Data should be used with caution, specifying the borders of responses. For example, in the case described in this post, a correct formulation of a response that can be obtained is: list of countries recognized by UN of which we are certain, from the knowledge represented in DBPedia, that they have been linked to military conflict.

This entry was posted in DBpedia, Public data, Semantic taging, SPARQL, Tutorial, web. Bookmark the permalink.