TrackerSparqlConnection

TrackerSparqlConnection is an object that represents a connection to a SPARQL triple store. This store may be local and private (see tracker_sparql_connection_new), or it may be a remote connection to a public endpoint (See tracker_sparql_connection_bus_new and tracker_sparql_connection_remote_new).

A TrackerSparqlConnection is private to the calling process, it can be exposed publicly via a TrackerEndpoint, see tracker_endpoint_dbus_new.

Updates on a connection are performed via the tracker_sparql_connection_update family of calls. tracker_sparql_connection_update_array may be used for batched updates. All functions have asynchronous variants.

Queries on a connection are performed via tracker_sparql_connection_query and tracker_sparql_connection_query_statement. The first call receives a query string and returns a TrackerSparqlCursor to iterate the results. The second call returns a TrackerSparqlStatement object that may be reused for repeatable queries with variable parameters. tracker_sparql_statement_execute will returns a TrackerSparqlCursor.

Depending on the ontology definition, TrackerSparqlConnection may emit notifications whenever changes happen in the stored data. These notifications can be processed via a TrackerNotifier obtained with tracker_sparql_connection_create_notifier.

After use, a TrackerSparqlConnection should be closed. See tracker_sparql_connection_close and tracker_sparql_connection_close_async.

A TrackerSparqlConnection may be used from multiple threads, asynchronous database updates are executed sequentially on arrival order, asynchronous queries are executed in a thread pool.

TrackerSparqlConnection

GObject
    ╰──TrackerSparqlConnection

The TrackerSparqlConnection object represents a SPARQL connection.

Members

parent_instance (GObject) –
No description available

Class structure

TrackerSparqlConnectionClass


Tracker.SparqlConnectionClass


Tracker.SparqlConnectionClass


Tracker.SparqlConnection

GObject.Object
    ╰──Tracker.SparqlConnection

The TrackerSparqlConnection object represents a SPARQL connection.

Members

parent_instance (GObject.Object) –
No description available

Tracker.SparqlConnection

GObject.Object
    ╰──Tracker.SparqlConnection

The TrackerSparqlConnection object represents a SPARQL connection.

Members

parent_instance (GObject.Object) –
No description available

Constructors

tracker_sparql_connection_bus_new

TrackerSparqlConnection *
tracker_sparql_connection_bus_new (const gchar * service_name,
                                   const gchar * object_path,
                                   GDBusConnection * dbus_connection,
                                   GError ** error)

Connects to a database owned by another process on the local machine.

Parameters:

service_name

The name of the D-Bus service to connect to.

object_path ( [nullable])

The path to the object, or NULL to use the default.

dbus_connection ( [nullable])

The GDBusConnection to use, or NULL to use the session bus

error

pointer to a GError

Returns ( [transfer: full])

a new TrackerSparqlConnection. Call g_object_unref on the object when no longer used.

Since : 3.0


Tracker.SparqlConnection.prototype.bus_new

function Tracker.SparqlConnection.prototype.bus_new(service_name: String, object_path: String, dbus_connection: Gio.DBusConnection): {
    // javascript wrapper for 'tracker_sparql_connection_bus_new'
}

Connects to a database owned by another process on the local machine.

Parameters:

service_name (String)

The name of the D-Bus service to connect to.

object_path (String)

The path to the object, or null to use the default.

dbus_connection (Gio.DBusConnection)

The Gio.DBusConnection to use, or null to use the session bus

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.prototype.unref on the object when no longer used.

Since : 3.0


Tracker.SparqlConnection.bus_new

@raises(GLib.GError)
def Tracker.SparqlConnection.bus_new (service_name, object_path, dbus_connection):
    #python wrapper for 'tracker_sparql_connection_bus_new'

Connects to a database owned by another process on the local machine.

Parameters:

service_name (str)

The name of the D-Bus service to connect to.

object_path (str)

The path to the object, or None to use the default.

dbus_connection (Gio.DBusConnection)

The Gio.DBusConnection to use, or None to use the session bus

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.unref on the object when no longer used.

Since : 3.0


tracker_sparql_connection_bus_new_finish

TrackerSparqlConnection *
tracker_sparql_connection_bus_new_finish (GAsyncResult * result,
                                          GError ** error)

Completion function for tracker_sparql_connection_bus_new_async.

Parameters:

result

the GAsyncResult

error

pointer to a GError

Returns ( [transfer: full])

a new TrackerSparqlConnection. Call g_object_unref on the object when no longer used.

Since : 3.1


Tracker.SparqlConnection.prototype.bus_new_finish

function Tracker.SparqlConnection.prototype.bus_new_finish(result: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_bus_new_finish'
}

Completion function for Tracker.SparqlConnection.prototype.bus_new_async.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.prototype.unref on the object when no longer used.

Since : 3.1


Tracker.SparqlConnection.bus_new_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.bus_new_finish (result):
    #python wrapper for 'tracker_sparql_connection_bus_new_finish'

Completion function for Tracker.SparqlConnection.bus_new_async.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.unref on the object when no longer used.

Since : 3.1


tracker_sparql_connection_new

TrackerSparqlConnection *
tracker_sparql_connection_new (TrackerSparqlConnectionFlags flags,
                               GFile * store,
                               GFile * ontology,
                               GCancellable * cancellable,
                               GError ** error)

Creates or opens a database.

This method should only be used for databases owned by the current process. To connect to databases managed by other processes, use tracker_sparql_connection_bus_new.

If store is NULL, the database will be created in memory.

The ontologies parameter must point to a location containing suitable .ontology files in Turtle format. These control the database schema that is used. You can use the default Nepomuk ontologies by calling tracker_sparql_get_ontology_nepomuk ().

If you open an existing database using a different ontology to the one it was created with, Tracker will attempt to migrate the existing data to the new schema. This may raise an error. In particular, not all migrations are possible without causing data loss and Tracker will refuse to delete data during a migration.

You can also pass NULL for ontologies to mean "use the ontologies that the database was created with". This will fail if the database doesn't already exist.

Parameters:

flags

values from TrackerSparqlConnectionFlags

store ( [nullable])

the directory that contains the database as a GFile, or NULL

ontology ( [nullable])

the directory that contains the database schemas as a GFile, or NULL

cancellable ( [nullable])

a GCancellable, or NULL

error

pointer to a GError

Returns ( [transfer: full])

a new TrackerSparqlConnection. Call g_object_unref on the object when no longer used.

Since : 3.0


Tracker.SparqlConnection.prototype.new

function Tracker.SparqlConnection.prototype.new(flags: Tracker.SparqlConnectionFlags, store: Gio.File, ontology: Gio.File, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_new'
}

Creates or opens a database.

This method should only be used for databases owned by the current process. To connect to databases managed by other processes, use Tracker.SparqlConnection.prototype.bus_new.

If store is null, the database will be created in memory.

The ontologies parameter must point to a location containing suitable .ontology files in Turtle format. These control the database schema that is used. You can use the default Nepomuk ontologies by calling tracker_sparql_get_ontology_nepomuk ().

If you open an existing database using a different ontology to the one it was created with, Tracker will attempt to migrate the existing data to the new schema. This may raise an error. In particular, not all migrations are possible without causing data loss and Tracker will refuse to delete data during a migration.

You can also pass null for ontologies to mean "use the ontologies that the database was created with". This will fail if the database doesn't already exist.

Parameters:

store (Gio.File)

the directory that contains the database as a Gio.File, or null

ontology (Gio.File)

the directory that contains the database schemas as a Gio.File, or null

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.prototype.unref on the object when no longer used.

Since : 3.0


Tracker.SparqlConnection.new

@raises(GLib.GError)
def Tracker.SparqlConnection.new (flags, store, ontology, cancellable):
    #python wrapper for 'tracker_sparql_connection_new'

Creates or opens a database.

This method should only be used for databases owned by the current process. To connect to databases managed by other processes, use Tracker.SparqlConnection.bus_new.

If store is None, the database will be created in memory.

The ontologies parameter must point to a location containing suitable .ontology files in Turtle format. These control the database schema that is used. You can use the default Nepomuk ontologies by calling tracker_sparql_get_ontology_nepomuk ().

If you open an existing database using a different ontology to the one it was created with, Tracker will attempt to migrate the existing data to the new schema. This may raise an error. In particular, not all migrations are possible without causing data loss and Tracker will refuse to delete data during a migration.

You can also pass None for ontologies to mean "use the ontologies that the database was created with". This will fail if the database doesn't already exist.

Parameters:

store (Gio.File)

the directory that contains the database as a Gio.File, or None

ontology (Gio.File)

the directory that contains the database schemas as a Gio.File, or None

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

Returns (Tracker.SparqlConnection)

a new Tracker.SparqlConnection. Call GObject.Object.unref on the object when no longer used.

Since : 3.0


tracker_sparql_connection_new_finish

TrackerSparqlConnection *
tracker_sparql_connection_new_finish (GAsyncResult * result,
                                      GError ** error)

Completion function for tracker_sparql_connection_new_async.

Parameters:

result

the GAsyncResult

error

pointer to a GError

Returns
No description available

Since : 3.0


Tracker.SparqlConnection.prototype.new_finish

function Tracker.SparqlConnection.prototype.new_finish(result: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_new_finish'
}

Completion function for Tracker.SparqlConnection.prototype.new_async.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Tracker.SparqlConnection)
No description available

Since : 3.0


Tracker.SparqlConnection.new_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.new_finish (result):
    #python wrapper for 'tracker_sparql_connection_new_finish'

Completion function for Tracker.SparqlConnection.new_async.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Tracker.SparqlConnection)
No description available

Since : 3.0


tracker_sparql_connection_remote_new

TrackerSparqlConnection *
tracker_sparql_connection_remote_new (const gchar * uri_base)

Connects to a remote SPARQL endpoint. The connection is made using the libsoup HTTP library. The connection will normally use the http:// or https:// protocol.

Parameters:

uri_base

Base URI of the remote connection

Returns ( [transfer: full])

a new remote TrackerSparqlConnection. Call g_object_unref on the object when no longer used.


Tracker.SparqlConnection.prototype.remote_new

function Tracker.SparqlConnection.prototype.remote_new(uri_base: String): {
    // javascript wrapper for 'tracker_sparql_connection_remote_new'
}

Connects to a remote SPARQL endpoint. The connection is made using the libsoup HTTP library. The connection will normally use the http:// or https:// protocol.

Parameters:

uri_base (String)

Base URI of the remote connection

Returns (Tracker.SparqlConnection)

a new remote Tracker.SparqlConnection. Call GObject.Object.prototype.unref on the object when no longer used.


Tracker.SparqlConnection.remote_new

def Tracker.SparqlConnection.remote_new (uri_base):
    #python wrapper for 'tracker_sparql_connection_remote_new'

Connects to a remote SPARQL endpoint. The connection is made using the libsoup HTTP library. The connection will normally use the http:// or https:// protocol.

Parameters:

uri_base (str)

Base URI of the remote connection

Returns (Tracker.SparqlConnection)

a new remote Tracker.SparqlConnection. Call GObject.Object.unref on the object when no longer used.


Methods

tracker_sparql_connection_close

tracker_sparql_connection_close (TrackerSparqlConnection * connection)

Closes a SPARQL connection. No other API calls than g_object_unref should happen after this call.

This call is blocking. All pending updates will be flushed, and the store databases will be closed orderly. All ongoing SELECT queries will be cancelled. Notifiers will no longer emit events.

Parameters:

connection

a TrackerSparqlConnection

Since : 3.0


Tracker.SparqlConnection.prototype.close

function Tracker.SparqlConnection.prototype.close(): {
    // javascript wrapper for 'tracker_sparql_connection_close'
}

Closes a SPARQL connection. No other API calls than GObject.Object.prototype.unref should happen after this call.

This call is blocking. All pending updates will be flushed, and the store databases will be closed orderly. All ongoing SELECT queries will be cancelled. Notifiers will no longer emit events.

Parameters:

Since : 3.0


Tracker.SparqlConnection.close

def Tracker.SparqlConnection.close (self):
    #python wrapper for 'tracker_sparql_connection_close'

Closes a SPARQL connection. No other API calls than GObject.Object.unref should happen after this call.

This call is blocking. All pending updates will be flushed, and the store databases will be closed orderly. All ongoing SELECT queries will be cancelled. Notifiers will no longer emit events.

Parameters:

Since : 3.0


tracker_sparql_connection_close_async

tracker_sparql_connection_close_async (TrackerSparqlConnection * connection,
                                       GCancellable * cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data)

Closes a connection asynchronously. No other API calls than g_object_unref should happen after this call. See tracker_sparql_connection_close for more information.

Parameters:

connection

a TrackerSparqlConnection

cancellable

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.0


Tracker.SparqlConnection.prototype.close_async

function Tracker.SparqlConnection.prototype.close_async(cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_close_async'
}

Closes a connection asynchronously. No other API calls than GObject.Object.prototype.unref should happen after this call. See Tracker.SparqlConnection.prototype.close for more information.

Parameters:

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (Object)

user-defined data to be passed to callback

Since : 3.0


Tracker.SparqlConnection.close_async

def Tracker.SparqlConnection.close_async (self, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_close_async'

Closes a connection asynchronously. No other API calls than GObject.Object.unref should happen after this call. See Tracker.SparqlConnection.close for more information.

Parameters:

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (variadic)

user-defined data to be passed to callback

Since : 3.0


tracker_sparql_connection_close_finish

gboolean
tracker_sparql_connection_close_finish (TrackerSparqlConnection * connection,
                                        GAsyncResult * res,
                                        GError ** error)

Finishes the asynchronous connection close.

Parameters:

connection

a TrackerSparqlConnection

res

the GAsyncResult

error

pointer to a GError

Returns

FALSE if some error occurred, TRUE otherwise

Since : 3.0


Tracker.SparqlConnection.prototype.close_finish

function Tracker.SparqlConnection.prototype.close_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_close_finish'
}

Finishes the asynchronous connection close.

Returns (Number)

false if some error occurred, true otherwise

Since : 3.0


Tracker.SparqlConnection.close_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.close_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_close_finish'

Finishes the asynchronous connection close.

Returns (bool)

False if some error occurred, True otherwise

Since : 3.0


tracker_sparql_connection_create_batch

TrackerBatch *
tracker_sparql_connection_create_batch (TrackerSparqlConnection * connection)

Creates a new batch to store and execute update commands. If the connection is readonly or cannot issue SPARQL updates, NULL will be returned.

Parameters:

connection

a TrackerSparqlConnection

Returns ( [transfer: full])

(nullable): A new TrackerBatch


Tracker.SparqlConnection.prototype.create_batch

function Tracker.SparqlConnection.prototype.create_batch(): {
    // javascript wrapper for 'tracker_sparql_connection_create_batch'
}

Creates a new batch to store and execute update commands. If the connection is readonly or cannot issue SPARQL updates, null will be returned.

Parameters:

Returns (Tracker.Batch)

(nullable): A new Tracker.Batch


Tracker.SparqlConnection.create_batch

def Tracker.SparqlConnection.create_batch (self):
    #python wrapper for 'tracker_sparql_connection_create_batch'

Creates a new batch to store and execute update commands. If the connection is readonly or cannot issue SPARQL updates, None will be returned.

Parameters:

Returns (Tracker.Batch)

(nullable): A new Tracker.Batch


tracker_sparql_connection_create_notifier

TrackerNotifier *
tracker_sparql_connection_create_notifier (TrackerSparqlConnection * connection)

Creates a new TrackerNotifier to notify about changes in connection. See TrackerNotifier documentation for information about how to use this object.

Parameters:

connection

a TrackerSparqlConnection

Returns ( [transfer: full])

a newly created notifier. Free with g_object_unref when no longer needed.


Tracker.SparqlConnection.prototype.create_notifier

function Tracker.SparqlConnection.prototype.create_notifier(): {
    // javascript wrapper for 'tracker_sparql_connection_create_notifier'
}

Creates a new Tracker.Notifier to notify about changes in connection. See Tracker.Notifier documentation for information about how to use this object.

Parameters:

Returns (Tracker.Notifier)

a newly created notifier. Free with GObject.Object.prototype.unref when no longer needed.


Tracker.SparqlConnection.create_notifier

def Tracker.SparqlConnection.create_notifier (self):
    #python wrapper for 'tracker_sparql_connection_create_notifier'

Creates a new Tracker.Notifier to notify about changes in connection. See Tracker.Notifier documentation for information about how to use this object.

Parameters:

Returns (Tracker.Notifier)

a newly created notifier. Free with GObject.Object.unref when no longer needed.


tracker_sparql_connection_deserialize_async

tracker_sparql_connection_deserialize_async (TrackerSparqlConnection * connection,
                                             TrackerDeserializeFlags flags,
                                             TrackerRdfFormat format,
                                             const gchar * default_graph,
                                             GInputStream * stream,
                                             GCancellable * cancellable,
                                             GAsyncReadyCallback callback,
                                             gpointer user_data)

Incorporates the contents of the RDF data contained in stream into the data stored by connection. This is an asynchronous operation, callback will be invoked when the data has been fully inserted to connection.

RDF data will be inserted in the given default_graph if one is provided, or the default graph if default_graph is NULL. Any RDF data that has a graph specified (e.g. using the GRAPH clause in the Trig format) will be inserted in the specified graph instead of default_graph.

The flags argument is reserved for future expansions, currently TRACKER_DESERIALIZE_FLAGS_NONE must be passed.

Parameters:

connection

a TrackerSparqlConnection

flags

deserialization flags

format

RDF format of data in stream

default_graph

default graph that will receive the RDF data

stream

input stream with RDF data

cancellable

a GCancellable

callback

the GAsyncReadyCallback called when the operation completes

user_data

data passed to callback

Since : 3.4


Tracker.SparqlConnection.prototype.deserialize_async

function Tracker.SparqlConnection.prototype.deserialize_async(flags: Tracker.DeserializeFlags, format: Tracker.RdfFormat, default_graph: String, stream: Gio.InputStream, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_deserialize_async'
}

Incorporates the contents of the RDF data contained in stream into the data stored by connection. This is an asynchronous operation, callback will be invoked when the data has been fully inserted to connection.

RDF data will be inserted in the given default_graph if one is provided, or the default graph if default_graph is null. Any RDF data that has a graph specified (e.g. using the GRAPH clause in the Trig format) will be inserted in the specified graph instead of default_graph.

The flags argument is reserved for future expansions, currently Tracker.DeserializeFlags.DESERIALIZE_FLAGS_NONE must be passed.

Parameters:

deserialization flags

format (Tracker.RdfFormat)

RDF format of data in stream

default_graph (String)

default graph that will receive the RDF data

stream (Gio.InputStream)

input stream with RDF data

cancellable (Gio.Cancellable)

a Gio.Cancellable

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (Object)

data passed to callback

Since : 3.4


Tracker.SparqlConnection.deserialize_async

def Tracker.SparqlConnection.deserialize_async (self, flags, format, default_graph, stream, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_deserialize_async'

Incorporates the contents of the RDF data contained in stream into the data stored by connection. This is an asynchronous operation, callback will be invoked when the data has been fully inserted to connection.

RDF data will be inserted in the given default_graph if one is provided, or the default graph if default_graph is None. Any RDF data that has a graph specified (e.g. using the GRAPH clause in the Trig format) will be inserted in the specified graph instead of default_graph.

The flags argument is reserved for future expansions, currently Tracker.DeserializeFlags.DESERIALIZE_FLAGS_NONE must be passed.

Parameters:

deserialization flags

format (Tracker.RdfFormat)

RDF format of data in stream

default_graph (str)

default graph that will receive the RDF data

stream (Gio.InputStream)

input stream with RDF data

cancellable (Gio.Cancellable)

a Gio.Cancellable

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (variadic)

data passed to callback

Since : 3.4


tracker_sparql_connection_deserialize_finish

gboolean
tracker_sparql_connection_deserialize_finish (TrackerSparqlConnection * connection,
                                              GAsyncResult * result,
                                              GError ** error)

Finishes a tracker_sparql_connection_deserialize_async operation. In case of error, NULL will be returned and error will be set.

Parameters:

connection

a TrackerSparqlConnection

result

the GAsyncResult

error

location for returned errors, or NULL

Returns

TRUE if all data was inserted successfully.

Since : 3.4


Tracker.SparqlConnection.prototype.deserialize_finish

function Tracker.SparqlConnection.prototype.deserialize_finish(result: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_deserialize_finish'
}

Finishes a Tracker.SparqlConnection.prototype.deserialize_async operation. In case of error, null will be returned and error will be set.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Number)

true if all data was inserted successfully.

Since : 3.4


Tracker.SparqlConnection.deserialize_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.deserialize_finish (self, result):
    #python wrapper for 'tracker_sparql_connection_deserialize_finish'

Finishes a Tracker.SparqlConnection.deserialize_async operation. In case of error, None will be returned and error will be set.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (bool)

True if all data was inserted successfully.

Since : 3.4


tracker_sparql_connection_get_namespace_manager

TrackerNamespaceManager *
tracker_sparql_connection_get_namespace_manager (TrackerSparqlConnection * connection)

Retrieves a TrackerNamespaceManager that contains all prefixes in the ontology of connection.

Parameters:

connection

a TrackerSparqlConnection

Returns ( [transfer: none])

a TrackerNamespaceManager for this connection. This object is owned by connection and must not be freed.


Tracker.SparqlConnection.prototype.get_namespace_manager

function Tracker.SparqlConnection.prototype.get_namespace_manager(): {
    // javascript wrapper for 'tracker_sparql_connection_get_namespace_manager'
}

Retrieves a Tracker.NamespaceManager that contains all prefixes in the ontology of connection.

Parameters:

Returns (Tracker.NamespaceManager)

a Tracker.NamespaceManager for this connection. This object is owned by connection and must not be freed.


Tracker.SparqlConnection.get_namespace_manager

