From SMW+ A Semantic Web Enterprise Wiki

Jump to: navigation, search
Smw plus help icon 32x32.gif Installing SMW+ 1.6.0 manually on top of MediaWiki
Created by: Dominika | Status: Final version Icon audience.png For audience: Administrator

This article gives step-by-step instructions on the entire process of installing SMW+ 1.6.0 from source on top of an existing MediaWiki installation.

This documentation applies to the latest version. If you are using an earlier version, no other releases.
User manual information
Applies to version: Help:SMW+ 1.6.0,
Note: Use the tree-view on the right hand side to navigate in the documentation

Contents

Introduction

The product SMW+ consists of several components:

These instructions apply to the SMW+ Community Edition Source Package, assuming you have a running MediaWiki installation.

Other instructions


Requirements

  • Install MediaWiki, a web server such as Apache, PHP and MySQL as described in the MediaWiki installation guide
    Information.png  Note:
    SMW+ 1.6.0 works best with MySQL 5.x, PHP 5.3.3, MediaWiki 1.17.0 and SMW 1.6.1
  • If you decide to use IIS as a web server, you might find this post helpful (please note that it applies to an earlier version)
Supported browsers
  • Internet Explorer 8.x (which MUST NOT run in compatibility mode)
  • Mozilla Firefox 7 and 8
  • Google Chrome 15

Before you start, turn on error reporting. Add the following two lines to your LocalSettings.php or change php.ini accordingly.

error_reporting(E_ALL);
ini_set('display_errors', "On");

How to install SMW+ on top of MediaWiki

