[gnome-documents/wip/skydrive: 7/24] miner: insert triples to relate Skydrive files and parent folders



commit 49948c4ce200269922f2f55936711117fbe746db
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu May 24 17:27:46 2012 +0200

    miner: insert triples to relate Skydrive files and parent folders
    
    Fixes: https://bugzilla.gnome.org/666535

 src/miner/gd-zpj-miner.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/miner/gd-zpj-miner.c b/src/miner/gd-zpj-miner.c
index 767a9cb..805201f 100644
--- a/src/miner/gd-zpj-miner.c
+++ b/src/miner/gd-zpj-miner.c
@@ -196,6 +196,33 @@ account_miner_job_process_entry (AccountMinerJob *job,
 
   g_free (datasource_urn);
 
+  if (ZPJ_IS_SKYDRIVE_FILE (entry))
+    {
+      gchar *parent_resource_urn, *parent_identifier;
+      const gchar *parent_id;
+
+      parent_id = zpj_skydrive_entry_get_parent_id (entry);
+      parent_identifier = g_strconcat ("gd:collection:windows-live:skydrive:", parent_id, NULL);
+      parent_resource_urn = gd_miner_tracker_sparql_connection_ensure_resource
+        (job->connection, job->cancellable, error,
+         NULL, parent_identifier,
+         "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+      g_free (parent_identifier);
+
+      if (*error != NULL)
+        goto out;
+
+      gd_miner_tracker_sparql_connection_insert_or_replace_triple
+        (job->connection,
+         job->cancellable, error,
+         identifier, resource,
+         "nie:isPartOf", parent_resource_urn);
+      g_free (parent_resource_urn);
+
+      if (*error != NULL)
+        goto out;
+    }
+
   gd_miner_tracker_sparql_connection_insert_or_replace_triple
     (job->connection,
      job->cancellable, error,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]