def Tracker.SparqlConnection.get_namespace_manager (self):
    #python wrapper for 'tracker_sparql_connection_get_namespace_manager'

Retrieves a Tracker.NamespaceManager that contains all prefixes in the ontology of connection.

Parameters:

Returns (Tracker.NamespaceManager)

a Tracker.NamespaceManager for this connection. This object is owned by connection and must not be freed.


tracker_sparql_connection_load_statement_from_gresource

TrackerSparqlStatement *
tracker_sparql_connection_load_statement_from_gresource (TrackerSparqlConnection * connection,
                                                         const gchar * resource_path,
                                                         GCancellable * cancellable,
                                                         GError ** error)

Prepares a TrackerSparqlStatement for the SPARQL query contained as a resource file at resource_path. SPARQL Query files typically have the .rq extension.

Parameters:

connection

a TrackerSparqlConnection

resource_path

the resource path of the file to parse.

cancellable

a GCancellable, or NULL

error

return location for an error, or NULL

Returns ( [transfer: full][nullable])

a prepared statement

Since : 3.3


Tracker.SparqlConnection.prototype.load_statement_from_gresource

function Tracker.SparqlConnection.prototype.load_statement_from_gresource(resource_path: String, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_load_statement_from_gresource'
}

Prepares a Tracker.SparqlStatement for the SPARQL query contained as a resource file at resource_path. SPARQL Query files typically have the .rq extension.

Parameters:

resource_path (String)

the resource path of the file to parse.

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

Returns (Tracker.SparqlStatement)

a prepared statement

Since : 3.3


Tracker.SparqlConnection.load_statement_from_gresource

@raises(GLib.GError)
def Tracker.SparqlConnection.load_statement_from_gresource (self, resource_path, cancellable):
    #python wrapper for 'tracker_sparql_connection_load_statement_from_gresource'

Prepares a Tracker.SparqlStatement for the SPARQL query contained as a resource file at resource_path. SPARQL Query files typically have the .rq extension.

Parameters:

resource_path (str)

the resource path of the file to parse.

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

Returns (Tracker.SparqlStatement)

a prepared statement

Since : 3.3


tracker_sparql_connection_map_connection

tracker_sparql_connection_map_connection (TrackerSparqlConnection * connection,
                                          const gchar * handle_name,
                                          TrackerSparqlConnection * service_connection)

Maps service_connection so it is available as a "private:@handle_name" URI in connection. This can be accessed via the SERVICE SPARQL syntax in queries from connection. E.g.:

SELECT ?u {
  SERVICE <private:other-connection> {
    ?u a rdfs:Resource
  }
}

This is useful to interrelate data from multiple TrackerSparqlConnection instances maintained by the same process, without creating a public endpoint for service_connection.

connection may only be a TrackerSparqlConnection created via tracker_sparql_connection_new and tracker_sparql_connection_new_async.

Parameters:

connection

a TrackerSparqlConnection

handle_name

handle name for service_connection

service_connection

a TrackerSparqlConnection to use from connection

Since : 3.3


Tracker.SparqlConnection.prototype.map_connection

function Tracker.SparqlConnection.prototype.map_connection(handle_name: String, service_connection: Tracker.SparqlConnection): {
    // javascript wrapper for 'tracker_sparql_connection_map_connection'
}

Maps service_connection so it is available as a "private:@handle_name" URI in connection. This can be accessed via the SERVICE SPARQL syntax in queries from connection. E.g.:

SELECT ?u {
  SERVICE <private:other-connection> {
    ?u a rdfs:Resource
  }
}

This is useful to interrelate data from multiple Tracker.SparqlConnection instances maintained by the same process, without creating a public endpoint for service_connection.

connection may only be a Tracker.SparqlConnection created via Tracker.SparqlConnection.prototype.new and Tracker.SparqlConnection.prototype.new_async.

Parameters:

handle_name (String)

handle name for service_connection

service_connection (Tracker.SparqlConnection)

a Tracker.SparqlConnection to use from connection

Since : 3.3


Tracker.SparqlConnection.map_connection

def Tracker.SparqlConnection.map_connection (self, handle_name, service_connection):
    #python wrapper for 'tracker_sparql_connection_map_connection'

Maps service_connection so it is available as a "private:@handle_name" URI in connection. This can be accessed via the SERVICE SPARQL syntax in queries from connection. E.g.:

SELECT ?u {
  SERVICE <private:other-connection> {
    ?u a rdfs:Resource
  }
}

This is useful to interrelate data from multiple Tracker.SparqlConnection instances maintained by the same process, without creating a public endpoint for service_connection.

connection may only be a Tracker.SparqlConnection created via Tracker.SparqlConnection.new and Tracker.SparqlConnection.new_async.

Parameters:

handle_name (str)

handle name for service_connection

service_connection (Tracker.SparqlConnection)

a Tracker.SparqlConnection to use from connection

Since : 3.3


tracker_sparql_connection_query

TrackerSparqlCursor *
tracker_sparql_connection_query (TrackerSparqlConnection * connection,
                                 const gchar * sparql,
                                 GCancellable * cancellable,
                                 GError ** error)

Executes a SPARQL query on. The API call is completely synchronous, so it may block.

The sparql query should be built with TrackerResource, or its parts correctly escaped using tracker_sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL query

cancellable

a GCancellable used to cancel the operation

error

GError for error reporting.

Returns ( [transfer: full])

a TrackerSparqlCursor if results were found. On error, NULL is returned and the error is set accordingly. Call g_object_unref on the returned cursor when no longer needed.


Tracker.SparqlConnection.prototype.query

function Tracker.SparqlConnection.prototype.query(sparql: String, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_query'
}

Executes a SPARQL query on. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.prototype.sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

sparql (String)

string containing the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

Returns (Tracker.SparqlCursor)

a Tracker.SparqlCursor if results were found. On error, null is returned and the error is set accordingly. Call GObject.Object.prototype.unref on the returned cursor when no longer needed.


Tracker.SparqlConnection.query

@raises(GLib.GError)
def Tracker.SparqlConnection.query (self, sparql, cancellable):
    #python wrapper for 'tracker_sparql_connection_query'

Executes a SPARQL query on. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

sparql (str)

string containing the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

Returns (Tracker.SparqlCursor)

a Tracker.SparqlCursor if results were found. On error, None is returned and the error is set accordingly. Call GObject.Object.unref on the returned cursor when no longer needed.


tracker_sparql_connection_query_async

tracker_sparql_connection_query_async (TrackerSparqlConnection * connection,
                                       const gchar * sparql,
                                       GCancellable * cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data)

Executes asynchronously a SPARQL query.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL query

cancellable

a GCancellable used to cancel the operation

callback

user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.

user_data

user-defined data to be passed to callback


Tracker.SparqlConnection.prototype.query_async

function Tracker.SparqlConnection.prototype.query_async(sparql: String, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_query_async'
}

Executes asynchronously a SPARQL query.

Parameters:

sparql (String)

string containing the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (Object)

user-defined data to be passed to callback


Tracker.SparqlConnection.query_async

