org.openrdf.elmo
Interface ElmoQuery

All Known Implementing Classes:
SesameQuery

public interface ElmoQuery

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.
 ElmoQuery setQName(String name, QName qname)
          Assigns entity by name to the given parameter name.
 ElmoQuery setType(String name, Class<?> concept)
          Assigns a concept to the given name.
 

Method Detail

close

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


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 -

setType

ElmoQuery setType(String name,
                  Class<?> concept)
Assigns a concept to the given name.

Parameters:
name - Name of the variable to bind to.
concept - Registered concept.

setQName

ElmoQuery setQName(String name,
                   QName qname)
Assigns entity by name to the given parameter name.

Parameters:
name - Name of the variable to bind to.
qname - Name of the entity.

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-2008 Aduna. All Rights Reserved.