MediaWiki

Check for SMW version

if ( version_compare( SMW_VERSION, '1.6 alpha', '<' ) ) { // bc hevaiour here

RDFIO 0.4.0 released - GSoC Finished!

With the release of RDFIO 0.4.0, my GSoC 2010 project is now over!

I want to thank especially my mentor Denny Vrandečić, and also the SMW community at large for a great time! I also want to sincerely thank my masters project mentor Egon Willighagen who mentioned about, and encouraged me to apply to the program. Without this encouragement, I'd never taken the step. It has been a good time and rewarding, and I've much enjoyed to have time to get a bit into MediaWiki/SMW extensions development, as well as to provide some new functionality to these great bits of software.

The main GSoC coding is now over, and I will need to take a little break for an exam this friday, but surely I'll continue to refine the RDFIO extension later, especially as Egon and me are looking into using it to integrate Bioclipse with SMW in order to make RDF data in Bioclipse "Community editable" (could turn out to be some real useful stuff!).

The 0.4.0 release

This new release brings a lot of refactoring and reworkings under the hood, as well as quite a few minor bugfixes and improvements here and there, so upgrading is recommended. We also got the issues in SMWWriter fixed now, so patching it is no longer needed, which hopefully will make installing easier!

Of the more notable changes are the improved selection of wiki titles on import, as described in this blog post. Another important fix is that the default output format (if not specifying any) is now "SPARQL Resultset XML" which now makes the SPARQL endpoint fully "SPARQL compliant" and queryable from typical SPARQL tools like Jena. It is a remaining topic though how to allow update operations without leaving the endpoint wide open ... i.e. how to implement some form of user rights checking, when used as a webservice.

A little technical note also is that RDFIO now takes the $wgDBprefix parameter into account, so if you are using RDFIO with table prefixes in the database, you will need to regenerate the tables and the triples in the store (can be done at the Special:ARC2Admin and Special:SMWAdmin pages respectively).

I should not end without a note about some great bits of existing code that I've had the pleasure to make use of:

  • ARC, the PHP RDF library I've been using, and on which RDFIO is very heavily dependent
    I found it very powerful and super conveniant to work with!
  • I enjoyed making use of the SMWWriter and PageObjectModel extensions, which also definitely made life easier for me and saved me tons of work.

Debugging MediaWiki extensions with Eclipse for PHP and XDebug on Ubuntu 10.04

 I ran into some troubles with the debugging with XDebug in Eclipse for PHP Developers / PDT (breakpoints stopped to take / catch, after I changed location of my www folder - which I figured out later), so I wanted to document the full setup procedure it here. I mainly followed this blog post. (Assuming you have apache and php set up!).

  • Download Eclipse for PHP developers
    • I'm using the Linux 32 bit version
    • Because of a bug with PDT for Eclipse Helios, I chose to go with Eclipse PDT SR2 for now.
  • Install XDebug by typing:
 apt-get install php5-xdebug
  • Edit /etc/php5/conf.d/xdebug.ini to look something like this:
 zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
# xdebug.remote_log="/tmp/xdebug.log" 
    • The log line can be good to enable in case you run into troubles.
    • The first line can be different depending on PHP version. Use the line that you can find in the file (which is the default for your version of Ubuntu):
 /etc/php5/conf.d/xdebug.ini.ucf-dist
  • Restart apache:
 sudo apache2ctl restart

Configure Eclipse

  • Create a PHP Project. Mine is named "RDF4SMW".
  • Choose Run > Debug Configurations in Eclipse
  • Turn the configuration to your web server setup. For me, it looks like this ("smw" is the folder where MediaWiki is installed):

Custom location of www folder

Then an important thing If you have changed the location of your www folder from /var/www, then don't miss this! This was what caused the problem for me, with breakpoints not taking:

  • Click the "Configure" button in the Debug configuration screen seen above
  • Click the "Path mapping" tab
  • Configure according to the location of your www folder. My current config looks like so:
  • This should be it. Happy debugging!