My favorites | Sign in
Logo
                
Search
for
Updated Nov 16, 2009 by thomas.n...@spaceapplications.com
TomaImplementation  
Information about the TOMA implementation for Ontopia.

Introduction

This page gives information about the status of the TOMA query language implementation for Ontopia.

Status

The implementation currently lives in the sandbox part of Subversion, so you must access the sandbox to find it.

The implementation is fully functional, missing parts are as follows:

  • square brackets have to be fully supported
  • query optimization has to be improved
  • improve test coverage & documentation

Compile & Run

Prerequisites

- Apache Maven 2.0 (or later)

Compile

 cd sandbox/toma
 mvn compile package

Commandline

A simple command-line tool to run queries against a topic map is included. To run it, simply type in the following to get a help message:

 cd target
 java -jar toma-{$version}-full.jar

Omnigator Integration

Copy the current toma package to the common library path of the ontopia tomcat instance.

 cp target/toma-{$version}.jar {$ontopia-install-path}/apache-tomcat/common/lib

Select a topic map within omnigator and use the "Generic Query" plugin, where you can select "Toma" as query processor.

Google AppEngine

Toma can also be tested out using a specific version of omnigator deployed to Google AppEngine: http://toma-demo.appspot.com/.

Examples

Some examples based on the famous Italian Opera topic map:

Description Query
Get the names of all operas select $t.name where $t.type = opera;
Get all persons which have been born in Milano select $t where milano.(place)<-(born-in)->(person) = $t;
Get the first 3 Composers select $c where $c.type = composer limit 3;
Get all operas which have a name that starts with 'B' or 'V' and sort by the ID select $t, $t.name where $t.type = opera and $t.name ~ 'B' union select $t, $t.name where $t.type = opera and $t.name ~ 'V' order by 1;
Count the number of operas select count($t) where $t.type = opera;
Get all web resources about librettos select $t.oc(libretto)@web where exists $t.oc(libretto)@web;

Note: do not forget to escape '$' with '\' when trying to run the examples in a shell.

More examples be found within the 'Generic Query' plugin of Omnigator while using the ItalianOpera.ltm topic map.

Specification

The current specification can be found here: TOMA Specification


Sign in to add a comment
Hosted by Google Code