### Class

# Tracker SparqlCursor

#### Description [src]

    abstract class Tracker.SparqlCursor : GObject.Object
    {
      /* No available fields */
    }

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

Cursors are obtained through e.g. `tracker_sparql_statement_execute()` or `tracker_sparql_connection_query()` after the SPARQL query has been executed.

When created, a cursor does not point to any element, `tracker_sparql_cursor_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, `tracker_sparql_cursor_next()` will return `FALSE` with no error set.

On each row, it is possible to extract the result values through the `tracker_sparql_cursor_get_integer()`, `tracker_sparql_cursor_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 `tracker_sparql_cursor_get_n_columns()` method.

After a cursor is iterated, it is recommended to call `tracker_sparql_cursor_close()` explicitly to free up resources for other users of the same `TrackerSparqlConnection`, 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.

#### Ancestors

- GObject

#### Instance methods

###### tracker_sparql_cursor_close

Closes the cursor. The object can only be freed after this call.

###### tracker_sparql_cursor_get_boolean

Retrieve a boolean for the current row in `column`.

###### tracker_sparql_cursor_get_connection

Returns the `TrackerSparqlConnection` associated with this `TrackerSparqlCursor`.

###### tracker_sparql_cursor_get_datetime

Retrieves a `GDateTime` pointer for the current row in `column`.

since: 3.2

###### tracker_sparql_cursor_get_double

Retrieve a double for the current row in `column`.

###### tracker_sparql_cursor_get_integer

Retrieve an integer for the current row in `column`.

###### tracker_sparql_cursor_get_langstring

Retrieves a string representation of the data in the current row in `column`. If the string has language information (i.e. it is a `rdf:langString`](rdf-ontology.html#rdf:langString)), the language tag will be returned in the location provided through `langtag`. This language tag will typically be in a format conforming RFC 5646.

since: 3.7

###### tracker_sparql_cursor_get_n_columns

Retrieves the number of columns available in the result set.

###### tracker_sparql_cursor_get_string

Retrieves a string representation of the data in the current row in `column`.

###### tracker_sparql_cursor_get_value_type

Returns the data type bound to the current row and the given `column`.

###### tracker_sparql_cursor_get_variable_name

Retrieves the name of the given `column`.

###### tracker_sparql_cursor_is_bound

Returns whether the given `column` has a bound value in the current row.

###### tracker_sparql_cursor_next

Iterates the cursor to the next result.

###### tracker_sparql_cursor_next_async

Iterates the cursor asyncronously to the next result.

###### tracker_sparql_cursor_next_finish

Finishes the asynchronous iteration to the next result started with `tracker_sparql_cursor_next_async()`.

###### tracker_sparql_cursor_rewind

Resets the iterator to point back to the first result.

deprecated: 3.5

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Tracker.SparqlCursor:connection

The `TrackerSparqlConnection` used to retrieve the results.

###### Tracker.SparqlCursor:n-columns

Number of columns available in the result set.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct TrackerSparqlCursorClass {
      /* no available fields */
    }

No description available.