In the following instructions stating <mediawiki-dir> that mean you have to replace this path with your specific installation directory of MediaWiki. On Windows system this might be the directory C:\xampp\htdocs\mediawiki. Change the commands accordingly to your MediaWiki installation directory.

  1. Download Semantic MediaWiki 1.6.1
  2. Download the 'validator.zip'
  3. Download the files 'wysiwyg-1.6.0_0.zip' and 'smwhalo-1.6.0_2_including_dependencies.zip' from the download page
  4. Extract all the download archives
  5. Copy extracted files:
    1. Extract 'smw-1.6.1_0', which will create a folder called 'extensions'. Open it, and move the SemanticMediaWiki sub-folder into <mediawiki-dir>\htdocs\mediawiki\extensions
    2. Extract 'validator', which will create a folder called 'extensions'. Open it and move the 'Validator' sub-folder to <mediawiki-dir>\htdocs\mediawiki\extensions
    3. Extract 'wysiwyg-1.6.0_0', which will create another 'extensions' folder. Open it, and move WYSIWYG sub-folder also into <mediawiki-dir>\htdocs\mediawiki\extensions
    4. Extract 'smwhalo-1.6.0_2_including_dependencies', which will create the folders 'deployment', 'extensions' and 'skins'. Open the folder 'extensions' and move all sub-folders there also into <mediawiki-dir>\htdocs\mediawiki\extensions
    5. Add the files contained in the folder 'skin' into <mediawiki-dir>\htdocs\mediawiki\skins
    6. Copy the folder deployment into the MediaWiki root folder <mediawiki-dir>\htdocs\mediawiki
  6. Edit the configuration file <mediawiki-dir>\htdocs\mediawiki\LocalSettings.php:
    1. Add the following code in front of other extensions (if there are some installed), to let the Wiki Administration Tool check and update the installed extensions if needed:
      require_once( "$IP/extensions/Validator/Validator.php" );
      require_once('deployment/Deployment.php');
      include_once("$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php");
      enableSemantics('localhost:8080');
      require_once("extensions/ScriptManager/SM_Initialize.php");
      include_once($IP.'/extensions/ARCLibrary/ARCLibrary.php');
      require_once( "$IP/extensions/ApplicationProgramming/ParserFunctions/ParserFunctions.php" );
      require_once( "$IP/extensions/ApplicationProgramming/Variables/Variables.php" );
      include_once('extensions/ApplicationProgramming/URLArguments/URLArguments.php');
      include_once('extensions/SMWHalo/includes/SMW_Initialize.php');
      enableSMWHalo();
      $wgUseAjax=true;
      require_once("$IP/extensions/WYSIWYG/WYSIWYG.php");
      $wgGroupPermissions['user']['annotate']=true;
      $wgGroupPermissions['user']['edit']=true;
      $wgGroupPermissions['user']['wysiwyg']=true;
      $wgGroupPermissions['sysop']['userrights']=true;
      $wgGroupPermissions['sysop']['ontologyediting'] = true;
    2. Secondly enable semantic annotations for pages in certain namespace by adding the following:
      $smwgNamespacesWithSemanticLinks = array(
      NS_MAIN => true,
      NS_TALK => false,
      NS_USER => true,
      NS_USER_TALK => false,
      NS_PROJECT => true,
      NS_PROJECT_TALK => false,
      NS_IMAGE => true,
      NS_IMAGE_TALK => false,
      NS_MEDIAWIKI => true,
      NS_MEDIAWIKI_TALK => false,
      NS_TEMPLATE => true,
      NS_TEMPLATE_TALK => false,
      NS_HELP => true,
      NS_HELP_TALK => false,
      NS_CATEGORY => true,
      NS_CATEGORY_TALK => false,
      SMW_NS_PROPERTY => true,
      SMW_NS_PROPERTY_TALK => false,
      SMW_NS_TYPE => true,
      SMW_NS_TYPE_TALK => false,
      SMW_NS_CONCEPT => true,
      SMW_NS_CONCEPT_TALK => false,
      SF_NS_FORM => true,
      SF_NS_FORM_TALK => false,
      );
      // auto-templates
      $smwhgAutoTemplatesParameters = array ();
      $smwhgAutoTemplates = array();
      $smwhgAutoTemplateText = array( SMW_NS_PROPERTY => "");
    3. Adjust or add the path to the PHP interpreter (php.exe) accordingly to your xampp directory:
      On Windows: $phpInterpreter="><mediawiki-dir>\php\php.exe";
      On Linux: $phpInterpreter="/usr/bin/php";
    4. Optionally change $wgDefaultSkin='monobook'; to $wgDefaultSkin='ontoskin3'; if you want to use the skin provided with Halo.
    5. Save the LocalSettings.php
  7. Add the GNU-Patch to the environment variable (see MS help System Variable or for Unix):
    On Windows:
    1. Right-click My Computer > Properties
    2. Click Advanced tab
    3. Click Environment variables
    4. In the section System Variable select the variable Path
    5. Click Edit
    6. Add a semicolon ";" after the last value and then enter the path of the GNU-Path: <mediawiki-dir>\mediawiki\deployment\tools
    7. Click OK and close the window
    On Linux: PATH=$PATH:/var/www/mediawiki/deployment/tools
    export PATH
  8. Grant write access to the following directories for the Wiki Administration Tool::Make sure that the user who runs the web server can write into the given folders. It is of course not appropriate for the web server to run on root due to security issues. It should use its own user which is pre-configured by the Linux distribution. This user is called "web-data" on Debian/Ubuntu for instance (It is a Linux user, not a wiki user). It should own the files in the wiki directory. You can use these commands:
    cd /var/www/mywiki
    chown -R www-data:www-data *
    Information.png  Note:
    If you use in parallel the command line tool under user "root", the newly created files will have the owner "root". That means they can not be changed/deleted by www-data. In this case, you have to reset the owner after using smwadmin. Use the commands above.
    The credentials used to login into the web-GUI of the wiki admin tool are wiki credentials (all sysop accounts are possible). But this has nothing to do with the linux users.
    If you do not grant write access then error messages will be printed out.
    • htdocs\mediawiki\LocalSettings.php
    • deployment\tools\webadmin\sessiondata
    • deploymenttools\webadmin
    • deployment\tools\repositories
    • htdocs\mediawiki\extensions (and all extensions contained)
    • path of %TEMP% variable, default: C:\Windows\TEMP
    • \usr\share\local\Ontoprise (optional, only required if you plan to install external apps like TSC)
  9. Upgrade database tables via command line:
    1. Open a command line window in Admin mode
    2. Navigate to your mediawiki installation i.e. cd <mediawiki-dir>\htdocs\mediawiki
    3. Run once php <mediawiki-dir>\htdocs\mediawiki\extensions\SemanticMediawiki\maintenance\SMW_setup.php This sets up the standard database configuration for SMW
    4. Run once php extensions\SMWHalo\maintenance\SMW_setup.php This will upgrade the database schema and install some wiki pages.
  10. Alternatively upgrade database tables via Wiki Admin Tool webpage:
    1. Start Apache and MySQL
    2. Open your wiki in the browser
    3. Login as WikiSysop (default credentials are: WikiSysop/root)
    4. Go the the special page Special SMWHaloAdmin
    5. Click Initialize
  11. Patch now Mediawiki and SMW with the delivered patches (Notes on patches):
    1. Therefore navigate in your command line window in the SMWHalo directory: cd <mediawiki-dir>\htdocs\mediawiki\extensions\SMWHalo
    2. Execute the following command:
      php patch.php -p patch_for_MW1.17.0.txt -d <mediawiki-dir>\htdocs\mediawiki --onlypatch