def Tracker.SparqlConnection.query_async (self, sparql, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_query_async'

Executes asynchronously a SPARQL query.

Parameters:

sparql (str)

string containing the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (variadic)

user-defined data to be passed to callback


tracker_sparql_connection_query_finish

TrackerSparqlCursor *
tracker_sparql_connection_query_finish (TrackerSparqlConnection * connection,
                                        GAsyncResult * res,
                                        GError ** error)

Finishes the asynchronous SPARQL query operation.

Parameters:

connection

a TrackerSparqlConnection

res

a GAsyncResult with the result of the operation

error

GError for error reporting.

Returns ( [transfer: full])

a TrackerSparqlCursor if results were found. On error, NULL is returned and the error is set accordingly. Call g_object_unref on the returned cursor when no longer needed.


Tracker.SparqlConnection.prototype.query_finish

function Tracker.SparqlConnection.prototype.query_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_query_finish'
}

Finishes the asynchronous SPARQL query operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (Tracker.SparqlCursor)

a Tracker.SparqlCursor if results were found. On error, null is returned and the error is set accordingly. Call GObject.Object.prototype.unref on the returned cursor when no longer needed.


Tracker.SparqlConnection.query_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.query_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_query_finish'

Finishes the asynchronous SPARQL query operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (Tracker.SparqlCursor)

a Tracker.SparqlCursor if results were found. On error, None is returned and the error is set accordingly. Call GObject.Object.unref on the returned cursor when no longer needed.


tracker_sparql_connection_query_statement

TrackerSparqlStatement *
tracker_sparql_connection_query_statement (TrackerSparqlConnection * connection,
                                           const gchar * sparql,
                                           GCancellable * cancellable,
                                           GError ** error)

Prepares the given sparql as a TrackerSparqlStatement.

Parameters:

connection

a TrackerSparqlConnection

sparql

the SPARQL query

cancellable

a GCancellable used to cancel the operation, or NULL

error

a TrackerSparqlError or NULL if no error occured

Returns ( [transfer: full][nullable])

a prepared statement


Tracker.SparqlConnection.prototype.query_statement

function Tracker.SparqlConnection.prototype.query_statement(sparql: String, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_query_statement'
}

Prepares the given sparql as a Tracker.SparqlStatement.

Parameters:

sparql (String)

the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation, or null

Returns (Tracker.SparqlStatement)

a prepared statement


Tracker.SparqlConnection.query_statement

@raises(GLib.GError)
def Tracker.SparqlConnection.query_statement (self, sparql, cancellable):
    #python wrapper for 'tracker_sparql_connection_query_statement'

Prepares the given sparql as a Tracker.SparqlStatement.

Parameters:

sparql (str)

the SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation, or None

Returns (Tracker.SparqlStatement)

a prepared statement


tracker_sparql_connection_serialize_async

tracker_sparql_connection_serialize_async (TrackerSparqlConnection * connection,
                                           TrackerSerializeFlags flags,
                                           TrackerRdfFormat format,
                                           const gchar * query,
                                           GCancellable * cancellable,
                                           GAsyncReadyCallback callback,
                                           gpointer user_data)

Serializes data into the specified RDF format. query must be either a DESCRIBE or CONSTRUCT query. This is an asynchronous operation, callback will be invoked when the data is available for reading.

The SPARQL endpoint may not support the specified format, in that case an error will be raised.

The flags argument is reserved for future expansions, currently TRACKER_SERIALIZE_FLAGS_NONE must be passed.

Parameters:

connection

a TrackerSparqlConnection

flags

serialization flags

format

output RDF format

query

SPARQL query

cancellable

a GCancellable

callback

the GAsyncReadyCallback called when the operation completes

user_data

data passed to callback

Since : 3.3


Tracker.SparqlConnection.prototype.serialize_async

function Tracker.SparqlConnection.prototype.serialize_async(flags: Tracker.SerializeFlags, format: Tracker.RdfFormat, query: String, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_serialize_async'
}

Serializes data into the specified RDF format. query must be either a DESCRIBE or CONSTRUCT query. This is an asynchronous operation, callback will be invoked when the data is available for reading.

The SPARQL endpoint may not support the specified format, in that case an error will be raised.

The flags argument is reserved for future expansions, currently Tracker.SerializeFlags.SERIALIZE_FLAGS_NONE must be passed.

Parameters:

serialization flags

format (Tracker.RdfFormat)

output RDF format

query (String)

SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (Object)

data passed to callback

Since : 3.3


Tracker.SparqlConnection.serialize_async

def Tracker.SparqlConnection.serialize_async (self, flags, format, query, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_serialize_async'

Serializes data into the specified RDF format. query must be either a DESCRIBE or CONSTRUCT query. This is an asynchronous operation, callback will be invoked when the data is available for reading.

The SPARQL endpoint may not support the specified format, in that case an error will be raised.

The flags argument is reserved for future expansions, currently Tracker.SerializeFlags.SERIALIZE_FLAGS_NONE must be passed.

Parameters:

serialization flags

format (Tracker.RdfFormat)

output RDF format

query (str)

SPARQL query

cancellable (Gio.Cancellable)

a Gio.Cancellable

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (variadic)

data passed to callback

Since : 3.3


tracker_sparql_connection_serialize_finish

GInputStream *
tracker_sparql_connection_serialize_finish (TrackerSparqlConnection * connection,
                                            GAsyncResult * result,
                                            GError ** error)

Finishes a tracker_sparql_connection_serialize_async operation. In case of error, NULL will be returned and error will be set.

Parameters:

connection

a TrackerSparqlConnection

result

the GAsyncResult

error

location for returned errors, or NULL

Returns ( [transfer: full])

a GInputStream to read RDF content.

Since : 3.3


Tracker.SparqlConnection.prototype.serialize_finish

function Tracker.SparqlConnection.prototype.serialize_finish(result: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_serialize_finish'
}

Finishes a Tracker.SparqlConnection.prototype.serialize_async operation. In case of error, null will be returned and error will be set.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Gio.InputStream)

a Gio.InputStream to read RDF content.

Since : 3.3


Tracker.SparqlConnection.serialize_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.serialize_finish (self, result):
    #python wrapper for 'tracker_sparql_connection_serialize_finish'

Finishes a Tracker.SparqlConnection.serialize_async operation. In case of error, None will be returned and error will be set.

Parameters:

result (Gio.AsyncResult)

the Gio.AsyncResult

Returns (Gio.InputStream)

a Gio.InputStream to read RDF content.

Since : 3.3


tracker_sparql_connection_update

tracker_sparql_connection_update (TrackerSparqlConnection * connection,
                                  const gchar * sparql,
                                  GCancellable * cancellable,
                                  GError ** error)

Executes a SPARQL update. The API call is completely synchronous, so it may block.

The sparql query should be built with TrackerResource, or its parts correctly escaped using tracker_sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL update query

cancellable

a GCancellable used to cancel the operation

error

GError for error reporting.


Tracker.SparqlConnection.prototype.update

function Tracker.SparqlConnection.prototype.update(sparql: String, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_update'
}

Executes a SPARQL update. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.prototype.sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

sparql (String)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation


Tracker.SparqlConnection.update

@raises(GLib.GError)
def Tracker.SparqlConnection.update (self, sparql, cancellable):
    #python wrapper for 'tracker_sparql_connection_update'

Executes a SPARQL update. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.sparql_escape_string, otherwise SPARQL injection is possible.

Parameters:

sparql (str)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation


tracker_sparql_connection_update_array_async

tracker_sparql_connection_update_array_async (TrackerSparqlConnection * connection,
                                              gchar ** sparql,
                                              gint sparql_length,
                                              GCancellable * cancellable,
                                              GAsyncReadyCallback callback,
                                              gpointer user_data)

