Package org.wikidata.wdtk.examples
Class LifeExpectancyProcessor
java.lang.Object
org.wikidata.wdtk.examples.LifeExpectancyProcessor
- All Implemented Interfaces:
EntityDocumentProcessor
This document processor calculates the average life expectancy of people,
based on property ids used on Wikidata. The results can be written to the
file life-expectancies.csv in the example results directory.
Note that the computation of life expectancies based on the life spans of people who have died already has some systematic bias, since none of the sampled person is expected to die in the future.
- Author:
- Markus Kroetzsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method.static voidPrints some basic documentation about this program.voidprocessItemDocument(ItemDocument itemDocument) Processes the given ItemDocument.voidWrites the results of the processing to a file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessor
processEntityRedirectDocument, processLexemeDocument, processMediaInfoDocument, processPropertyDocument
-
Constructor Details
-
LifeExpectancyProcessor
public LifeExpectancyProcessor()
-
-
Method Details
-
main
Main method. Processes the whole dump using this processor and writes the results to a file. To change which dump file to use and whether to run in offline mode, modify the settings inExampleHelpers. -
processItemDocument
Description copied from interface:EntityDocumentProcessorProcesses the given ItemDocument.- Specified by:
processItemDocumentin interfaceEntityDocumentProcessor- Parameters:
itemDocument- the ItemDocument
-
writeFinalResults
public void writeFinalResults()Writes the results of the processing to a file. -
printDocumentation
public static void printDocumentation()Prints some basic documentation about this program.
-