Class LifeExpectancyProcessor

java.lang.Object
org.wikidata.wdtk.examples.LifeExpectancyProcessor
All Implemented Interfaces:
EntityDocumentProcessor

public class LifeExpectancyProcessor extends Object implements 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 Details

    • LifeExpectancyProcessor

      public LifeExpectancyProcessor()
  • Method Details

    • main

      public static void main(String[] args)
      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 in ExampleHelpers.
    • processItemDocument

      public void processItemDocument(ItemDocument itemDocument)
      Description copied from interface: EntityDocumentProcessor
      Processes the given ItemDocument.
      Specified by:
      processItemDocument in interface EntityDocumentProcessor
      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.