Executes asynchronously an array of SPARQL updates. All updates in the array are handled within a single transaction.

Parameters:

connection

a TrackerSparqlConnection

sparql

an array of strings containing the SPARQL update queries

sparql_length

the amount of strings you pass as sparql

cancellable

a GCancellable used to cancel the operation

callback

user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.

user_data

user-defined data to be passed to callback


Tracker.SparqlConnection.prototype.update_array_async

function Tracker.SparqlConnection.prototype.update_array_async(sparql: String, sparql_length: Number, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_update_array_async'
}

Executes asynchronously an array of SPARQL updates. All updates in the array are handled within a single transaction.

Parameters:

sparql (String)

an array of strings containing the SPARQL update queries

sparql_length (Number)

the amount of strings you pass as sparql

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (Object)

user-defined data to be passed to callback


Tracker.SparqlConnection.update_array_async

def Tracker.SparqlConnection.update_array_async (self, sparql, sparql_length, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_update_array_async'

Executes asynchronously an array of SPARQL updates. All updates in the array are handled within a single transaction.

Parameters:

sparql (str)

an array of strings containing the SPARQL update queries

sparql_length (int)

the amount of strings you pass as sparql

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (variadic)

user-defined data to be passed to callback


tracker_sparql_connection_update_array_finish

gboolean
tracker_sparql_connection_update_array_finish (TrackerSparqlConnection * connection,
                                               GAsyncResult * res,
                                               GError ** error)

Finishes the asynchronous SPARQL update_array operation.

Parameters:

connection

a TrackerSparqlConnection

res

a GAsyncResult with the result of the operation

error

GError for error reporting.

Returns

TRUE if there were no errors.


Tracker.SparqlConnection.prototype.update_array_finish

function Tracker.SparqlConnection.prototype.update_array_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_update_array_finish'
}

Finishes the asynchronous SPARQL update_array operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (Number)

true if there were no errors.


Tracker.SparqlConnection.update_array_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.update_array_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_update_array_finish'

Finishes the asynchronous SPARQL update_array operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (bool)

True if there were no errors.


tracker_sparql_connection_update_async

tracker_sparql_connection_update_async (TrackerSparqlConnection * connection,
                                        const gchar * sparql,
                                        GCancellable * cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data)

Executes asynchronously a SPARQL update.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL update query

cancellable

a GCancellable used to cancel the operation

callback

user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.

user_data

user-defined data to be passed to callback


Tracker.SparqlConnection.prototype.update_async

function Tracker.SparqlConnection.prototype.update_async(sparql: String, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_update_async'
}

Executes asynchronously a SPARQL update.

Parameters:

sparql (String)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (Object)

user-defined data to be passed to callback


Tracker.SparqlConnection.update_async

def Tracker.SparqlConnection.update_async (self, sparql, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_update_async'

Executes asynchronously a SPARQL update.

Parameters:

sparql (str)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (variadic)

user-defined data to be passed to callback


tracker_sparql_connection_update_blank

GVariant *
tracker_sparql_connection_update_blank (TrackerSparqlConnection * connection,
                                        const gchar * sparql,
                                        GCancellable * cancellable,
                                        GError ** error)

Executes a SPARQL update and returns the URNs of the generated nodes, if any. The API call is completely synchronous, so it may block.

The sparql query should be built with TrackerResource, or its parts correctly escaped using tracker_sparql_escape_string, otherwise SPARQL injection is possible.

The format string of the GVariant is aaa{ss} (an array of an array of dictionaries). The first array represents each INSERT that may exist in the SPARQL string. The second array represents each new node for a given WHERE clause. The last array holds a string pair with the blank node name (e.g. foo for the blank node _:foo) and the URN that was generated for it. For most updates the first two outer arrays will only contain one item.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL update query

cancellable

a GCancellable used to cancel the operation

error

GError for error reporting.

Returns

a GVariant with the generated URNs, which should be freed with g_variant_unref when no longer used.


Tracker.SparqlConnection.prototype.update_blank

function Tracker.SparqlConnection.prototype.update_blank(sparql: String, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_update_blank'
}

Executes a SPARQL update and returns the URNs of the generated nodes, if any. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.prototype.sparql_escape_string, otherwise SPARQL injection is possible.

The format string of the GVariant is aaa{ss} (an array of an array of dictionaries). The first array represents each INSERT that may exist in the SPARQL string. The second array represents each new node for a given WHERE clause. The last array holds a string pair with the blank node name (e.g. foo for the blank node _:foo) and the URN that was generated for it. For most updates the first two outer arrays will only contain one item.

Parameters:

sparql (String)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

Returns (GLib.Variant)

a GLib.Variant with the generated URNs, which should be freed with GLib.Variant.prototype.unref when no longer used.


Tracker.SparqlConnection.update_blank

@raises(GLib.GError)
def Tracker.SparqlConnection.update_blank (self, sparql, cancellable):
    #python wrapper for 'tracker_sparql_connection_update_blank'

Executes a SPARQL update and returns the URNs of the generated nodes, if any. The API call is completely synchronous, so it may block.

The sparql query should be built with Tracker.Resource, or its parts correctly escaped using Tracker.sparql_escape_string, otherwise SPARQL injection is possible.

The format string of the GVariant is aaa{ss} (an array of an array of dictionaries). The first array represents each INSERT that may exist in the SPARQL string. The second array represents each new node for a given WHERE clause. The last array holds a string pair with the blank node name (e.g. foo for the blank node _:foo) and the URN that was generated for it. For most updates the first two outer arrays will only contain one item.

Parameters:

sparql (str)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

Returns (GLib.Variant)

a GLib.Variant with the generated URNs, which should be freed with GLib.Variant.unref when no longer used.


tracker_sparql_connection_update_blank_async

tracker_sparql_connection_update_blank_async (TrackerSparqlConnection * connection,
                                              const gchar * sparql,
                                              GCancellable * cancellable,
                                              GAsyncReadyCallback callback,
                                              gpointer user_data)

Executes asynchronously a SPARQL update with blank nodes. See the tracker_sparql_connection_update_blank documentation to see the differences with tracker_sparql_connection_update.

Parameters:

connection

a TrackerSparqlConnection

sparql

string containing the SPARQL update query

cancellable

a GCancellable used to cancel the operation

callback

user-defined GAsyncReadyCallback to be called when asynchronous operation is finished.

user_data

user-defined data to be passed to callback


Tracker.SparqlConnection.prototype.update_blank_async

function Tracker.SparqlConnection.prototype.update_blank_async(sparql: String, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_update_blank_async'
}

Executes asynchronously a SPARQL update with blank nodes. See the Tracker.SparqlConnection.prototype.update_blank documentation to see the differences with Tracker.SparqlConnection.prototype.update.

Parameters:

sparql (String)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (Object)

user-defined data to be passed to callback


Tracker.SparqlConnection.update_blank_async

def Tracker.SparqlConnection.update_blank_async (self, sparql, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_update_blank_async'

Executes asynchronously a SPARQL update with blank nodes. See the Tracker.SparqlConnection.update_blank documentation to see the differences with Tracker.SparqlConnection.update.

Parameters:

sparql (str)

string containing the SPARQL update query

cancellable (Gio.Cancellable)

a Gio.Cancellable used to cancel the operation

callback (Gio.AsyncReadyCallback)

user-defined Gio.AsyncReadyCallback to be called when asynchronous operation is finished.

user_data (variadic)

user-defined data to be passed to callback


tracker_sparql_connection_update_blank_finish

GVariant *
tracker_sparql_connection_update_blank_finish (TrackerSparqlConnection * connection,
                                               GAsyncResult * res,
                                               GError ** error)

Finishes the asynchronous SPARQL update operation, and returns the URNs of the generated nodes, if any. See the tracker_sparql_connection_update_blank documentation for the interpretation of the returned GVariant.

Parameters:

connection

a TrackerSparqlConnection

res

a GAsyncResult with the result of the operation

error

GError for error reporting.

Returns

a GVariant with the generated URNs, which should be freed with g_variant_unref when no longer used.


Tracker.SparqlConnection.prototype.update_blank_finish

function Tracker.SparqlConnection.prototype.update_blank_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_update_blank_finish'
}

Finishes the asynchronous SPARQL update operation, and returns the URNs of the generated nodes, if any. See the Tracker.SparqlConnection.prototype.update_blank documentation for the interpretation of the returned GLib.Variant.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (GLib.Variant)

a GLib.Variant with the generated URNs, which should be freed with GLib.Variant.prototype.unref when no longer used.


Tracker.SparqlConnection.update_blank_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.update_blank_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_update_blank_finish'

Finishes the asynchronous SPARQL update operation, and returns the URNs of the generated nodes, if any. See the Tracker.SparqlConnection.update_blank documentation for the interpretation of the returned GLib.Variant.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (GLib.Variant)

a GLib.Variant with the generated URNs, which should be freed with GLib.Variant.unref when no longer used.


tracker_sparql_connection_update_finish

tracker_sparql_connection_update_finish (TrackerSparqlConnection * connection,
                                         GAsyncResult * res,
                                         GError ** error)

Finishes the asynchronous SPARQL update operation.

Parameters:

connection

a TrackerSparqlConnection

res

a GAsyncResult with the result of the operation

error

GError for error reporting.


Tracker.SparqlConnection.prototype.update_finish

function Tracker.SparqlConnection.prototype.update_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_update_finish'
}

