Previous topic  Top  Next topic  Print this Topic
 

Paging Support for Web Service

 

The OntoBroker Web service now has support for paging through the results of a query. This is useful if you want to process large result sets in smaller pieces.

Operations

There are three operations in the OntoBroker Web service.

Operation

Annotation

openQuery

Starts evaluation of the query and returns the query key.

long queryKey = _client.openQuery(query, fullXml)

getNextQueryResults

Retrieves the next results.

PagedQueryResults results = _client.getNextQueryResults(queryKey, maxResults, maxWaitTimeInMs)

The number of the results returned is restricted by two parameters: No more than maxResults are returned. If the call waits longer than maxWaitTimeIsMs milliseconds, the call returns the results it has collected during this time span. If the PagedQueryResults.isFinished() method returns true, the query is finished and there are no more results. The query is automatically closed on the server side.

cancelOpenQuery

Call this operation to cancel an open query. If you do not retrieve all of the query results, it is important to call this method as the query is still open on the server side and will block resources.