org.openrdf.elmo
Interface ElmoQuery

All Superinterfaces:
Closeable
All Known Implementing Classes:
SesameQuery

public interface ElmoQuery
extends Closeable

Interface used to bind and evaluate a query

Author:
James Leigh

Method Summary
 void close()
          Closes any open results from this query.
 Iterator<?> evaluate()
          Evaluates the query and returns an iterator over the result.
 List getResultList()
          Evaluates the query and returns the results disconnected from the query.
 Object getSingleResult()
          Evaluates the query and return the first result.
 ElmoQuery setFirstResult(int startPosition)
          Skips to the startPosition of the results.
 ElmoQuery setMaxResults(int maxResult)
          Terminates the result list after reading maxResult
 ElmoQuery setParameter(String name, Object value)
          Assigns an entity or literal to the given name.
 ElmoQuery setParameter(String name, String label, Locale locale)
          Binds a literal with no type and a language of locale.
 

Method Detail

close

void close()
Closes any open results from this query.

Specified by:
close in interface Closeable

evaluate

Iterator<?> evaluate()
Evaluates the query and returns an iterator over the result.

Returns:
Iterator over the result of the query.

getSingleResult

Object getSingleResult()
Evaluates the query and return the first result.

Returns:
The first result from the query.

getResultList

List getResultList()
Evaluates the query and returns the results disconnected from the query.

Returns:
The results from the query.

setFirstResult

ElmoQuery setFirstResult(int startPosition)
Skips to the startPosition of the results.

Parameters:
startPosition -

setMaxResults

ElmoQuery setMaxResults(int maxResult)
Terminates the result list after reading maxResult

Parameters:
maxResult -

setParameter

ElmoQuery setParameter(String name,
                       String label,
                       Locale locale)
Binds a literal with no type and a language of locale.

Parameters:
name - Name of the variable to bind to.
label -
locale -

setParameter

ElmoQuery setParameter(String name,
                       Object value)
Assigns an entity or literal to the given name.

Parameters:
name - Name of the variable to bind to.
value - managed entity or literal.


Copyright © 2004-2007. All Rights Reserved.