Now you have installed SMW+


Information.png  Note:
The configuration of the LocalSettings.php above does not correspond to the configuration that comes with the Windows installer tool. It's a slimmed but working configuration. The special page 'CheckInstallation' will output error messages, because the extensions are installed without a deploy descriptor. This does not affect the functionality of the wiki, but you can avoid these error messages by copying the extended version of the LocalSettings.php


Bring SMW+ up-to-date

After you have installed SMW+ make sure that your installation is up-to-date and all needed services are running. It is important that you follow these instructions before giving other users access to the Wiki or starting productive work. We also highly recommend to repeat these instructions from time to time.


Adding content bundles
Installing Solr server for appropriate use of the Enhanced Retrieval

Verifying the installation

  • Check that the Query Interface exists: open the page Special:QueryInterface
  • Check that the DataExplorer (formerly known as OntologyBrowser) exists: open the page Special:DataExplorer
  • Check that an internal property exists: open the page Property:Has domain and range
  • Check that the annotation modus is available: go to the main page, there should be a tab entry "annotate"
  • Check that the WYSIWYG editor is available: go to a page and click edit, there should be the link "Show RichTextEditor" available
  • Check that Ontoskin3 exists: login as a user and try to set your prefered skin to Ontoskin3.


Notes on patches

There will be the following issues if this patch is missing:

  • The Query Interface can not be used in an overlay.
  • The Advanced Annotation Mode will not always work properly.
Patches in SMWHalo/patch_for_MW1.17.0.txt
Purpose
Parsing context
The parser contains an additional variable where the parsing content is set.
Patching command
    php patch.php -p patch_for_MW<version>.txt -d <mw-dir> --onlypatch
Replace <mw-dir> with the absolute path of your Mediawiki installation and 
choose the correct version of the patch file for <version>.

Extending SMW+

There are various extensions that serves to extend the capabilities of Semantic MediaWiki plus. You can extend SMW+ with free extensions and content bundles using the Wiki Administration Tool. Detailed information how to add extensions

Using the Web interface
  1. Open the URL in your browser: [http:// http://]<your-wiki-url>/mediawiki/deployment/tools/webadmin/login.php
  2. Login as Wiki admin (default credentials are: WikiSysop, root)
  3. Click Find extensions tab
  4. Enter smwplus
  5. Click Search
  6. Click Install
    A pop up window indicates the installation progress
  7. Click OK to close the window

Now the SMWplus content bundle is successfully installed, go back to your wiki and check if the menus are available.

Using the console
  1. Open a command line window in Admin mode
  2. Navigate to the directory of the Wiki Administration Tool cd <mediawiki-dir>\htdocs\mediawiki\deployment\tools
  3. Type smwadmin -l to get a list of available extensions
    Information.png  Note:
    If you get an error message, the Wiki Administration Tool is probably not installed correctly. In this case have a look at the installation instructions
  4. Now select an extension or content bundle from the list and type smwadmin -i <extension name> to install it, e.g. smwadmin -i smwplus
  5. Follow the instructions in the command line
  6. Now install the content bundle Smwplussandbox by typing smwadmin -i Smwplussandbox
  7. If you get the message There are non-initialized extensions. type smwadmin --finalize

Now you have installed the content bundles SMWplus and Smwplussandbox


Installing the TripleStore

Additionally you can attach a TripleStore to your wiki. A triple store is a convenient method for the storage and retrieval of Resource Description Framework (RDF) statements in a specialized database. RDF and RDF Schema (RDFS) is the underlying representation of semantic data in the semantic web and also in SMW and SMW+

Either you can install the TripleStore using the windows installer or manually on other operation systems.

Comment icon crystal.png

Static facts Derived facts
Facts about Installing SMW+ 1.6.0 manually on top of MediaWikiRDF feed
Content titleInstalling SMW+ 1.6.0 manually on top of MediaWiki  +
Creation dateThis property is a special property in this wiki.15 November 2011 15:34:00  +
CreatorThis property is a special property in this wiki.Dominika  +
For audienceAdministrator  +
Has StatusFinal version  +
Has overviewThis article gives step-by-step instructions on the entire process of installing SMW+ 1.6.0 from source on top of an existing MediaWiki installation.
Has prerequisitesSMW+ 1.6.0  +
Last modified byThis property is a special property in this wiki.Dominika  +
Position in subsection overview1  +
Reviewed byDominika  +
Subsection ofInstalling SMW+ 1.6.0 from source  +
Transitive Subsection ofInstalling SMW+ 1.6.0 from source  +
This page was last modified on 14 March 2012, at 09:15.This page has been accessed 3,177 times.
SemanticTreeview close tree