Java library for manipulating the Wikidata class hierarchy using local indexfiles.
The executable module including the index file can be downloaded from the following URL.
https://hozo.jp/wd-tool/WD-HierarchyTool_2024-0729.zip (File size; 3.69 GB)
Generate index files from Wikidata RDF dumps (N-Triple format) to manipulate the Wikidata hierarchy on a local PC with the following data as input.
- N-Triples with the predicate wdt:P31(instance-of)
- N-Triples with the predicate wdt:P279(sub-class-of)
- N-Triples with the predicate rdfs:label
- N-Triples with the predicate skos:altLabel
- N-Triples with the predicate schema:description
>java java jp.ac.osakac.wdht.HugeGraphFileDBRegister <setting file>
example)
>java jp.ac.osakac.wdht.HugeGraphFileDBRegister settings/indexingSetting.txt
*Set the classpath (-cp) as necessary.
Extract the class hierarchy from the generated index file. The following two extraction methods are supported.
- Extracts the class hierarchy by specifying the entity as the root(starting point).
example of the setting file) extractSetting_root-ex.txt - Specify entities that are subclasses, obtain the superclasses that they have in common, and extract the class hierarchy starting from them as root.
example of the setting file) extractSetting_subclasses-ex.txt
>java java jp.ac.osakac.wdht.HugeDBHierarchyFile <setting file>
*Set the classpath (-cp) as necessary.
example)
>java jp.ac.osakac.wdht.HugeDBHierarchyFile settings/extractSetting_root-ex.txt