Extension:Semantic Glossary

Description
Semantic Glossary is an extension for MediaWiki that lets you define terms and abbreviations together with a definition. Whenever a term or abbreviation is hovered over in an article its definition is displayed. The extension uses the markup algorithm from the Lingo extension, but instead of in a dedicated page it stores the data as property-values pairs in a Semantic MediaWiki store.

The advantage of that approach is that the Glossary can be queried like any other semantic data. And if for editing the glossary you do not want to use the inbuilt SpecialPage, you can also set up your own system, e.g. using Semantic Forms.

This extension introduces:
 * Special:Glossary - A Special page to define terms/abbreviations and their definitions
 * editglossary - A new user right (permission) to protect the Special:Glossary page. Defaults to user group user, i.e. everybody with a registered account.
 * Glossary-Term, Glossary-Definition, Glossary-Link - Properties to hold terms/abbreviations, definitions and (internal/interwiki) links.

Download instructions
The extension is still in an experimental state, so there are no packaged releases yet. However, you can download the current development version via the MediaWiki Extension Distributor. Alternatively you can download it directly using Subversion:

svn export http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticGlossary

Installation
This extension is tested with MediaWiki 1.16.5 and Semantic MediaWiki 1.6 on PHP 5.3.5. Other versions of MediaWiki and PHP will probably work, but are not yet tested. It will definitely not work with Semantic Mediawiki less than 1.6!

To install the extension create a directory named  in the   directory of your MediaWiki installation and copy the extension's files into it. Then add the following line to your LocalSettings.php below the inclusion of the Semantic MediaWiki extension:

require_once('extensions/SemanticGlossary/SemanticGlossary.php');

Configuration parameters
The  right is by default given to the   usergroup. To change this e.g. to limit the editing of the glossary to Sysops you could insert the following code after the inclusion of Semantic Glossary in your LocalSettings.php:

unset ($wgGroupPermissions['user']['editglossary']); $wgGroupPermissions['sysop']['editglossary'] = true;

The variable  contains the characters considered as punctuation. These characters may not be part of a term or abbreviation. This variable defaults to. You may change it by inserting something like this again after the inclusion of Semantic Glossary in your LocalSettings.php:

$sggSettings->punctuationCharacters = '\.,;:?!"';

Known issues

 * Terms and abbreviations may only consist of one word.
 * Terms and abbreviations may not contain punctuation characters.

Not yet implemented
The extension should be able to
 * store a context (page, category, namespace, concept) for every term and only markup the term on wiki pages belonging to the context;
 * import/export CSV;
 * invalidate affected pages when a term is changed;
 * regulate the Glossary browser's chattiness with a config setting;

Credits
The markup algorithm was copied and only slightly modified from Barry Coughlan's Lingo extension.

Contact
Comments, questions and suggestions should be sent or posted to:
 * the Semantic Mediawiki User mailing list (preferred)
 * the Semantic Glossary discussion page
 * the author