Jump to content

Extension:VIKI

From mediawiki.org
MediaWiki extensions manual
VIKI
Release status: unmaintained
Implementation Parser extension , API
Description Draws a network graph from links between wiki pages.
Author(s) Jason Ji (jjitalk)
Latest version 1.6.0 (2017-08-16)
Compatibility policy Master maintains backward compatibility.
MediaWiki 1.23+
PHP 5.3+
Database changes No
License MIT License
Download
  • $wgVIKI_Hidden_Categories
  • $wgVIKI_Second_Order_Links
  • $wgVIKI_Function_Hooks
Quarterly downloads 0
Translate the VIKI extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

VIKI (Visualization and Knowledge Integration) is a D3-based directed force layout graph visualization of the structure of a wiki. In a VIKI graph, graph nodes represent individual wiki pages or web pages, while links between nodes indicate page links (i.e. one page has a hyperlink to another page, e.g. of the form [[Other Page]]). These links are directional, where the direction of the link indicates which page links to which. If two pages link to each other, the link is bidirectional. We say two pages are linked on a VIKI graph if there is a link between their nodes on the graph, i.e. either of the two pages links to the other, or they link to each other. Some wiki pages also have hyperlinks to external web pages; these pages are also displayed on the VIKI graph (with a generic wi-fi icon), but interaction with these pages is limited.

The graph is pannable and zoomable using either the mouse scroll action or the zoom bar located at the bottom of the graph. Individual nodes may be dragged around and rearranged as well; the D3 graph automatically revises node positions to a local equilibrium state whenever nodes are dragged.

The graph is first initialized with a (user-defined) list of wiki pages, along with all pages linked to these pages. Pages linked to this secondary level of pages are not initially displayed – only the first order links are initially present. The user may then choose to elaborate a node; elaboration involves retrieving and displaying all linked pages for the given node’s page. Elaboration of a node expands the VIKI graph, and users may expand the graph to explore the structure of the wiki. Elaborated nodes are also called hub nodes, and the length of links to hub nodes is longer for improved graph visibility. Users may also choose to hide individual nodes and/or hide entire hubs to focus down the graph to areas of interest.

Users may right click on a given node to bring up a context menu of options. Below is a list of all possible options, but not all nodes may have all options as appropriate.

  • Freeze: this node becomes frozen in position while other nodes may move around it
  • Visit Page: opens the page represented by the node in a new tab or window
  • Elaborate: elaborates a node, as discussed previously
  • Show Categories: Pops up a JavaScript alert listing the categories this page belongs to. (Under construction.)
  • Hide Node: Removes this node and links to it from the VIKI graph.
  • Hide Hub: Removes this hub node and all nodes immediately linked to it from the VIKI graph, unless the linked node is itself a hub.
  • Show All: Adds all previously-hidden nodes and links back into the VIKI graph.

Special thanks to Bernadette Clemente for the original idea that inspired this extension.

Installation

[edit]

Note Note: This extension requires Semantic MediaWiki to be installed first.

Note Note: We encourage users of our extensions to download the latest version from the master branch on Gerrit, rather than the most recent MediaWiki release branch. All MITRE extensions on master are production-ready to the best of our knowledge and reflect the versions we run on our own servers internally.

  • Download and move the extracted VIKI folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/VIKI
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'VIKI' );
    
  • Note Note: For VIKI to detect links to internal pages using external link syntax the following two steps have to be taken (only if not already done):
    1. Set $wgRegisterInternalExternals = true; in your "LocalSettings.php" file.
    2. Run refreshLinks.php from shell.
  • To hide certain categories by default, set $wgVIKI_Hidden_Categories in your "LocalSettings.php" file to an array of categories to hide, e.g. $wgVIKI_Hidden_Categories = array("Reports", "Cities");
  • VIKI has the ability to calculate and show 2nd order links (i.e. links between non-elaborated nodes currently in the graph), which is a bit more expensive in performance. This feature is disabled by default, but can be enabled for the whole wiki by setting $wgVIKI_Second_Order_Links = true; in your "LocalSettings.php" file. Or it can be enabled/disabled within a given VIKI graph as a parameter to the parser function, secondOrderLinks = true or false.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Note Note: By design, VIKI only shows nodes from namespaces which are designated as content namespaces. If you have other namespaces whose pages you wish to show up in VIKI, add those namespaces to the list of content namespaces.

Usage

[edit]

Usage documentation and live examples are provided at our extensions documentation site.

Developer Notes

[edit]

See Extension:VIKI/Developer Notes for details on the structure of the VIKI extension.

VIKI is designed to be extensible, with a built-in hook system. Developers can write MediaWiki extensions which serve as plugins to the core VIKI architecture to enhance or modify the VIKI graph behavior. For example, we have developed several VIKI plugins to enhance functionality or provide compatibility support for other MediaWiki and Semantic MediaWiki extensions, such as Semantic Title and Title Icon. Details about the plugin structure can be found at this page.

So far we have released two VIKI plugins for use:

See also

[edit]