I just set up Semantic Mediawiki on my Ubuntu laptop (it's a touchscreen laptop but I haven't gotten anything special working yet with touchscreen + mediawiki). The purpose of this exercise was to have a personal wiki for notetaking with more features that TomBoy. The main feature I wanted from the Semantic Medeawiki addon to mediawiki was the ability to create dynamic lists of pages from elsewhere on the wiki, since I spend a lot of time listing things (collecting examples of particular ideas, mostly).
Mediawiki is the platform which Wikipedia uses, and it thusly has lots of useful features for organizing knowledge. Besides, anyone comfortable with the way Wikipedia is organized has an intuitive grasp of how to organize things in it. So it makes a good notetaking platform.
Anyway. I figured it would be worthwhile to write up my experience since it took a little effort to get everything working. The first step was to install mediawiki, which is easy on Ubuntu; just type "sudo aptitude install mediawiki" in the terminal (without quotes of course). I did "sudo aptitude install mediawiki mediawiki-extensions mediawiki-math imagemagick"; I think I'll need the math extensions, but I just installed mediawiki-extensions to be safe. Actually, looking
here suggests it's some reasonably useful stuff. The other packages were recommended
here. (Note, I'm installing mediawiki on ubuntu hardy, so aptitude install mediawiki got me mediawiki 1.11.)
Once mediawiki was installed it had to be set up, following the instructions which can be found
elsewhere.
I installed Semantic Mediawiki with the
Semantic Bundle package, rather than hunting down what semantic extensions I wanted or needed. So I downloaded their package and extracted it to /var/lib/mediawiki/extensions. However, upon adding the lines recommended to /var/lib/LocalSettings.php, my wiki just crashed upon refresh. I had to add the following line as well:
ini_set( 'memory_limit', '100M' );
and comment out all the extensions but Semantic Mediawiki itself in /var/lib/mediawiki/extensions/semantic-bundle/SemanticBundleSettings.php (a copy of SemanticBundleSettings.sample.php, as recommended by their instructions) before I could get to the Special:SMWAdmin page. (Add # before all the require_once or include_once lines in /var/lib/mediawiki/extensions/semantic-bundle/SemanticBundleSettings.php except the first.)
I also had to comment out a line in /var/lib/mediawiki/extensions/SemanticMediaWiki/includes/SMW_RefreshTab.php
//'href' => $skin->mTitle->getLocalUrl( 'action=purge' )
This line was actually my main difficulty in installing semantic mediawiki. I had to figure out what was going on here in order to convince myself that commenting this out was OK. So, what this file does is add a tab to every page on your mediawiki, after 'view', 'edit', etc. The purpose of that tab is to let you manually refresh a page's automatically generated lists, since their content can change even when that page hasn't been edited. This can also be accomplished just by appending ?action=purge to the URL of the page, so besides commenting out this line, I changed the text of the tab to "action=purge" to remind myself how to do this.
Changed:
'text' => wfMsg('smw_purge'),
to:
'text' => 'action=purge'//wfMsg('smw_purge'),
Yes, that's pretty silly, and I could have thought of much more creative text for the useless tab, or just gotten rid of it. Do as you will.
I don't know why the line I had to comment out produces an error rather than the desired effect, by the way, and if anyone knows how to fix it, that would be nice.
So anyway, after all this commenting stuff out it was finally time to visit Special:SMWAdmin. But the initialization of the mysql database didn't work; I had to go into mysql (type "sudo mysql -u root -p mysql") followed by the following line:
grant all on wikidb.* to 'wikiuser'@'localhost' identified by 'password';
where password of course was replaced by the password I had used when setting up mediawiki. I found variations of this line elsewhere which did not grant such pervasive rights ("all") to wikiuser; it might be wiser to use
one of those.
After this the first button on the SMWAdmin page worked just fine, and then I re-enabled the other addons by copying SemanticBundleSettings.sample.php back over SemanticBundleSettings.php.
At this point everything was working just fine! There is a little tour
here of some of the useful features of semantic mediawiki.
I guess I should mention, another thing that took me a little while to catch on to was customizing the site logo. For the most part the instructions on the MediaWiki site worked just fine; the line
$wgLogo = "${wgScriptPath}/skins/common/images/three.png";
made "three.png" into my logo. But this didn't seem to work unless three.png was in that images folder; for example
$wgLogo = "${wgScriptPath}/three.png";
doesn't work even though I have a copy of the image there.
OK! That's it, I hope I didn't forget any steps.