Previous Topic

Next Topic

iTQL Bean

The iTQLTM bean provides a level of abstraction above that of the iTQL interpreter, providing convenience methods for executing commands and queries on KowariTM servers, and obtaining their results. It is a JavaBeanTM that implements the JavaBeans 1.01 specification making it the ideal choice for graphical development using Integrated Development Environments (IDEs).

The iTQL bean is suitable for integration with text-based console applications, graphical user interfaces (swing applications, for example) and JavaServer PagesTM (JSP).

As well as the standard JavaBean properties and methods, the iTQL bean exposes the methods as listed in the file ItqlInterpreterBean.

The following example uses the iTQL bean to query a Kowari server and list the contents of a Kowari model.

// Standard Java Packages
import java.sql.*;

// Kowari packages
import org.kowari.itql.ItqlInterpreterBean;
import org.kowari.query.Answer;

try {

// Query to select all subject-predicate-object statements from the model
String query = "select $s $p $o from <"+modelName+"> where $s $p $o ;";

// Do the query
Answer answer = interpreter.executeQuery(query);

// Print out the results

System.out.println("\nQuery Results:\n");

while (answer.next()) {

Object subject = answer.getObject(0);
Object predicate = answer.getObject(1);
Object object = answer.getObject(2);

System.out.println("Subject: "+subject+", Predicate:"+predicate+
", Object: "+object);
answer.close();
}
}
catch (Exception e) {
System.out.println("\nAn Exception occurred: \n"+e);
}

See Also

System Architecture

JavaServer Pages Tag Library

iTQL Shell

Simple Object Access Protocol (SOAP)

Kowari Driver

Java RDF (JRDF)

Latest News

Kowari 1.1.0 Pre-release 1 Released

Kowari 1.0.5 Released

Kowari 1.0.4.1 Released

Kowari 1.0.4 Released

DAWG Evaluates iTQL

Kowari article in XML.com

Kowari mentioned on XML.com

Kowari 1.0.3 Released

Kowari Lite Introduced

Kowari 1.0.2 Released

Kowari 1.0.1 Released

View all news items


Open Source logo Tucana Technologies Logo SourceForge.net Logo

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