![]() |
![]() |
![]() |
Tracker SPARQL Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
enum TrackerSparqlError; TrackerSparqlConnection; TrackerSparqlConnection* tracker_sparql_connection_get (GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_get_async (GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); TrackerSparqlConnection* tracker_sparql_connection_get_finish (GAsyncResult *_res_
,GError **error
); TrackerSparqlConnection* tracker_sparql_connection_get_direct (GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_get_direct_async (GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); TrackerSparqlConnection* tracker_sparql_connection_get_direct_finish (GAsyncResult *_res_
,GError **error
); TrackerSparqlCursor* tracker_sparql_connection_query (TrackerSparqlConnection *self
,const char *sparql
,GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_query_async (TrackerSparqlConnection *self
,const char *sparql
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); TrackerSparqlCursor* tracker_sparql_connection_query_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
); void tracker_sparql_connection_update (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_update_async (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); void tracker_sparql_connection_update_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
); GVariant* tracker_sparql_connection_update_blank (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_update_blank_async (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); GVariant* tracker_sparql_connection_update_blank_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
); void tracker_sparql_connection_load (TrackerSparqlConnection *self
,GFile *file
,GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_load_async (TrackerSparqlConnection *self
,GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); void tracker_sparql_connection_load_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
); TrackerSparqlCursor* tracker_sparql_connection_statistics (TrackerSparqlConnection *self
,GCancellable *cancellable
,GError **error
); void tracker_sparql_connection_statistics_async (TrackerSparqlConnection *self
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
); TrackerSparqlCursor* tracker_sparql_connection_statistics_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
typedef enum { TRACKER_SPARQL_ERROR_PARSE, TRACKER_SPARQL_ERROR_UNKNOWN_CLASS, TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY, TRACKER_SPARQL_ERROR_TYPE, TRACKER_SPARQL_ERROR_CONSTRAINT, TRACKER_SPARQL_ERROR_NO_SPACE, TRACKER_SPARQL_ERROR_INTERNAL, TRACKER_SPARQL_ERROR_UNSUPPORTED } TrackerSparqlError;
typedef struct _TrackerSparqlConnection TrackerSparqlConnection;
The TrackerSparqlConnection object represents a connection with the Tracker store or databases depending on direct or non-direct requests.
TrackerSparqlConnection* tracker_sparql_connection_get (GCancellable *cancellable
,GError **error
);
This function is used to give the caller a connection to Tracker they can use for future requests. The best backend available to connect to Tracker is returned. These backends include direct-access (for read-only queries) and D-Bus (for both read and write queries).
You can use environment variables to influence how backends are used. If no environment variables are provided, both backends are loaded and chosen based on their merits. If you try to force a backend for a query which it won't support (i.e. an update for a read-only backend), you will see critical warnings.
When calling either tracker_sparql_connection_get()
,
tracker_sparql_connection_get_direct()
or the asynchronous variants of
these functions, a mutex is used to protect the loading of backends
against potential race conditions. For synchronous calls, this function
will always block if a previous connection get method has been called.
For asynchronous calls, this may block if another
synchronous or asynchronous call has been previously dispatched and is
still pending. We don't expect this to be a normal programming model when
using this API.
All backends will call the D-Bus tracker-store API Wait()
to make sure
the store and databases are in the right state before any user based
requests can proceed. There may be a small delay during this call if the
databases weren't shutdown cleanly and need to be checked on start up. If
the journal needs to be replayed in such an event, the delay may be
substantial while data is restored as best as possible.
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Returns : |
a new TrackerSparqlConnection. Call g_object_unref() on the
object when no longer used.
|
Since 0.10
void tracker_sparql_connection_get_async (GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
A TrackerSparqlConnection is returned asynchronously in the _callback_
of
your choosing. You must call tracker_sparql_connection_get_finish()
to
find out if the connection was returned without error.
See also: tracker_sparql_connection_get()
.
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
TrackerSparqlConnection* tracker_sparql_connection_get_finish (GAsyncResult *_res_
,GError **error
);
This function is called from the callback provided for
tracker_sparql_connection_get_async()
to return the connection requested
or an error in cases of failure.
|
The GAsyncResult from the callback used to return the TrackerSparqlConnection |
|
The error which occurred or NULL
|
Returns : |
a new TrackerSparqlConnection. Call g_object_unref() on the
object when no longer used.
|
Since 0.10
TrackerSparqlConnection* tracker_sparql_connection_get_direct (GCancellable *cancellable
,GError **error
);
This behaves the same way tracker_sparql_connection_get()
does, however,
the TrackerSparqlConnection can only be used for read-only requests.
The advantage to this API over the tracker_sparql_connection_get()
function is that it will use direct-access. This is faster than using
D-Bus which may be the case with tracker_sparql_connection_get()
.
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Returns : |
a new TrackerSparqlConnection. Call g_object_unref() on the
object when no longer used.
Since 0.10
|
void tracker_sparql_connection_get_direct_async (GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
A TrackerSparqlConnection is returned asynchronously in the _callback_
of
your choosing. You must call
tracker_sparql_connection_get_direct_finish()
to find out if the
connection was returned without error.
See also: tracker_sparql_connection_get_direct()
.
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
TrackerSparqlConnection* tracker_sparql_connection_get_direct_finish (GAsyncResult *_res_
,GError **error
);
This function is called from the callback provided for
tracker_sparql_connection_get_direct_async()
to return the connection
requested or an error in cases of failure.
|
The GAsyncResult from the callback used to return the TrackerSparqlConnection |
|
The error which occurred or NULL
|
Returns : |
a new TrackerSparqlConnection. Call g_object_unref() on the
object when no longer used.
|
Since 0.10
TrackerSparqlCursor* tracker_sparql_connection_query (TrackerSparqlConnection *self
,const char *sparql
,GCancellable *cancellable
,GError **error
);
Executes a SPARQL query on. The API call is completely synchronous, so it may block.
|
a TrackerSparqlConnection |
|
string containing the SPARQL query |
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Returns : |
a TrackerSparqlCursor if results were found, NULL otherwise.
On error, NULL is returned and the error is set accordingly.
Call g_object_unref() on the returned cursor when no longer needed.
Since 0.10
|
void tracker_sparql_connection_query_async (TrackerSparqlConnection *self
,const char *sparql
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
|
|
|
|
|
|
|
|
|
TrackerSparqlCursor* tracker_sparql_connection_query_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
Finishes the asynchronous SPARQL query operation.
|
a TrackerSparqlConnection |
|
a GAsyncResult with the result of the operation |
|
GError for error reporting. |
Returns : |
a TrackerSparqlCursor if results were found, NULL otherwise.
On error, NULL is returned and the error is set accordingly.
Call g_object_unref() on the returned cursor when no longer needed.
Since 0.10
|
void tracker_sparql_connection_update (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GError **error
);
Executes a SPARQL update. The API call is completely synchronous, so it may block.
|
a TrackerSparqlConnection |
|
string containing the SPARQL update query |
|
the priority for the operation |
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Since 0.10
void tracker_sparql_connection_update_async (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Executes asynchronously a SPARQL update.
|
a TrackerSparqlConnection |
|
string containing the SPARQL update query |
|
the priority for the asynchronous operation |
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
void tracker_sparql_connection_update_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
Finishes the asynchronous SPARQL update operation.
|
a TrackerSparqlConnection |
|
a GAsyncResult with the result of the operation |
|
GError for error reporting. |
Since 0.10
GVariant* tracker_sparql_connection_update_blank (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,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.
|
a TrackerSparqlConnection |
|
string containing the SPARQL update query |
|
the priority for the operation |
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Returns : |
a GVariant with the generated URNs, which should be freed with
g_variant_unref() when no longer used.
|
Since 0.10
void tracker_sparql_connection_update_blank_async (TrackerSparqlConnection *self
,const char *sparql
,gint priority
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Executes asynchronously a SPARQL update.
|
a TrackerSparqlConnection |
|
string containing the SPARQL update query |
|
the priority for the asynchronous operation |
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
GVariant* tracker_sparql_connection_update_blank_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
Finishes the asynchronous SPARQL update operation, and returns the URNs of the generated nodes, if any.
|
a TrackerSparqlConnection |
|
a GAsyncResult with the result of the operation |
|
GError for error reporting. |
Returns : |
a GVariant with the generated URNs, which should be freed with
g_variant_unref() when no longer used.
|
Since 0.10
void tracker_sparql_connection_load (TrackerSparqlConnection *self
,GFile *file
,GCancellable *cancellable
,GError **error
);
Loads a Turtle file (TTL) into the store. The API call is completely synchronous, so it may block.
|
a TrackerSparqlConnection |
|
a GFile |
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Since 0.10
void tracker_sparql_connection_load_async (TrackerSparqlConnection *self
,GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Loads, asynchronously, a Turtle file (TTL) into the store.
|
a TrackerSparqlConnection |
|
a GFile |
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
void tracker_sparql_connection_load_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
Finishes the asynchronous load of the Turtle file.
|
a TrackerSparqlConnection |
|
a GAsyncResult with the result of the operation |
|
GError for error reporting. |
Since 0.10
TrackerSparqlCursor* tracker_sparql_connection_statistics (TrackerSparqlConnection *self
,GCancellable *cancellable
,GError **error
);
Retrieves the statistics from the Store. The API call is completely synchronous, so it may block.
|
a TrackerSparqlConnection |
|
a GCancellable used to cancel the operation |
|
GError for error reporting. |
Returns : |
a TrackerSparqlCursor to iterate the reply if successful, NULL
on error. Call g_object_unref() on the returned cursor when no longer
needed.
|
Since 0.10
void tracker_sparql_connection_statistics_async (TrackerSparqlConnection *self
,GCancellable *cancellable
,GAsyncReadyCallback _callback_
,gpointer _user_data_
);
Retrieves, asynchronously, the statistics from the Store.
|
a TrackerSparqlConnection |
|
a GCancellable used to cancel the operation |
|
user-defined GAsyncReadyCallback to be called when asynchronous operation is finished. |
|
user-defined data to be passed to _callback_
|
Since 0.10
TrackerSparqlCursor* tracker_sparql_connection_statistics_finish (TrackerSparqlConnection *self
,GAsyncResult *_res_
,GError **error
);
Finishes the asynchronous retrieval of statistics from the Store.
|
a TrackerSparqlConnection |
|
a GAsyncResult with the result of the operation |
|
GError for error reporting. |
Returns : |
a TrackerSparqlCursor to iterate the reply if successful, NULL
on error. Call g_object_unref() on the returned cursor when no longer
needed.
|
Since 0.10