Cursor


Object Hierarchy:

Object hierarchy for Cursor

Description:

[ CCode ( type_id = "tracker_sparql_cursor_get_type ()" ) ]
[ GIR ( name = "SparqlCursor" ) ]
public abstract class Cursor : Object

`TrackerSparqlCursor` provides the methods to iterate the results of a SPARQL query.

Cursors are obtained through e.g. [method@SparqlStatement.execute] or [method@SparqlConnection.query] after the SPARQL query has been executed.

When created, a cursor does not point to any element, [method@SparqlCursor.next] is necessary to iterate one by one to the first (and following) results. When the cursor iterated across all rows in the result set, [method@SparqlCursor.next] will return false with no error set.

On each row, it is possible to extract the result values through the [method@SparqlCursor.get_integer], [method@SparqlCursor.get_string], etc... family of methods. The column index of those functions starts at 0. The number of columns is dependent on the SPARQL query issued, but may be checked at runtime through the [method@SparqlCursor.get_n_columns] method.

After a cursor is iterated, it is recommended to call [method@SparqlCursor.close] explicitly to free up resources for other users of the same [class@SparqlConnection], this is especially important in garbage collected languages. These resources will be also implicitly freed on cursor object finalization.

It is possible to use a given `TrackerSparqlCursor` in other threads than the one it was created from. It must be however used from just one thread at any given time.


Namespace: Tracker.Sparql

Content:

Properties:

Creation methods:

Methods:

Inherited Members: