Top | ![]() |
![]() |
![]() |
![]() |
This is a documentation preview for the next version of Tracker, generated from tracker.git commit c585703.
See the Tracker website for more documentation.
TrackerSparqlConnection * | connection | Read / Write / Construct Only |
char * | sparql | Read / Write / Construct Only |
The TrackerSparqlStatement object represents a SPARQL query. This query may contain parameterized variables (expressed as ~var in the syntax), which may be mapped to arbitrary values prior to execution. This statement may be reused for future queries with different values.
The argument bindings may be changed through tracker_sparql_statement_bind_int()
,
tracker_sparql_statement_bind_boolean()
, tracker_sparql_statement_bind_double()
and tracker_sparql_statement_bind_string()
. 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
tracker_sparql_statement_execute()
or tracker_sparql_statement_execute_async()
.
This object was added in Tracker 2.2.
TrackerSparqlCursor * tracker_sparql_statement_execute (TrackerSparqlStatement *stmt
,GCancellable *cancellable
,GError **error
);
Executes the SPARQL query with the currently bound values.
void tracker_sparql_statement_execute_async (TrackerSparqlStatement *stmt
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously executes the SPARQL query with the currently bound values.
TrackerSparqlCursor * tracker_sparql_statement_execute_finish (TrackerSparqlStatement *stmt
,GAsyncResult *res
,GError **error
);
Finishes the asynchronous operation started through
tracker_sparql_statement_execute_async()
.
stmt |
||
res |
The GAsyncResult from the callback used to return the TrackerSparqlCursor |
|
error |
The error which occurred or |
void tracker_sparql_statement_bind_int (TrackerSparqlStatement *stmt
,const gchar *name
,gint64 value
);
Binds the integer value
to variable name
.
void tracker_sparql_statement_bind_double (TrackerSparqlStatement *stmt
,const gchar *name
,gdouble value
);
Binds the double value
to variable name
.
void tracker_sparql_statement_bind_string (TrackerSparqlStatement *stmt
,const gchar *name
,const gchar *value
);
Binds the string value
to variable name
.
void tracker_sparql_statement_bind_boolean (TrackerSparqlStatement *stmt
,const gchar *name
,gboolean value
);
Binds the boolean value
to variable name
.
void
tracker_sparql_statement_clear_bindings
(TrackerSparqlStatement *stmt
);
Clears all boolean/string/integer/double bindings.
Since: 3.0
TrackerSparqlConnection *
tracker_sparql_statement_get_connection
(TrackerSparqlStatement *stmt
);
Returns the TrackerSparqlConnection that this statement was created from.
const gchar *
tracker_sparql_statement_get_sparql (TrackerSparqlStatement *stmt
);
Returns the SPARQL string that this prepared statement holds.
“connection”
property“connection” TrackerSparqlConnection *
The TrackerSparqlConnection used to perform the query.
Owner: TrackerSparqlStatement
Flags: Read / Write / Construct Only