Extension:FolkTagCloud

From MediaWiki.org
Jump to: navigation, search
Crystal Clear app error.png

Extension not compatible with recent SMW
This extension does not work with recent releases of the Semantic MediaWiki extension. Have a look at the similar SRF tagcloud format, which does.

MediaWiki extensions manual - list
Crystal Clear app error.png
FolkTagCloud

Release status: unstable

Implementation Tag
Description Adds an SMW property for tagging wiki pages with user-defined labels and a parser tag for displaying these "FolkTags" in a tag cloud.
Author(s) Katharina Wäschle
Last version 1.1
MediaWiki 1.13.3
PHP 5.2.8
License GNU General Public License (GPL)
Download
Parameters

$wgFTCTagName

Tags
<FolkTagCloud>
Check usage and version matrix

Contents

Description [edit]

This extension was created as part of a bachelor thesis as a means to allow distinction as well as combination of hierarchical categories and flat tags in the MediaWiki category system. It uses Semantic MediaWiki methods to implement a simple tagging functionality via a semantic property and to retrieve stored tags and display them in a tag cloud.

The extension can be used to add a social tagging feature to a Semantic MediaWiki, thus providing an additional option for knowledge structuring and information retrieval and enabling a disambiguation of category functions. Users can add label strings (so called FolkTags) to a wiki page and display the resulting folksonomy in various tag clouds. A cloud can be filtered by one or more given MediaWiki categories, thus combining the hierarchical category system with flat tags.

Usage [edit]

FolkTagCloud adds a predefined semantic attribute FolkTag to the wiki that can be used to tag pages using the SMW syntax:

[[FolkTag::town]]

The tags are values of the semantic attribute and are of type string. With the parser tag

<FolkTagCloud></FolkTagCloud>

the distribution of tags over the wiki can be displayed in a tag cloud, which can be adjusted via various parameters that are passed as XML style arguments to the parser tag.

Parser Tag Parameters [edit]

maxtags
(int) Maximum number of tags to be displayed (default=1000).
mincount
(int) Minimum frequency of a tag to be displayed in the tag cloud (default=1).
order
(frequency | alphabetical) Sorting criterion (default=false).
count
(boolean) count = true displays the frequency of a tag in parentheses (default=false).
increase
(log | linear) Linear or logarithmic increase of font size (default=linear).
increasefactor
(int) Font size increase factor(default=100).
minfontsize
(int) Minimum font size (default=77).
property
(SMW attribute) Attribute to be used instead of the predefined tagging attribute.

Parameters are passed like this:

<FolkTagCloud maxtags=50, increase=log, order=frequency></FolkTagCloud>

Between der parser tags, one or more categories (separated by comma) can be passed:

<FolkTagCloud>Picture, Photo</FolkTagCloud>

This results in the filtering of the tag cloud by the given categories (and optionally their subcategories): only tags retrieved from wiki pages in the given categories are displayed.

subcategorylevel
(int) Level of subcategories included in the filtering (default=0).

Version [edit]

Version 1.1 should now work with SMW 1.4.3, but only limited testing has been done so far. If you encounter any problems, please e-mail me or leave a comment on the dicussion page (or feel free to create your own fix). To switch back to version 1.0, toggle comments in line 127 and 128, so the code looks like this:

#$values = getPropertyValues($property, $store);
$values = $store->getPropertyValues(NULL, $property);

Support for SMW 1.5.0 will hopefully follow soon.

Download instructions [edit]

Please cut and paste the code found below and place it in $IP/extensions/FolkTagCloud/FolkTagCloud.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation [edit]

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/FolkTagCloud/FolkTagCloud.php");

The extension requires the Semantic MediaWiki extension and will not work without it.

Configuration parameters [edit]

$wgFTCTagName [edit]

The default semantic property that is used for tagging is a predefined property named FolkTag. If a user defined property (e.g. MyTag) should be used, the name of this property can be passed via the global variable $wgFTCTagName in LocalSettings.php.

References [edit]

See also [edit]

Extension:WikiCategoryTagCloud, Extension:Semantic MediaWiki, Extension:Semantic Drilldown