query


Description:

public SparqlCursor query (string sparql, Cancellable? cancellable = null) throws Error

Executes a SPARQL query on this.

This method is synchronous and will block until the query is executed. See [method@SparqlConnection.query_async] for an asynchronous variant.

If the query is partially built from user input or other untrusted sources, special care is required about possible SPARQL injection. In order to avoid it entirely, it is recommended to use [class@SparqlStatement]. The function [func@sparql_escape_string] exists as a last resort, but its use is not recommended.

Parameters:

this

A `TrackerSparqlConnection`

sparql

String containing the SPARQL query

cancellable

Optional [type@Gio.Cancellable]

Returns:

a [class@SparqlCursor] with the results.