[tracker/libtracker-miner] TrackerMiner: add tracker_miner_execute_sparql().
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-miner] TrackerMiner: add tracker_miner_execute_sparql().
- Date: Tue, 18 Aug 2009 14:08:13 +0000 (UTC)
commit 9eb208e9ad7bbb4b576cae2e436374c41178abbd
Author: Carlos Garnacho <carlos lanedo com>
Date: Tue Aug 18 15:11:05 2009 +0200
TrackerMiner: add tracker_miner_execute_sparql().
it will take one (or several) sparql queries. so implementations should use
this to pass data to tracker-store.
src/libtracker-miner/tracker-miner.c | 26 ++++++++++++++++++++++++++
src/libtracker-miner/tracker-miner.h | 5 +++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner.c b/src/libtracker-miner/tracker-miner.c
index afee9e8..abbb9d3 100644
--- a/src/libtracker-miner/tracker-miner.c
+++ b/src/libtracker-miner/tracker-miner.c
@@ -497,3 +497,29 @@ tracker_miner_resume (TrackerMiner *miner,
{
g_return_if_fail (TRACKER_IS_MINER (miner));
}
+
+gboolean
+tracker_miner_execute_sparql (TrackerMiner *miner,
+ const gchar *sparql,
+ GError **error)
+{
+ GError *internal_error = NULL;
+
+ g_return_val_if_fail (TRACKER_IS_MINER (miner), FALSE);
+
+ tracker_resources_batch_sparql_update (miner->private->client,
+ sparql, &internal_error);
+
+ if (!internal_error) {
+ return TRUE;
+ }
+
+ if (error) {
+ g_propagate_error (error, internal_error);
+ } else {
+ g_warning ("Error running sparql queries: %s\n", internal_error->message);
+ g_error_free (internal_error);
+ }
+
+ return FALSE;
+}
diff --git a/src/libtracker-miner/tracker-miner.h b/src/libtracker-miner/tracker-miner.h
index 999df76..3e0b6eb 100644
--- a/src/libtracker-miner/tracker-miner.h
+++ b/src/libtracker-miner/tracker-miner.h
@@ -70,6 +70,11 @@ G_CONST_RETURN gchar *tracker_miner_get_name (TrackerMiner *miner)
gchar *tracker_miner_get_status (TrackerMiner *miner);
gdouble tracker_miner_get_progress (TrackerMiner *miner);
+gboolean tracker_miner_execute_sparql (TrackerMiner *miner,
+ const gchar *sparql,
+ GError **error);
+
+
G_END_DECLS
#endif /* __TRACKER_MINER_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]