The OpenCodes project is part of the KDE Open Data initiative seeking to develop a standard json file format for ISO Codes and to provide a set of data files derived from Wikidata.
OpenCodes will be a single git repository containing a set of scripts to maintain the ISO Codes data as well as the data files themselves. The repo will not contain any code APIs to utilise the data, this is to ensure the project is completely standalone and can be utilised by as many other projects as possible.
The data files will be in JSON format with a schema defined using the JSON Schema standard will will allow for automated verification and consumption.
A Python script will use the Wikidata Query API once available (or other tools such as Autolists in the interim) to list all Items for the ISO code Property and then obtain all the required Properties for each Item instance. This data will then be merged with any extra fields OpenCodes requires and written to the base set of json files which will be committed to the repo.
A second Python script will generate the payload files from the base files in a choice of formats:
For Linux installs generated using 'make install' the base files will be installed to /usr/share/opencodes and .po translation files installed to /usr/locale/.
Translations will be sourced from both Wikidata and KDE. It is expected that Wikidata will have a greater number of languages supported than KDE so will be the preferred source, but KDE may have some languages unsupported in WIkidata so we need to cater for this. It is hoped KDE translators will submit translations directly to Wikidata, but we cannot automate this as Wikidata uses CC-0 licensing.
The following Items are defined in Wikidata but are not connected to the Properties and have poor translations and definitions, probably due to import from Freebase:
We should propose changes to Wikidata to link these to the actual properties used for the countries. Because they are not currently connected we cannot start the query from the Item.
The following Properties are defined for all admin Items:
The following Properties are defined on the Item for each Country:
The following Properties are defined on the Item for each Subdivision:
The following Properties are also on OSM but not Wikidata:
The following items are also in KDE but not Wikidata:
To obtain all country Items for the ISO alpha-2 code run the following query: http://wdq.wmflabs.org/api?q=claim