Class ClassPropertyUsageAnalyzer

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

public class ClassPropertyUsageAnalyzer extends Object implements EntityDocumentProcessor
This advanced example analyses the use of properties and classes in a dump file, and stores the results in two CSV files. These files can be used with the Miga data viewer to create the Wikidata Class and Properties browser. You can view the settings for configuring Miga in the Miga directory for this app.

However, you can also view the files in any other tool that processes CSV. The only peculiarity is that some fields in CSV contain lists of items as values, with items separated by "@". This is not supported by most applications since it does not fit into the tabular data model of CSV.

The code is somewhat complex and not always clean. It should be considered as an advanced example, not as a first introduction.

Author:
Markus Kroetzsch
  • Constructor Details

    • ClassPropertyUsageAnalyzer

      public ClassPropertyUsageAnalyzer()
  • Method Details

    • main

      public static void main(String[] args)
      Main method. Processes the whole dump using this processor. 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
    • processPropertyDocument

      public void processPropertyDocument(PropertyDocument propertyDocument)
      Description copied from interface: EntityDocumentProcessor
      Processes the given PropertyDocument.
      Specified by:
      processPropertyDocument in interface EntityDocumentProcessor
      Parameters:
      propertyDocument - the PropertyDocument
    • writeFinalReports

      public void writeFinalReports()
      Creates the final file output of the analysis.
    • printDocumentation

      public static void printDocumentation()
      Print some basic documentation about this program.