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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method.static void
Print some basic documentation about this program.void
processItemDocument
(ItemDocument itemDocument) Processes the given ItemDocument.void
processPropertyDocument
(PropertyDocument propertyDocument) Processes the given PropertyDocument.void
Creates the final file output of the analysis.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
-
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:EntityDocumentProcessor
Processes the given ItemDocument.- Specified by:
processItemDocument
in interfaceEntityDocumentProcessor
- Parameters:
itemDocument
- the ItemDocument
-
processPropertyDocument
Description copied from interface:EntityDocumentProcessor
Processes the given PropertyDocument.- Specified by:
processPropertyDocument
in 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.
-