Prerequisites: Java, Maven, Subversion client. AnnoCultor does not really need to be checked out, the Geonames converter would pick up the latest release, 2.3.17 at the moment of writing.
AnnoCultor comes with Geonames concerted to RDF.
You can check out https://annocultor.svn.sourceforge.net/svnroot/annocultor/trunk/converters/
and examine the vocabularies/places directory.
Before you continue, maybe thats what you want?
Check out the following two SVN directories:
https://annocultor.svn.sourceforge.net/svnroot/annocultor/trunk/converters/vocabularies/places/countries https://annocultor.svn.sourceforge.net/svnroot/annocultor/trunk/converters/geonames
Move countries to vocabularies/places/countries mirroring thre SVN layout.
Or check out the parent https://annocultor.svn.sourceforge.net/svnroot/annocultor/trunk/converters/
and dont bother.
There is a file called readme.txt in the geonames directory
that explain how to run it. Basically,it says:
Windows: 1. Download and unzip to input_source http://download.geonames.org/export/dump/allCountries.zip http://download.geonames.org/export/dump/alternateNames.zip http://download.geonames.org/export/dump/hierarchy.zip 2. Run convert-from-csv.bat Linux: 1. Run convert-from-csv.sh and it will download and run everything itself
These two Geonames archives will contain files
allCountries.txt, alternateNames.txt,
hierarchy.txt, and iso-languagecodes.txt.
Conversion is thirsty on memory; give it 4Gb or RAM or more in the -Xmx setting. And it runs for quite some time.
The results are created in the input_source directory,
that is a little bit counter-intuitive, I admit.
It may be that you do not need the whole world, but your own country. There are two ways to reduce the runtime
First, restrict the continent.
Look at the convert-from-csv.bat or convert-from-csv.sh.
On its last line it passes a list of continent names as parameters to the Java class.
The default EU AS NA SA AF OC can be reduced to, say, EU.
Second, restrict the country.
Look at country-to-continent.properties: it contains the list of countries to be converted.
This list can be reduced to a single line, e.g. the one with NL=EU
Both methods would still make the converter go through the 1Gb-long allCountries.txt.
It is also possible to restrict it by a single country.
To do this, visit http://download.geonames.org/export/dump/
and download your country's zip, e.g.
http://download.geonames.org/export/dump/NL.zip.
And unzip it to the input_source directory.
Then you need to rename NL.txt to allCountries.txt and run the converter.
(c) 2011, Borys Omelayenko, 