Extension:Semantic Glossary

The Semantic Glossary extension 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 is an alternative back-end for the Lingo extension: Where the Lingo extension uses a dedicated page to store the glossary, Semantic Glossary retrieves the data from a Semantic MediaWiki store. The advantages of this approach are: the glossary can be queried like any other semantic data, storing of the data is not limited to one pre-defined page and editing the data can be made more user-friendly using Semantic Forms.

Properties
The following properties are used to hold the data of the glossary entries:
 * Glossary-Term: The term or abbreviation that is to be annotated on pages
 * Glossary-Definition: Its definition
 * Glossary-Link: The name of a page to which a link will be displayed alongside the definition (e.g. to link to a longer explanation of the term)
 * Glossary-Style: The name of a CSS class (or multiple classes, separated by spaces) that will be used to style the tooltip.

There must only ever be one definition per wiki page. The easiest way to ensure this and to keep the definition in one place is probably to use Semantic Internal Objects or SMW's subobjects.

The link may be any internal or interwiki link.

You can easily build a user interface to edit the glossary, e.g. using Semantic Forms. See this discussion entry for an example.

Internationalization
The extension is pretty well internationalized by now, thanks to the efforts of the volunteers on translatewiki.net. (If your language is not supported yet, get an account there and help yourself. It's easy!) To find out the names of the properties for your language, look at the SemanticGlossary.i18n.php file and find the messages semanticglossary-prop-glt (Glossary-Term), semanticglossary-prop-gld (Glossary-Definition), semanticglossary-prop-gll (Glossary-Link), and semanticglossary-prop-gls (Glossary-Style). Or just use the default English property names, they should always work.

Features inherited from the Lingo extension
You can exclude an article from markup by including the magic word  anywhere in that article's text.

In some cases it may be necessary to exclude only portions of a page, e.g. because Lingo interferes with some JavaScript. This can be achieved by wrapping that part in an HTML element (e.g. a span or a div) and specifying. As a shorthand for  you can just use the   tag.

For inherited configuration parameters see Customization below.

Composer
From MediaWiki version 1.22 onwards Semantic Glossary should be installed using Composer. The package name is. For instructions on how to install Composer see MediaWiki's Composer User manual.

Once you have Composer properly installed, all you need to do is go to your MediaWiki installation directory and run:
 * for the latest stable version or
 * for the latest development version

Any future update is then just a call to. You do not have to take care of any dependencies, those are solved by Composer.

Continue with the Common steps below.

Note: If you have installed an earlier version of Semantic Glossary you need to remove its code and that of the Lingo extension from the MediaWiki extension directory and delete the respective calls to  from the   file before starting the re-installation with Composer.

Using packaged downloads
''Note: Having MediaWiki (version 1.17 or higher), Semantic MediaWiki (version 1.9 or higher) and Lingo (version 1.0 or higher) installed is a precondition for the Semantic Glossary extension; the code will not work without them. Lower versions might work but are not tested.''


 * 1) Download the last released version or the current development version
 * Alternatively you can clone Semantic Glossary using git
 * 1) Extract the files to the   directory
 * 2) If necessary rename the newly created directory to SemanticGlossary
 * 3) Add to the end of LocalSettings.php below the inclusion of the Semantic MediaWiki and the Lingo extension:
 * 4) Continue with the Common steps below.

Common steps

 * 1) Do some customization if necessary (see below)
 * 2) Go to the Special:Version page of your wiki and verify that an entry for Semantic Glossary exists

Customization
Semantic Glossary has inherited most of the settings available for the Lingo extension:
 * to specify a different name for the terminology page; Example:
 * to specify that each term should be annotated only once per page; Example:
 * to specify what namespaces should or should not be used; Example:
 * to set default cache type (null = use main cache); Example:

If you want to use these settings, just include them in LocalSettings.php. If you did not use Composer for the installation, they must come after the

Finally you can provide your own styling. For the classes used by Lingo for the various HTML elements, please have a look at the.

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;
 * invalidate affected pages when a term is changed;

Version history

 * See here for the version history

Screen shots & example setup
Please find information for a detailed example here.

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