Package org.wikidata.wdtk.examples
Class ClassPropertyUsageAnalyzer
java.lang.Object
org.wikidata.wdtk.examples.ClassPropertyUsageAnalyzer
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method.static voidPrint some basic documentation about this program.voidprocessItemDocument(ItemDocument itemDocument) Processes the given ItemDocument.voidprocessPropertyDocument(PropertyDocument propertyDocument) Processes the given PropertyDocument.voidCreates the final file output of the analysis.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
-
Constructor Details
-
ClassPropertyUsageAnalyzer
public ClassPropertyUsageAnalyzer()
-
-
Method Details
-
main
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 inExampleHelpers. -
processItemDocument
Description copied from interface:EntityDocumentProcessorProcesses the given ItemDocument.- Specified by:
processItemDocumentin interfaceEntityDocumentProcessor- Parameters:
itemDocument- the ItemDocument
-
processPropertyDocument
Description copied from interface:EntityDocumentProcessorProcesses the given PropertyDocument.- Specified by:
processPropertyDocumentin interfaceEntityDocumentProcessor- 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.
-