Finishes the asynchronous SPARQL update operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation


Tracker.SparqlConnection.update_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.update_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_update_finish'

Finishes the asynchronous SPARQL update operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation


tracker_sparql_connection_update_resource

gboolean
tracker_sparql_connection_update_resource (TrackerSparqlConnection * connection,
                                           const gchar * graph,
                                           TrackerResource * resource,
                                           GCancellable * cancellable,
                                           GError ** error)

Inserts a resource as described by resource, on the graph described by graph. This operation blocks until done.

Parameters:

connection

a TrackerSparqlConnection

graph ( [nullable])

RDF graph where the resource should be inserted/updated, or NULL for the default graph

resource

a TrackerResource

cancellable ( [nullable])

a GCancellable, or NULL

error

pointer to a GError, or NULL

Returns

TRUE if there were no errors.

Since : 3.1


Tracker.SparqlConnection.prototype.update_resource

function Tracker.SparqlConnection.prototype.update_resource(graph: String, resource: Tracker.Resource, cancellable: Gio.Cancellable): {
    // javascript wrapper for 'tracker_sparql_connection_update_resource'
}

Inserts a resource as described by resource, on the graph described by graph. This operation blocks until done.

Parameters:

graph (String)

RDF graph where the resource should be inserted/updated, or null for the default graph

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

Returns (Number)

true if there were no errors.

Since : 3.1


Tracker.SparqlConnection.update_resource

@raises(GLib.GError)
def Tracker.SparqlConnection.update_resource (self, graph, resource, cancellable):
    #python wrapper for 'tracker_sparql_connection_update_resource'

Inserts a resource as described by resource, on the graph described by graph. This operation blocks until done.

Parameters:

graph (str)

RDF graph where the resource should be inserted/updated, or None for the default graph

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

Returns (bool)

True if there were no errors.

Since : 3.1


tracker_sparql_connection_update_resource_async

tracker_sparql_connection_update_resource_async (TrackerSparqlConnection * connection,
                                                 const gchar * graph,
                                                 TrackerResource * resource,
                                                 GCancellable * cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data)

Inserts a resource as described by resource, on the graph described by graph. This operation is executed asynchronously, when finished callback will be executed.

Parameters:

connection

a TrackerSparqlConnection

graph ( [nullable])

RDF graph where the resource should be inserted/updated, or NULL for the default graph

resource

a TrackerResource

cancellable ( [nullable])

a GCancellable, or NULL

callback

the GAsyncReadyCallback called when the operation completes

user_data

data passed to callback

Since : 3.1


Tracker.SparqlConnection.prototype.update_resource_async

function Tracker.SparqlConnection.prototype.update_resource_async(graph: String, resource: Tracker.Resource, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_update_resource_async'
}

Inserts a resource as described by resource, on the graph described by graph. This operation is executed asynchronously, when finished callback will be executed.

Parameters:

graph (String)

RDF graph where the resource should be inserted/updated, or null for the default graph

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (Object)

data passed to callback

Since : 3.1


Tracker.SparqlConnection.update_resource_async

