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.

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-Defintion - Properties to hold terms/abbreviations and definitions. (These should be queryable in the end, but there are still some problems with the code.)

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.2 and Semantic MediaWiki 1.5.6 on PHP 5.2.14. Other versions might work, but are not yet tested.

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/SemanticFormsInputs/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

 * Querying for Glossary-Term or Glossary-Defintion gives erroneous results.
 * 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 link for every term and replace the term by the link in wiki pages;
 * 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

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