Extension:Semantic Hierarchy

From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
Semantic Hierarchy
Release status: unmaintained
Semantic Hierarchy Init Screen.png
Implementation Ajax, Special page , Data extraction
Description Allows to visualize the structure of categories and properties in a semantic wiki
Author(s) Tobias Wellertalk
Latest version 1.0 (2017-06-09)
MediaWiki 1.23+
PHP 5.3+
Database changes No
License MIT License

Check usage and version matrix.

Semantic Hierarchy is an extension to Semantic MediaWiki that allows to visualize the structure of the categories and properties, defined by Semantic MediaWiki, in a tree. In addition, new categories and properties can be added, which leads to the creation of the corresponding wiki pages. The structure of the hierarchy can be changed via drag & drop, which leads to an update of the wiki pages.


The Semantic MediaWiki extension must be installed in order to use this extension.
  • Download, extract and place the file(s) in a directory called SemanticHierarchy in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'SemanticHierarchy' );
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'SemanticHierarchy' );, you need to use:

require_once "$IP/extensions/SemanticHierarchy/SemanticHierarchy.php";


  1. Go to special page "Semantic Hierarchy"
  2. Click on Semantic Hierarchy (located at group Semantic MediaWiki)
  3. The extension loads all categories and properties from your wiki and arranges it in a tree structure (Note that this can take, depending on the amount of categories and properties, several seconds. Depending on the feedback, we can improve this circumstance. See section Known Issues)
  4. Note: The Special Page requires sysops rights. Otherwise is this extension not listed in the Special Page.

Create new Category/Property[edit]

In the following, we will crate a new category, called Cat as a subcategory of mammal. Creating a new property/subproperty is the same approach, however in the right property tree. Therefore, we will only explain how to create a new category, because the approach is the same with properties.

  1. Right click on the category Mammal. A context menu appears (see picture below)
  2. Click on add
  3. Type into the Input the new category name Cat (see picture below)
  4. Click on Create
  5. The new category is created an added into the hierarchy tree

Rearrange Category/Property[edit]

  • Drag & Drop a category to a new position in order to rearrange the category. The category will automatically update its hierarchical information (e.g. add new subcategory information)
  • You cannot drag & drop a category into the property tree or vice versa!

Jump to Category/Property Page[edit]

  • Right click on a category/property
  • Click on jump
  • A new window opens with the corresponding wiki page of the selected category/property

Delete Category/Property[edit]

Deleting categories and properties is currently, because of security reasons, now allowed. Because no authentication for this special page is provided, every user can enter this page and delete categories/properties by accident. The feature is already included but commented out. If wished, this feature can be added. Otherwise you can also allow this feature by following the following instructions:

  • Open the File: SemanticHierarchy --> includes --> js --> "app.js"
  • Delete the comment in row 227 and 246
  • Reload the page

Known issues[edit]

  • Time for Loading categories/properties depends on the amount of Categories/Properties in the Wiki.
  • Sometimes the overlay doe not disappear.

Future Work[edit]


  • 2016-12-05: Icons were changed
  • 2017-06-09: New Version which uses the 1.25.x or above extension structure

See also[edit]

Link to authors
Link to information pages
  • AIFB (KIT): Institute of Applied Informatics and Formal Description Methods