def Tracker.SparqlConnection.update_resource_async (self, graph, resource, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_update_resource_async'

Inserts a resource as described by resource, on the graph described by graph. This operation is executed asynchronously, when finished callback will be executed.

Parameters:

graph (str)

RDF graph where the resource should be inserted/updated, or None for the default graph

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (variadic)

data passed to callback

Since : 3.1


tracker_sparql_connection_update_resource_finish

gboolean
tracker_sparql_connection_update_resource_finish (TrackerSparqlConnection * connection,
                                                  GAsyncResult * res,
                                                  GError ** error)

Finishes a tracker_sparql_connection_update_resource_async operation.

Parameters:

connection

a TrackerSparqlConnection

res

a GAsyncResult with the result of the operation

error

pointer to a GError, or NULL

Returns

TRUE if there were no errors.

Since : 3.1


Tracker.SparqlConnection.prototype.update_resource_finish

function Tracker.SparqlConnection.prototype.update_resource_finish(res: Gio.AsyncResult): {
    // javascript wrapper for 'tracker_sparql_connection_update_resource_finish'
}

Finishes a Tracker.SparqlConnection.prototype.update_resource_async operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (Number)

true if there were no errors.

Since : 3.1


Tracker.SparqlConnection.update_resource_finish

@raises(GLib.GError)
def Tracker.SparqlConnection.update_resource_finish (self, res):
    #python wrapper for 'tracker_sparql_connection_update_resource_finish'

Finishes a Tracker.SparqlConnection.update_resource_async operation.

Parameters:

res (Gio.AsyncResult)

a Gio.AsyncResult with the result of the operation

Returns (bool)

True if there were no errors.

Since : 3.1


Functions

tracker_sparql_connection_bus_new_async

tracker_sparql_connection_bus_new_async (const gchar * service_name,
                                         const gchar * object_path,
                                         GDBusConnection * dbus_connection,
                                         GCancellable * cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data)

Connects to a database owned by another process on the local machine. This is an asynchronous operation.

Parameters:

service_name

The name of the D-Bus service to connect to.

object_path ( [nullable])

The path to the object, or NULL to use the default.

dbus_connection ( [nullable])

The GDBusConnection to use, or NULL to use the session bus

cancellable ( [nullable])

a GCancellable, or NULL

callback

the GAsyncReadyCallback called when the operation completes

user_data

data passed to callback

Since : 3.1


Tracker.SparqlConnection.prototype.bus_new_async

function Tracker.SparqlConnection.prototype.bus_new_async(service_name: String, object_path: String, dbus_connection: Gio.DBusConnection, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_bus_new_async'
}

Connects to a database owned by another process on the local machine. This is an asynchronous operation.

Parameters:

service_name (String)

The name of the D-Bus service to connect to.

object_path (String)

The path to the object, or null to use the default.

dbus_connection (Gio.DBusConnection)

The Gio.DBusConnection to use, or null to use the session bus

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (Object)

data passed to callback

Since : 3.1


Tracker.SparqlConnection.bus_new_async

def Tracker.SparqlConnection.bus_new_async (service_name, object_path, dbus_connection, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_bus_new_async'

Connects to a database owned by another process on the local machine. This is an asynchronous operation.

Parameters:

service_name (str)

The name of the D-Bus service to connect to.

object_path (str)

The path to the object, or None to use the default.

dbus_connection (Gio.DBusConnection)

The Gio.DBusConnection to use, or None to use the session bus

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (variadic)

data passed to callback

Since : 3.1


tracker_sparql_connection_new_async

tracker_sparql_connection_new_async (TrackerSparqlConnectionFlags flags,
                                     GFile * store,
                                     GFile * ontology,
                                     GCancellable * cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data)

Asynchronous version of tracker_sparql_connection_new.

Parameters:

flags

values from TrackerSparqlConnectionFlags

store ( [nullable])

the directory that contains the database as a GFile, or NULL

ontology ( [nullable])

the directory that contains the database schemas as a GFile, or NULL

cancellable ( [nullable])

a GCancellable, or NULL

callback

the GAsyncReadyCallback called when the operation completes

user_data

data passed to callback

Since : 3.0


Tracker.SparqlConnection.prototype.new_async

function Tracker.SparqlConnection.prototype.new_async(flags: Tracker.SparqlConnectionFlags, store: Gio.File, ontology: Gio.File, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback, user_data: Object): {
    // javascript wrapper for 'tracker_sparql_connection_new_async'
}

Asynchronous version of Tracker.SparqlConnection.prototype.new.

Parameters:

store (Gio.File)

the directory that contains the database as a Gio.File, or null

ontology (Gio.File)

the directory that contains the database schemas as a Gio.File, or null

cancellable (Gio.Cancellable)

a Gio.Cancellable, or null

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (Object)

data passed to callback

Since : 3.0


Tracker.SparqlConnection.new_async

def Tracker.SparqlConnection.new_async (flags, store, ontology, cancellable, callback, *user_data):
    #python wrapper for 'tracker_sparql_connection_new_async'

Asynchronous version of Tracker.SparqlConnection.new.

Parameters:

store (Gio.File)

the directory that contains the database as a Gio.File, or None

ontology (Gio.File)

the directory that contains the database schemas as a Gio.File, or None

cancellable (Gio.Cancellable)

a Gio.Cancellable, or None

callback (Gio.AsyncReadyCallback)

the Gio.AsyncReadyCallback called when the operation completes

user_data (variadic)

data passed to callback

Since : 3.0


Enumerations

TrackerDeserializeFlags

Flags affecting deserialization of RDF.

Members
TRACKER_DESERIALIZE_FLAGS_NONE (0) –

No flags.


Tracker.DeserializeFlags

Flags affecting deserialization of RDF.

Members
Tracker.DeserializeFlags.DESERIALIZE_FLAGS_NONE (0) –

No flags.


Tracker.DeserializeFlags

Flags affecting deserialization of RDF.

Members
Tracker.DeserializeFlags.DESERIALIZE_FLAGS_NONE (0) –

No flags.


TrackerSerializeFlags

Members
TRACKER_SERIALIZE_FLAGS_NONE (0) –
No description available

Tracker.SerializeFlags

Members
Tracker.SerializeFlags.SERIALIZE_FLAGS_NONE (0) –
No description available

Tracker.SerializeFlags

Members
Tracker.SerializeFlags.SERIALIZE_FLAGS_NONE (0) –
No description available

TrackerSparqlConnectionFlags

Connection flags to modify TrackerSparqlConnection behavior.

Members
TRACKER_SPARQL_CONNECTION_FLAGS_NONE (0) –

No flags.

TRACKER_SPARQL_CONNECTION_FLAGS_READONLY (1) –

Connection is readonly.

TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STEMMER (2) –

Word stemming is applied to FTS search terms.

TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT (4) –

Unaccenting is applied to FTS search terms.

TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS (8) –

FTS Search terms are filtered through a stop word list.

TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS (16) –

Ignore numbers in FTS search terms.

TRACKER_SPARQL_CONNECTION_FLAGS_ANONYMOUS_BNODES (32) –

Treat blank nodes as specified in SPARQL 1.1 syntax. Namely, they cannot be used as URIs. This flag is available since Tracker 3.3.


Tracker.SparqlConnectionFlags

Connection flags to modify Tracker.SparqlConnection behavior.

Members
Tracker.SparqlConnectionFlags.NONE (0) –

No flags.

Tracker.SparqlConnectionFlags.READONLY (1) –

Connection is readonly.

Tracker.SparqlConnectionFlags.FTS_ENABLE_STEMMER (2) –

Word stemming is applied to FTS search terms.

Tracker.SparqlConnectionFlags.FTS_ENABLE_UNACCENT (4) –

Unaccenting is applied to FTS search terms.

Tracker.SparqlConnectionFlags.FTS_ENABLE_STOP_WORDS (8) –

FTS Search terms are filtered through a stop word list.

Tracker.SparqlConnectionFlags.FTS_IGNORE_NUMBERS (16) –

Ignore numbers in FTS search terms.

Tracker.SparqlConnectionFlags.ANONYMOUS_BNODES (32) –

Treat blank nodes as specified in SPARQL 1.1 syntax. Namely, they cannot be used as URIs. This flag is available since Tracker 3.3.


Tracker.SparqlConnectionFlags

Connection flags to modify Tracker.SparqlConnection behavior.

Members
Tracker.SparqlConnectionFlags.NONE (0) –

No flags.

Tracker.SparqlConnectionFlags.READONLY (1) –

Connection is readonly.

Tracker.SparqlConnectionFlags.FTS_ENABLE_STEMMER (2) –

Word stemming is applied to FTS search terms.

Tracker.SparqlConnectionFlags.FTS_ENABLE_UNACCENT (4) –

Unaccenting is applied to FTS search terms.

Tracker.SparqlConnectionFlags.FTS_ENABLE_STOP_WORDS (8) –

FTS Search terms are filtered through a stop word list.

Tracker.SparqlConnectionFlags.FTS_IGNORE_NUMBERS (16) –

Ignore numbers in FTS search terms.

Tracker.SparqlConnectionFlags.ANONYMOUS_BNODES (32) –

Treat blank nodes as specified in SPARQL 1.1 syntax. Namely, they cannot be used as URIs. This flag is available since Tracker 3.3.


Constants

TRACKER_SPARQL_TYPE_CONNECTION

#define TRACKER_SPARQL_TYPE_CONNECTION TRACKER_TYPE_SPARQL_CONNECTION

TRACKER_TYPE_SPARQL_CONNECTION

#define TRACKER_TYPE_SPARQL_CONNECTION tracker_sparql_connection_get_type ()

The results of the search are