@@ -0,0 +1,2270 @@
+package org.wikidata.wdtk.examples;%0D%0A%0D%0Aimport java.io.IOException;%0D%0A%0D%0Aimport org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessor;%0D%0Aimport org.wikidata.wdtk.dumpfiles.DumpContentType;%0D%0Aimport org.wikidata.wdtk.dumpfiles.DumpProcessingController;%0D%0Aimport org.wikidata.wdtk.dumpfiles.MwDumpFile;%0D%0Aimport org.wikidata.wdtk.dumpfiles.MwLocalDumpFile;%0D%0A%0D%0A/**%0D%0A * This class illustrates how to process local dumpfiles%0D%0A * %0D%0A * @author Markus Damm%0D%0A *%0D%0A */%0D%0A%0D%0Apublic class LocalDumpFileProcessor %7B%0D%0A%0D%0A%09final static String COMPRESS_BZ2 = %22.bz2%22;%0D%0A%09final static String COMPRESS_GZIP = %22.gz%22;%0D%0A%09final static String COMPRESS_NONE = %22%22;%0D%0A%0D%0A%09private static MwDumpFile mwDumpFile;%0D%0A%0D%0A%09/**%0D%0A%09 * Name string of the dump file that is locally saved and should be%0D%0A%09 * processed%0D%0A%09 */%0D%0A%09private final static String FILE_NAME = %2220150713.json.gz%22;%0D%0A%0D%0A%09/**%0D%0A%09 * Directory of the dump that should be processed%0D%0A%09 */%0D%0A%09private final static String DUMP_DIRECTORY = System%0D%0A%09%09%09.getProperty(%22user.dir%22);%0D%0A%0D%0A%09private final static DumpContentType DUMP_CONTENT_TYPE = DumpContentType.JSON;%0D%0A%0D%0A%09private static EntityDocumentProcessor entityDocumentProcessor = new GenderRatioProcessor();%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09ExampleHelpers.configureLogging();%0D%0A%09%09LocalDumpFileProcessor.printDocumentation();%0D%0A%09%09try %7B%0D%0A%09%09%09mwDumpFile = new MwLocalDumpFile(DUMP_DIRECTORY,%0D%0A%09%09%09%09%09DUMP_CONTENT_TYPE, FILE_NAME);%0D%0A%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D%0D%0A%09%09DumpProcessingController dumpProcessingController = new DumpProcessingController(%0D%0A%09%09%09%09%22wikidata_wiki%22);%0D%0A%09%09dumpProcessingController.setOfflineMode(true);%0D%0A%09%09dumpProcessingController.registerEntityDocumentProcessor(%0D%0A%09%09%09%09entityDocumentProcessor, null, false);%0D%0A%09%09dumpProcessingController.processDump(mwDumpFile);%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Prints some basic documentation about this program.%0D%0A%09 */%0D%0A%09public static void printDocumentation() %7B%0D%0A%09%09System.out.println(%22********************************************************************%22);%0D%0A%09%09System.out.println(%22*** Wikidata Toolkit: ProcessLocalDumpFile%22);%0D%0A%09%09System.out.println(%22*** %22);%0D%0A%09%09System.out.println(%22*** Description.%22);%0D%0A%09%09System.out.println(%22********************************************************************%22);%0D%0A%09%7D%0D%0A%7D

Add example