Mediawiki Extension Semantic Mediawiki

From Micylou WIKI
Revision as of 09:32, 4 March 2022 by DochyJP (talk | contribs) (Page creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Source: DataSource
Language: English
Topic: Mediawiki
SubTopic: Mediawiki Extension
Last Edit By: DochyJP
LastEdit: 2022-03-04
Document type: Documentation
Status: Active
Access: free

Pre-requisite

Composer needs to be installed and available first. Information about Composer installation is available here.

Installation

Since you should already have composer installed, you can do this by running composer in the top-level MediaWiki directory. Assuming you have composer.phar in that directory, the following command will work:

COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/semantic-media-wiki 

Alternatively, if the above fails, you can add the following content to your composer.local.json file:

{
	"require": {
                  "mediawiki/semantic-media-wiki": "~4.0"
        }
}

Now run the following command from the base directory1 of your MediaWiki installation:

composer update --no-dev

Enabling Semantic Mediawiki

Add a call to wfLoadExtension() as well as enableSemantics() to the end of the "LocalSettings.php" file.
enableSemantics() takes in the domain name of the wiki; a wiki located at "example.org", for instance, should have the following call:

wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'example.org' );

Setup and update

Run MediaWiki'S "update.php" script from the base directory1 of your MediaWiki installation:

php maintenance/update.php

Verify

Check the "Special:Version" page on your wiki and verify that the extension has been successfully installed and enabled.

Testing

Create a regular wiki page named "TestSMW".
Before saving, enter the following wiki text within the edit field:

        Property test: [[Property name::Property value]]

Now save the page and you will see the following displayed on the page:

"Property test: Property value"

Navigate to special page "Special:Browse" by clicking on the link "Browse properties" in the "tools" section of your wiki's sidebar.
On this special page you will see:

the property "Propery name" and the value "Propery value", both in red
the special property "Modification date" in blue and italics as well as the value e.g. "5 February 2014 23:42:29" (the timestamp when the page was saved).

Semantic MediaWiki was successfully tested!