[tracker] Fixed usage of nie:url
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Fixed usage of nie:url
- Date: Fri, 11 Dec 2009 11:23:26 +0000 (UTC)
commit 0c01f4884359067accd0a790ae2906c2b412ef29
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Dec 11 12:21:12 2009 +0100
Fixed usage of nie:url
This follows what is being discussed here:
https://sourceforge.net/apps/trac/oscaf/ticket/46
src/plugins/evolution/tracker-evolution-plugin.c | 6 +++++-
src/plugins/kmail/tracker-kmail-registrar.c | 6 +++++-
src/tracker-miner-fs/tracker-miner-applications.c | 7 +++++++
src/tracker-miner-fs/tracker-miner-files.c | 7 ++++++-
src/tracker-utils/tracker-tag.c | 4 ++++
src/tracker-writeback/tracker-writeback-consumer.c | 3 +++
6 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index f474f7f..13854ca 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -422,10 +422,14 @@ process_fields (TrackerSparqlBuilder *sparql, const gchar *uid, guint flags,
tracker_sparql_builder_predicate (sparql, "tracker:available");
tracker_sparql_builder_object_boolean (sparql, TRUE);
- /* The URI of the InformationElement should be a UUID URN */
+ /* Laying the link between the IE and the DO. We use IE = DO */
tracker_sparql_builder_predicate (sparql, "nie:isStoredAs");
tracker_sparql_builder_object_iri (sparql, uri);
+ /* The URL of the DataObject (because IE = DO, this is correct) */
+ tracker_sparql_builder_predicate (sparql, "nie:url");
+ tracker_sparql_builder_object_iri (sparql, uri);
+
tracker_sparql_builder_predicate (sparql, "nie:dataSource");
tracker_sparql_builder_object_iri (sparql, DATASOURCE_URN);
diff --git a/src/plugins/kmail/tracker-kmail-registrar.c b/src/plugins/kmail/tracker-kmail-registrar.c
index b7c478f..b3a8f7a 100644
--- a/src/plugins/kmail/tracker-kmail-registrar.c
+++ b/src/plugins/kmail/tracker-kmail-registrar.c
@@ -182,10 +182,14 @@ perform_set (TrackerKMailRegistrar *object,
tracker_sparql_builder_predicate (sparql, "tracker:available");
tracker_sparql_builder_object_boolean (sparql, TRUE);
- /* The URI of the InformationElement should be a UUID URN */
+ /* Laying the link between the IE and the DO. We use IE = DO */
tracker_sparql_builder_predicate (sparql, "nie:isStoredAs");
tracker_sparql_builder_object_iri (sparql, uri);
+ /* The URL of the DataObject (because IE = DO, this is correct) */
+ tracker_sparql_builder_predicate (sparql, "nie:url");
+ tracker_sparql_builder_object_iri (sparql, uri);
+
tracker_sparql_builder_predicate_iri (sparql, NIE_DATASOURCE_P);
tracker_sparql_builder_object_iri (sparql, DATASOURCE_URN);
diff --git a/src/tracker-miner-fs/tracker-miner-applications.c b/src/tracker-miner-fs/tracker-miner-applications.c
index 27fef50..4827daa 100644
--- a/src/tracker-miner-fs/tracker-miner-applications.c
+++ b/src/tracker-miner-fs/tracker-miner-applications.c
@@ -387,9 +387,16 @@ miner_applications_process_file_cb (gpointer user_data)
tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
tracker_sparql_builder_object (sparql, "nie:DataObject");
+ /* The URL of the DataObject */
+ tracker_sparql_builder_predicate (sparql, "nie:url");
+ tracker_sparql_builder_object_iri (sparql, uri);
+
+ /* Laying the link between the IE and the DO */
tracker_sparql_builder_subject_iri (sparql, uri);
tracker_sparql_builder_predicate (sparql, "nie:isStoredAs");
tracker_sparql_builder_object_iri (sparql, desktop_file_uri);
+
+
g_free (desktop_file_uri);
}
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 4733cbb..3529f80 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -1349,13 +1349,18 @@ process_file_cb (GObject *object,
tracker_sparql_builder_object (sparql, "nfo:Folder");
}
+ /* Laying the link between the IE and the DO. We use IE = DO */
tracker_sparql_builder_predicate (sparql, "nie:isStoredAs");
tracker_sparql_builder_object_iri (sparql, uri);
+ /* The URL of the DataObject (because IE = DO, this is correct) */
+ tracker_sparql_builder_predicate (sparql, "nie:url");
+ tracker_sparql_builder_object_iri (sparql, uri);
+
tracker_sparql_builder_predicate (sparql, "nie:mimeType");
tracker_sparql_builder_object_string (sparql, mime_type);
- miner_files_add_to_datasource (data->miner, file, sparql);
+ miner_files_add_to_datasource (data->miner, file, sparql);
tracker_sparql_builder_insert_close (sparql);
diff --git a/src/tracker-utils/tracker-tag.c b/src/tracker-utils/tracker-tag.c
index 75c4a65..1e41d35 100644
--- a/src/tracker-utils/tracker-tag.c
+++ b/src/tracker-utils/tracker-tag.c
@@ -406,6 +406,10 @@ add_tag_for_urns (TrackerClient *client,
* is, then we add the urns specified to the new tag.
*/
if (filter) {
+
+ /* We use IE = DO, so we can optimize using nie:isStoredAs instead of
+ * nie:url here. Please change this when we change that decision. */
+
/* Add tag to specific urns */
query = g_strdup_printf ("INSERT { "
" _:tag a nao:Tag;"
diff --git a/src/tracker-writeback/tracker-writeback-consumer.c b/src/tracker-writeback/tracker-writeback-consumer.c
index 0a5b316..a04f75a 100644
--- a/src/tracker-writeback/tracker-writeback-consumer.c
+++ b/src/tracker-writeback/tracker-writeback-consumer.c
@@ -226,6 +226,9 @@ process_queue_cb (gpointer user_data)
return FALSE;
}
+ /* We use IE = DO, so we can optimize using nie:isStoredAs instead of
+ * nie:url here. Please change this when we change that decision. */
+
query = g_strdup_printf ("SELECT ?url ?predicate ?object {"
" <%s> ?predicate ?object ;"
" nie:isStoredAs ?url ."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]