Is there a unified code for countries?

What would be the best strategy to locate countries on dbpedia? I see some countries have “dbp:iso3166code” or “dbp:countryCode”, but some else don’t. There is as well a parsed file on Databus that has both “iso3166-1-alpha-3”, and “iso3166-1-alpha-2”. Is there a goal to unify things on the core based on any of these properties? thanks.

Hi @p.zangeneh, what do you mean by ‘locate countries’? In the Semantic Web, unique identifiers are URIs. So, if you want the list of sovereign countries, you’ll just need to retrieve their URIs.

select distinct ?x where {
  ?x a yago:WikicatCountries , dbo:Country
} order by ?x

Result on, an endpoint running DBpedia 2016-10.

However, if you are specifically looking for the ISO-3166 codes, Wikidata might have what you’re looking for.

1 Like

Thanks, true, the problem is however that not all iso3166-1 countries are a dbo:Country, or a

I tried to match them the other day, and one way or the other there was some manual searching that I had to do. (I would add to this based on a quick look that wdt:P298 also does not match all the iso3166-1 countries, although I should look more into it, maybe I am missing something).

the file is here, where all iso3166-1 are matched to their MARC_country instances with skos:excatMatch, and to their dbpedia and wikidata instance with skos:closeMatch. Now if we think this is something useful I can try putting it on Databus as well.

Can you please give me a few examples of such countries?

Well of course, first, counting them there are 179 distinct instances dbo:Country and yago:WikicatCountries, where there are 241 instances of iso3166-1 countries. albeit, there are not all “countries”, some are “territories” that are sometimes dependent or independent, but regardless they have alpha3 codes and are recognized in iso3166-1:

Consider Norfolk Island, that is a dbo:country but not a yago:WikicatCountries, although it is a yago:WikicatCountriesInOceania.

The problem with just looking for dbo:country is that it as well brings instances of ancient countries (7108 distinct instances).

That is what I meant in the first post by “what is the best strategy”, to locate them. would it be for example:

(dbo:Country ⋂ yago:WikicatCountries) ⋃ (dbo:Country ⋂ yago:WikicatCountriesOceania)

Although there are some that have the same problem but not in Oceania, take for example Turks and Caicos.

Best thing is to have a one to one match of dbr entities to their iso3166-1-alpha3 codes with the current “dbp:iso3166code”, or some property that denotes “current iso3166 alpha3 code”.

Yeah, I agree that the definition of country is blurred. Personally, I’ve always ignored the territories and considered only the sovereign countries, which at the moment are 201 including disputed ones such as Taiwan and Kosovo. But if your target is specifically ISO-3166-1 codes, neither of such definitions will match that.

That said, I’m afraid there is no simple way to get the exact list from DBpedia 2016-10, as the extraction of the codes seems to have failed sometimes.

Your only option seems to perform a federated query across DBpedia and Wikidata, partly derived by the query in the link I posted above. While DBpedia provides links to Wikidata, the opposite doesn’t always happen.

Agree, my problem was a local one and is solved now by just manually matching :slight_smile: , but that would be a great thing to sort out I guess. Thanks for your comments.

1 Like

@p.zangeneh if you find a more or less official source, you could create a DBpedia extension. Ideally you would take this from a stable Linked Data source, e.g. Geonames would be suitable.

In the future, we will merge these properties in the new kind of merged Knowledge Graphs we are producing:
Those are multi-source fusions.

1 Like

Thanks a lot!