[ CCode ( type_id = "tracker_sparql_statement_get_type ()" ) ]
[ GIR ( name = "SparqlStatement" ) ]
public abstract class Statement : Object
`TrackerSparqlStatement` represents a prepared statement for a SPARQL query.
The SPARQL query will be internally compiled into the format that is most optimal to execute the query many times. For connections created through [ctor@SparqlConnection.new] that will be a SQLite compiled statement.
The SPARQL query may contain parameterized variables expressed via the `~` prefix in the SPARQL syntax (e.g. `~var`), these may happen anywhere in the SPARQL where a literal or variable would typically happen. These parameterized variables may be mapped to arbitrary values prior to execution. The `TrackerSparqlStatement` may be reused for future queries with different values.
The argument bindings may be changed through the [method@SparqlStatement.bind_int], [method@SparqlStatement.bind_int], etc... family of
functions. Those functions receive a name argument corresponding for the variable name in the SPARQL query (eg. `"var"` for
`~var`) and a value to map the variable to.
Once all arguments have a value, the query may be executed through [method@SparqlStatement.execute_async] or [ method@SparqlStatement.execute].
It is possible to use any `TrackerSparqlStatement` from other threads than the one it was created from. However, binding values and executing the statement must only happen from one thread at a time. It is possible to reuse the `TrackerSparqlStatement` right after [ method@SparqlStatement.execute_async] was called, there is no need to wait for [method@SparqlStatement.execute_finish].
In some circumstances, it is possible that the query needs to be recompiled from the SPARQL source. This will happen transparently.