org.openrdf.query
Interface Query

All Known Subinterfaces:
BooleanQuery, GraphQuery, TupleQuery
All Known Implementing Classes:
AbstractQuery, HTTPBooleanQuery, HTTPGraphQuery, HTTPQuery, HTTPTupleQuery, SailBooleanQuery, SailGraphQuery, SailQuery, SailTupleQuery

public interface Query

A query on a Repository that can be formulated in one of the supported query languages (for example SeRQL or SPARQL). It allows one to predefine bindings in the query to be able to reuse the same query with different bindings.

Author:
Arjohn Kampman, jeen
See Also:
RepositoryConnection

Method Summary
 BindingSet getBindings()
          Retrieves the bindings that have been set on this query.
 Dataset getDataset()
          Gets the dataset that has been set using setDataset(Dataset), if any.
 boolean getIncludeInferred()
          Returns whether or not this query will return inferred statements (if any are present in the repository).
 int getMaxQueryTime()
          Returns the maximum query evaluation time.
 void removeBinding(String name)
          Removes a previously set binding on the supplied variable.
 void setBinding(String name, Value value)
          Binds the specified variable to the supplied value.
 void setDataset(Dataset dataset)
          Specifies the dataset against which to evaluate a query, overriding any dataset that is specified in the query itself.
 void setIncludeInferred(boolean includeInferred)
          Determine whether evaluation results of this query should include inferred statements (if any inferred statements are present in the repository).
 void setMaxQueryTime(int maxQueryTime)
          Specifies the maximum time that a query is allowed to run.
 

Method Detail

setBinding

void setBinding(String name,
                Value value)
Binds the specified variable to the supplied value. Any value that was previously bound to the specified value will be overwritten.

Parameters:
name - The name of the variable that should be bound.
value - The (new) value for the specified variable.

removeBinding

void removeBinding(String name)
Removes a previously set binding on the supplied variable. Calling this method with an unbound variable name has no effect.

Parameters:
name - The name of the variable from which the binding is to be removed.

getBindings

BindingSet getBindings()
Retrieves the bindings that have been set on this query.

Returns:
A (possibly empty) set of query variable bindings.
See Also:
setBinding(String, Value)

setDataset

void setDataset(Dataset dataset)
Specifies the dataset against which to evaluate a query, overriding any dataset that is specified in the query itself.


getDataset

Dataset getDataset()
Gets the dataset that has been set using setDataset(Dataset), if any.


setIncludeInferred

void setIncludeInferred(boolean includeInferred)
Determine whether evaluation results of this query should include inferred statements (if any inferred statements are present in the repository). The default setting is 'true'.

Parameters:
includeInferred - indicates whether inferred statements should included in the result.

getIncludeInferred

boolean getIncludeInferred()
Returns whether or not this query will return inferred statements (if any are present in the repository).

Returns:
true if inferred statements will be returned, false otherwise.

setMaxQueryTime

void setMaxQueryTime(int maxQueryTime)
Specifies the maximum time that a query is allowed to run. The query will be interrupted when it exceeds the time limit. Any consecutive requests to fetch query results will result in QueryInterruptedExceptions.

Parameters:
maxQueryTime - The maximum query time, measured in seconds. A negative or zero value indicates an unlimited query time (which is the default).

getMaxQueryTime

int getMaxQueryTime()
Returns the maximum query evaluation time.

Returns:
The maximum query evaluation time, measured in seconds.
See Also:
#maxQueryTime


Copyright © 2001-2008 Aduna. All Rights Reserved.