From SMW+ A Semantic Web Enterprise Wiki
|
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.
| 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:
- Halo core extension, which comes with Application Programming extension, ARCLibrary, the ScriptManager, Ontoskin3 and the Wiki Administration Tool
- WYSIWYG extension
These instructions apply to the SMW+ Community Edition Source Package, assuming you have a running MediaWiki installation.
- Other instructions
- Installation of SMW+ Source Package on top of Semantic MediaWiki
- Installation of the SMW+ Community/Professional Edition Windows Installer
- Installation of the SMW+ Community/Professional Edition VMWare Image
Requirements
- Install MediaWiki, a web server such as Apache, PHP and MySQL as described in the MediaWiki installation guide
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.
- Download Semantic MediaWiki 1.6.1
- Download the 'validator.zip'
- Download the files 'wysiwyg-1.6.0_0.zip' and 'smwhalo-1.6.0_2_including_dependencies.zip' from the download page
- Extract all the download archives
- Copy extracted files:
- 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
- Extract 'validator', which will create a folder called 'extensions'. Open it and move the 'Validator' sub-folder to <mediawiki-dir>\htdocs\mediawiki\extensions
- 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
- 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
- Add the files contained in the folder 'skin' into <mediawiki-dir>\htdocs\mediawiki\skins
- Copy the folder deployment into the MediaWiki root folder <mediawiki-dir>\htdocs\mediawiki
- Edit the configuration file <mediawiki-dir>\htdocs\mediawiki\LocalSettings.php:
- 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;
- 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 => "");
- $smwgNamespacesWithSemanticLinks = array(
- 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";
- Optionally change $wgDefaultSkin='monobook'; to $wgDefaultSkin='ontoskin3'; if you want to use the skin provided with Halo.
- Save the LocalSettings.php
- 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:
- Add the GNU-Patch to the environment variable (see MS help System Variable or for Unix):
- On Windows:
- Right-click My Computer > Properties
- Click Advanced tab
- Click Environment variables
- In the section System Variable select the variable Path
- Click Edit
- Add a semicolon ";" after the last value and then enter the path of the GNU-Path: <mediawiki-dir>\mediawiki\deployment\tools
- Click OK and close the window
- On Linux: PATH=$PATH:/var/www/mediawiki/deployment/tools
- export PATH
- 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 *
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)
- Upgrade database tables via command line:
- Open a command line window in Admin mode
- Navigate to your mediawiki installation i.e. cd <mediawiki-dir>\htdocs\mediawiki
- Run once php <mediawiki-dir>\htdocs\mediawiki\extensions\SemanticMediawiki\maintenance\SMW_setup.php This sets up the standard database configuration for SMW
- Run once php extensions\SMWHalo\maintenance\SMW_setup.php This will upgrade the database schema and install some wiki pages.
- Alternatively upgrade database tables via Wiki Admin Tool webpage:
- Start Apache and MySQL
- Open your wiki in the browser
- Login as WikiSysop (default credentials are: WikiSysop/root)
- Go the the special page Special SMWHaloAdmin
- Click Initialize
- Patch now Mediawiki and SMW with the delivered patches (Notes on patches):
- Therefore navigate in your command line window in the SMWHalo directory: cd <mediawiki-dir>\htdocs\mediawiki\extensions\SMWHalo
- 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+
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
- Open the URL in your browser: [http:// http://]<your-wiki-url>/mediawiki/deployment/tools/webadmin/login.php
- Login as Wiki admin (default credentials are: WikiSysop, root)
- Click Find extensions tab
- Enter smwplus
- Click Search
- Click Install
- A pop up window indicates the installation progress
- 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
- Open a command line window in Admin mode
- Navigate to the directory of the Wiki Administration Tool cd <mediawiki-dir>\htdocs\mediawiki\deployment\tools
- Type smwadmin -l to get a list of available extensions
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
- Now select an extension or content bundle from the list and type smwadmin -i <extension name> to install it, e.g. smwadmin -i smwplus
- Follow the instructions in the command line
- Now install the content bundle Smwplussandbox by typing smwadmin -i Smwplussandbox
- 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.
| Static facts | Derived facts | ||||||||||||||||||||||||||
Facts about Installing SMW+ 1.6.0 manually on top of MediaWikiRDF feed
| |||||||||||||||||||||||||||



