TrackerBatch
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.
TrackerBatch
GObject
╰──TrackerBatch
Members
parent_instance
(GObject)
–
Class structure
TrackerBatchClass
Tracker.BatchClass
Tracker.BatchClass
Tracker.Batch
GObject.Object
╰──Tracker.Batch
Members
parent_instance
(GObject.Object)
–
Tracker.Batch
GObject.Object
╰──Tracker.Batch
Members
parent_instance
(GObject.Object)
–
Methods
tracker_batch_add_resource
tracker_batch_add_resource (TrackerBatch * batch, const gchar* graph, TrackerResource * resource)
Adds the RDF represented by resource to batch.
Parameters:
batch
–
graph
(
[nullable])
–
RDF graph to insert the resource to
resource
–
Since : 3.1
Tracker.Batch.prototype.add_resource
function Tracker.Batch.prototype.add_resource(graph: String, resource: Tracker.Resource): {
// javascript wrapper for 'tracker_batch_add_resource'
}
Adds the RDF represented by resource to batch.
Parameters:
RDF graph to insert the resource to
Since : 3.1
Tracker.Batch.add_resource
def Tracker.Batch.add_resource (self, graph, resource):
#python wrapper for 'tracker_batch_add_resource'
Adds the RDF represented by resource to batch.
Parameters:
RDF graph to insert the resource to
Since : 3.1
tracker_batch_add_sparql
tracker_batch_add_sparql (TrackerBatch * batch, const gchar* sparql)
Adds an SPARQL update string to batch.
Since : 3.1
Tracker.Batch.prototype.add_sparql
function Tracker.Batch.prototype.add_sparql(sparql: String): {
// javascript wrapper for 'tracker_batch_add_sparql'
}
Adds an SPARQL update string to batch.
Since : 3.1
Tracker.Batch.add_sparql
def Tracker.Batch.add_sparql (self, sparql):
#python wrapper for 'tracker_batch_add_sparql'
Adds an SPARQL update string to batch.
Since : 3.1
tracker_batch_execute
gboolean tracker_batch_execute (TrackerBatch * batch, GCancellable* cancellable, GError** error)
Executes the batch. This operations happens synchronously.
Parameters:
batch
–
cancellable
(
[nullable])
–
a GCancellable, or NULL
error
–
location for a GError, or NULL
TRUE of there were no errors, FALSE otherwise
Since : 3.1
Tracker.Batch.prototype.execute
function Tracker.Batch.prototype.execute(cancellable: Gio.Cancellable): {
// javascript wrapper for 'tracker_batch_execute'
}
Executes the batch. This operations happens synchronously.
Parameters:
cancellable
(Gio.Cancellable)
–
a GCancellable, or NULL
TRUE of there were no errors, FALSE otherwise
Since : 3.1
Tracker.Batch.execute
@raises(GLib.GError)
def Tracker.Batch.execute (self, cancellable):
#python wrapper for 'tracker_batch_execute'
Executes the batch. This operations happens synchronously.
Parameters:
cancellable
(Gio.Cancellable)
–
a GCancellable, or NULL
TRUE of there were no errors, FALSE otherwise
Since : 3.1
tracker_batch_execute_async
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.
Parameters:
batch
–
cancellable
(
[nullable])
–
a GCancellable, or NULL
callback
–
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.
user_data
–
user-defined data to be passed to callback
Since : 3.1
Tracker.Batch.prototype.execute_async
function Tracker.Batch.prototype.execute_async(cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
// javascript wrapper for 'tracker_batch_execute_async'
}
Executes the batch. This operation happens asynchronously, when finished callback will be executed.
Parameters:
cancellable
(Gio.Cancellable)
–
a GCancellable, or NULL
callback
(Gio.AsyncReadyCallback)
–
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.
user-defined data to be passed to callback
Since : 3.1
Tracker.Batch.execute_async
def Tracker.Batch.execute_async (self, cancellable, callback, *user_data):
#python wrapper for 'tracker_batch_execute_async'
Executes the batch. This operation happens asynchronously, when finished callback will be executed.
Parameters:
cancellable
(Gio.Cancellable)
–
a GCancellable, or NULL
callback
(Gio.AsyncReadyCallback)
–
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.
user-defined data to be passed to callback
Since : 3.1
tracker_batch_execute_finish
gboolean tracker_batch_execute_finish (TrackerBatch * batch, GAsyncResult* res, GError** error)
Finishes the operation started with tracker_batch_execute_async.
Parameters:
batch
–
res
–
a GAsyncResult with the result of the operation
error
–
location for a GError, or NULL
TRUE of there were no errors, FALSE otherwise
Since : 3.1
Tracker.Batch.prototype.execute_finish
function Tracker.Batch.prototype.execute_finish(res: Gio.AsyncResult): {
// javascript wrapper for 'tracker_batch_execute_finish'
}
Finishes the operation started with Tracker.Batch.prototype.execute_async.
Parameters:
res
(Gio.AsyncResult)
–
a GAsyncResult with the result of the operation
TRUE of there were no errors, FALSE otherwise
Since : 3.1
Tracker.Batch.execute_finish
@raises(GLib.GError)
def Tracker.Batch.execute_finish (self, res):
#python wrapper for 'tracker_batch_execute_finish'
Finishes the operation started with Tracker.Batch.execute_async.
Parameters:
res
(Gio.AsyncResult)
–
a GAsyncResult with the result of the operation
TRUE of there were no errors, FALSE otherwise
Since : 3.1
tracker_batch_get_connection
TrackerSparqlConnection * tracker_batch_get_connection (TrackerBatch * batch)
Returns the TrackerSparqlConnection that this batch was created from.
Parameters:
batch
–
The SPARQL connection of this batch.
Tracker.Batch.prototype.get_connection
function Tracker.Batch.prototype.get_connection(): {
// javascript wrapper for 'tracker_batch_get_connection'
}
Returns the Tracker.SparqlConnection that this batch was created from.
Parameters:
The SPARQL connection of this batch.
Tracker.Batch.get_connection
def Tracker.Batch.get_connection (self):
#python wrapper for 'tracker_batch_get_connection'
Returns the Tracker.SparqlConnection that this batch was created from.
Parameters:
The SPARQL connection of this batch.
Properties
connection
“connection” TrackerSparqlConnection *
The TrackerSparqlConnection the batch belongs to.
Flags : Read / Write / Construct Only
connection
“connection” Tracker.SparqlConnection
The Tracker.SparqlConnection the batch belongs to.
Flags : Read / Write / Construct Only
connection
“self.props.connection” Tracker.SparqlConnection
The Tracker.SparqlConnection the batch belongs to.
Flags : Read / Write / Construct Only
Constants
TRACKER_TYPE_BATCH
#define TRACKER_TYPE_BATCH tracker_batch_get_type ()
The results of the search are