Previous Topic

Next Topic

iTQL Shell

The iTQLTM shell is a console-based, interactive shell, allowing users to issue iTQL commands to Mulgara. Alternatively, multiple commands can be executed sequentially using iTQL script files.

The interpreter supports several command line options that make working with large numbers of queries easier. You can run the shell as a stand-alone application (packaged in a fully-self-contained executable JAR file), or invoke it directly via API calls. iTQL commands sent to the iTQL interpreter return results directly to the console, whereas iTQL commands sent via the communication methods listed above return answers as native Java objects (in the case of direct API calls) or in XML.

You must have the correct version of JavaTM software installed in order to run Mulgara and the iTQL shell. You can check the version you have installed by typing at a command line:

$ java -version

Something similar to the following should display:

java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

If the above does not display, add <JAVA_HOME>/bin, where <JAVA_HOME> is the location where J2SETM is installed, to your PATH (in the appropriate way for your shell).

Note - You must use J2SE 1.4.2 or higher. Mulgara does not run on beta 2 or prior.

How you start the iTQL shell depends on your platform. To start the iTQL shell from a:

  • Windows® interface, choose Start » Programs » TKS » iTQL CLI
  • Windows command line:

    cd <tks drive>:\<tks folder>
    itql

  • UNIX® or Linux® command line:

    cd <tks directory>
    java -jar itql-2.1.jar

    or

    ./itql

Starting iTQL with the executable jar file allows you to pass arguments to the shell, changing the way iTQL operates. See the iTQL Shell Options section for more information about these arguments.

After starting iTQL, a message similar to the following displays:

iTQL Command Line Interface
Copyright (C) 2001-2004 Tucana Technologies Inc.

Type "help ;", then enter for help.

iTQL>

The last line is the iTQL prompt. This is where you issue iTQL commands.

To display a list of iTQL commands:

iTQL>help;

To display detailed help for a particular command:

iTQL>help command;

Where command is the name of the iTQL command.

The following example queries a model named documents on a Mulgara server on the machine mysite.com to find the URLs and titles of all documents.

iTQL>select $url $title
from <rmi://mysite.com/server1#documents>
where ($url $y <http://mulgara.org/mulgara/Document#Document> )
and ( $url <http://mulgara.org/mulgara/Document#hasHtml> $node )
and ( $node <http://mulgara.org/mulgara/tool/HtmlExtractor#title> $title );

Note - iTQL supports the AND and OR operators as well as standards such as XML namespaces and URIs.

The following is an example of submitting the above query to the iTQL shell.

iTQL>select $url $title
from rmi://mysite.com/server1#documents
where ($url $y <http://mulgara.org/mulgara/Document#Document> )
and ( $url <http://mulgara.org/mulgara/Document#hasHtml> $node )
and ( $node <http://mulgara.org/mulgara/tool/HtmlExtractor#title> $title ) ;

2 columns: url title (2 rows)
url=http://mulgara.org/projects/mulgara/data/docs/doc95.htm
title="Expect lower rate of gain in the value of homes"
url=http://mulgara.org/projects/mulgara/data/docs/doc49.htm
title="District Court refuses to certify class alleging notice violations"

See Also

System Architecture

JavaServer Pages Tag Library

Simple Object Access Protocol (SOAP)

iTQL Bean

Mulgara Driver

Java RDF (JRDF)

Open Source logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.

© 2006 The Mulgara Project. Some rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".