An Ontopia/Joomla integration

At TMRA 2010 a team of Czech researchers at the University of Economics in Prague presented their integration of Ontopia with the Joomla! CMS. Joomla is written in PHP, so they used the TMRAP web service to invoke tolog queries on the Ontopia server, and then present the results with XSLT. They have a UI for managing this, and even a framework for building user-friendly tolog query builders.

For more information, see the presentation page, which has the full paper and the slides. (Later, it will also have a video of the presentation.)

Building Web Applications with Ontopia, part 3

The Christmas break gave Trond Pettersen enough time to complete part 3 in his series about Building Web Applications with Ontopia. This part shows how to write the code of the actual JSP pages that make up the web application. This means that the series is now completed to the point where it shows you how to actually build an entire web application using Ontopia and Topic Maps.

For reference, these are the parts completed so far:

  1. Installation and requirements
  2. Creating the database
  3. Writing the JSPs

Triggers

While presenting tolog updates at TMRA 2009 I casually referred to the possibility of using tolog updates to create a trigger mechanism in Ontopia similar to triggers in relational databases. After the presentation the idea grew on me, and so I decided to elaborate a little further on it and present it in the open space session. The result was this little presentation, which gives a brief outline of the idea.

tolog updates

Unlike SQL tolog has so far only had support for queries, but that has now changed. Lars Marius Garshol has now extended the tolog implementation in Ontopia with support for tolog updates, which extend tolog by adding DELETE, UPDATE, INSERT, and MERGE statements, in addition to the familiar SELECT.

The update statements are described in more detail in the TMRA 2009 paper. The slides may be a bit more approachable, but have less detail, obviously. The idea for the update language is actually quite old. Here’s a blog post about an early design from 2006.

Anyway, if you want to try it, you need to get the latest source code from Subversion. In Omnigator you’ll find the “Generic Query” plugin. If you put in an update statement and click the “Update” button it will run the update statement for you. One way to try it is to navigate to the city Munich in the Italian Opera topic map in Omnigator, then click to open the generic query plugin in a new tab. In that tab, run the following query:

update value($TN, "München")
from topic-name(munich, $TN)

Now go back to the original tab, and press reload. You’ll see the name of the city change. Magic!

Using Ontopia in PHP

Jan Schreiber has written an excellent blog post on accessing Ontopia from PHP, which shows how you can use the Java TMAPI implementation in PHP or alternatively run a tolog query from PHP.

As Jan pointed out in private conversation, there is probably a fair bit of overhead in calling Java classes from PHP in this way, so running tolog queries is probably the most efficient way to do this, since then all the heavy lifting happens inside the JVM.