| Top |
TrackerBatch is an object containing a series of SPARQL updates, in either SPARQL string or TrackerResource form. This object has a single use, after the batch is executed, it can only be finished and freed.
A batch is created with tracker_sparql_connection_create_batch().
To add resources use tracker_batch_add_resource() or
tracker_batch_add_sparql().
When a batch is ready for execution, use tracker_batch_execute()
or tracker_batch_execute_async(). The batch is executed as a single
transaction, it will succeed or fail entirely.
The mapping of blank node labels is global in a TrackerBatch, referencing the same blank node label in different operations in a batch will resolve to the same resource.
This object was added in Tracker 3.1.
TrackerSparqlConnection *
tracker_batch_get_connection (TrackerBatch *batch);
Returns the TrackerSparqlConnection that this batch was created from.
void tracker_batch_add_sparql (TrackerBatch *batch,const gchar *sparql);
Adds an SPARQL update string to batch
.
Since: 3.1
void tracker_batch_add_resource (TrackerBatch *batch,const gchar *graph,TrackerResource *resource);
Adds the RDF represented by resource
to batch
.
Since: 3.1
gboolean tracker_batch_execute (TrackerBatch *batch,GCancellable *cancellable,GError **error);
Executes the batch. This operations happens synchronously.
Since: 3.1
void tracker_batch_execute_async (TrackerBatch *batch,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Executes the batch. This operation happens asynchronously, when
finished callback
will be executed.
batch |
||
cancellable |
a GCancellable, or |
[nullable] |
callback |
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user_data |
user-defined data to be passed to |
Since: 3.1
gboolean tracker_batch_execute_finish (TrackerBatch *batch,GAsyncResult *res,GError **error);
Finishes the operation started with tracker_batch_execute_async().
Since: 3.1
“connection” property“connection” TrackerSparqlConnection *
The TrackerSparqlConnection the batch belongs to.
Owner: TrackerBatch
Flags: Read / Write / Construct Only