Extension:WikiLexicalData
![]() Release status: beta |
|
---|---|
Implementation | API , Ajax |
Description | Allows users to add structured data to wiki pages, and store them in a structured database. |
Author(s) | Erik Möller, Kim Bruning, Kip (maintainer) and others |
MediaWiki | 1.27 |
Database changes | Yes |
License | GNU General Public License 2.0 or later |
Download | |
Example | OmegaWiki.org |
Translate the WikiLexicalData extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
In a standard MediaWiki installation, all the text of a page is entered in one field, and stored in one entry of the database (page_text).
WikiLexicalData (previously named Wikidata) allows to configure some namespaces to use several fields of different types (text, Combobox, etc.) on one wikipage and to store these fields in a structured database.
OmegaWiki is the only implementation of WikiLexicalData so far. The structured database used at OmegaWiki is explained at http://www.omegawiki.org/Help:OmegaWiki_database_layout
RequirementsEdit
- PHP together with the PHP intl extension to handle Unicode normalization
InstallationEdit
You can either install with an existing copy of a WikiLexicalData database (for example with the OmegaWiki database, see [1] ), or install from scratch on any MediaWiki installation, as explained below.
- Checkout a copy of the latest "WikiLexicalData" extension
- from the previous folder, go into mywiki/extensions/ and execute:
- In order to create the tables in the database relating to WikiLexicalData
- go to
/extensions/WikiLexicalData/Console
- run
php install.php --prefix=uw --template=databaseTemplate.sql --datasetname="OmegaWiki community"
- you can change the prefix and the datasetname to whatever you like. It has not been tested, but it should work...
- go to
ConfigurationEdit
- Edit your LocalSettings.php and add:
require_once("$IP/extensions/WikiLexicalData/App.php");
$wgCapitalLinks = false;
$wgExtraNamespaces = array(
16 => 'Expression',
17 => 'Expression_talk',
24 => 'DefinedMeaning',
25 => 'DefinedMeaning_talk',
);
$wdHandlerPath = "$IP/extensions/WikiLexicalData/OmegaWiki/";
$wdHandlerClasses = array(
24 => 'DefinedMeaning',
16 => 'OmegaWiki',
);
- Also add the following (the numbers may vary), as suggested by the install script:
$wgDefaultClassMids = array(37);
$wgIso639_3CollectionId = 35;
- $wgDefaultClassMids should correspond to the DM number of the expression called "lexical item".
- If you have bureaucrat rights (or other rights, see below to modify the "editClassAttributes" right), you can add annotations that will be available for all languages, by editing that DM in the Section "Class attributes". For example:
- - Level: SynTrans , Attribute: IPA , Type: Plain Text. Note: you have to define the word "IPA" first
- - Level: SynTrans , Attribute: etymology , Type: Translatable Text.
- - Level: SynTrans , Attribute: part of speech , Type: Option list.
- - Level: DefinedMeaning , Attribute: image , Type: Link.
Further configurationEdit
LanguagesEdit
- To add other languages
- Use the language manager ( Special:Languages )
- If you add a DM for that language, and add it to the "ISO 639-3 collection" with its ISO code, it will be used to translate the language name according to the interface language ( Use Special:ImportLangNames ).
User rightsEdit
Default user rights are as follows:
$wgGroupPermissions['wikidata-omega']['editwikidata-uw'] = true;
$wgGroupPermissions['wikidata-omega']['deletewikidata-uw'] = true;
$wgGroupPermissions['wikidata-copy']['wikidata-copy'] = true;
$wgGroupPermissions['wikidata-omega']['wikidata-copy'] = true;
$wgGroupPermissions['bureaucrat']['languagenames'] = true;
$wgGroupPermissions['bureaucrat']['addlanguage'] = true;
$wgGroupPermissions['bureaucrat']['addcollection'] = true;
$wgGroupPermissions['bureaucrat']['editClassAttributes'] = true;
$wgGroupPermissions['bureaucrat']['exporttsv'] = true;
$wgGroupPermissions['bureaucrat']['importtsv'] = true;
'editwikidata-uw'
: rights to edit the lexical data pages and add new data. This permission can be given to anonymous users.'deletewikidata-uw'
: rights to modify existing data, such as change a definition or remove a translation.'addlanguage'
: rights to add new languages via Special:Languages.'languagenames'
: rights to update the translations via Special:ImportLangNames.'addcollection'
: rights to add a collection via Special:AddCollection.'editClassAttributes'
: rights to add attributes to a class.
SortingEdit
To have proper sorting of diacritics, such as "é" between "e" and "f", you might have to add this to your LocalSettings.php:
setlocale(LC_COLLATE, 'en_US.utf-8');
Search suggestEdit
To have the search suggestion use the expression namespace instead of the article namespace:
- edit
/resources/mediawiki/mediawiki.searchSuggest.js
- replace
namespace: 0
withnamespace: 16
.
NotesEdit
- It is possible to use WikiLexicalData for something else than OmegaWiki (e.g. Wikispecies, Wikicommons, or any other very structured data). However, since WikiLexicalData was developed mainly with OmegaWiki in mind, it would need some work to separate what is specific to OmegaWiki from what could be reused in another project.
- MySQL and SQLite have been tested. Other database backends might work.
See alsoEdit
- Extension:Semantic MediaWiki
- Extension:Wikibase and the Wikidata project (which is not related to the WikiLexicalData extension)