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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method.static void
Prints some basic documentation about this program.void
processItemDocument
(ItemDocument itemDocument) Processes the given ItemDocument.void
Writes 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, wait
Methods 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:EntityDocumentProcessor
Processes the given ItemDocument.- Specified by:
processItemDocument
in 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.
-