[gnome-documents/wip/skydrive: 7/9] miner: Insert triples to relate Skydrive files and parent folders
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/skydrive: 7/9] miner: Insert triples to relate Skydrive files and parent folders
- Date: Fri, 25 May 2012 13:09:41 +0000 (UTC)
commit 7ab6dfac59a0bafd829dd3fd89b769db7202442f
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 bfb9027..3fe696c 100644
--- a/src/miner/gd-zpj-miner.c
+++ b/src/miner/gd-zpj-miner.c
@@ -194,6 +194,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]