eRqlEngine API documentation - http://www.wleklinski.de/rdf/

eworks.RQL.model
Class Query

java.lang.Object
  extended byeworks.RQL.model.Query

public class Query
extends Object

Represents a RQL query.

Remark: Currently RqlEngine does not support nested queries (subqueries), although RQL itself does support them. In future this class could be used for representing a query's subqueries as well.

Version:
1.00 (2003-11-03)
Author:
Fabian Wleklinski (fabian@wleklinski.de)
See Also:
The RDF Query Language (RQL)

Constructor Summary
Query()
          Creates a new and empty RQL query.
Query(ProjectionList pl, RangeList rangeList, DisjunctionCondition c, boolean distinct)
          Creates a new query with a certain projection list, range list and disjunction condition.
 
Method Summary
 void compact()
          Compacts this query.
 Tuples execute(Model model)
          Executes this query with an empty symbol table.
 Tuples execute(SymbolTable symbols, Model model)
          Executes this query with a given symbol table.
 ProjectionList getProjection()
          Returns this query's projection list.
 RangeList getRange()
          Returns this query's range.
 Condition getSelection()
          Returns this query's condition used to select, that's the WHERE clause according to the RQL syntax.
 boolean isDistinct()
          Returns true if there are no duplicates allowed in this query's result.
 void setProjection(ProjectionList pl)
          Sets this query's projection list.
 void setRange(RangeList rangeList)
          Sets this query's range.
 String toString()
          Returns this query's string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query()
Creates a new and empty RQL query.


Query

public Query(ProjectionList pl,
             RangeList rangeList,
             DisjunctionCondition c,
             boolean distinct)
Creates a new query with a certain projection list, range list and disjunction condition.

Parameters:
pl - The projection list to use.
rangeList - The range list to use.
c - The disjunction condition to use.
distinct - If set to true, there will be no duplicates in this query's result. (See SQL.)
Method Detail

isDistinct

public boolean isDistinct()
Returns true if there are no duplicates allowed in this query's result.

Returns:
true if and only if there are no duplicates allowed.

getSelection

public Condition getSelection()
Returns this query's condition used to select, that's the WHERE clause according to the RQL syntax.

Returns:
This query's condition used to select.

getProjection

public ProjectionList getProjection()
Returns this query's projection list.

Returns:
This query's projection list.

setProjection

public void setProjection(ProjectionList pl)
Sets this query's projection list.

Parameters:
pl - This query's new projection list.

getRange

public RangeList getRange()
Returns this query's range.

Returns:
This query's range.

setRange

public void setRange(RangeList rangeList)
Sets this query's range.

Parameters:
rangeList - This query's new range.

toString

public String toString()
Returns this query's string representation.

Returns:
This query's string representation.

compact

public void compact()
Compacts this query. This is done by calling the disjunction's compact()-method and storeing the result.


execute

public Tuples execute(Model model)
               throws VariableAlreadyBoundException,
                      VariableNotBoundException
Executes this query with an empty symbol table.

Parameters:
model - The model to be used.
Returns:
The query's result.
Throws:
VariableAlreadyBoundException - if one and the same variable is tried to be bound twice while evaluating this query.
VariableNotBoundException - if a variable's value is being used although the variable itself has not been bound.

execute

public Tuples execute(SymbolTable symbols,
                      Model model)
               throws VariableAlreadyBoundException,
                      VariableNotBoundException
Executes this query with a given symbol table.

Parameters:
symbols - The initial symbol table to be used.
model - The model to be used.
Returns:
The query's result.
Throws:
VariableAlreadyBoundException - if one and the same variable is tried to be bound twice while evaluating this query.
VariableNotBoundException - if a variable's value is being used although the variable itself has not been bound.

eRqlEngine API documentation - http://www.wleklinski.de/rdf/