[tracker/harmattan-pre-signal-updates: 1253/1380] NFO, tracker-extract, libtracker-extract, flickr: Change nfo:Equipment to use canonical uris



commit 9f825ef2bca868f468bacc32320466180a0b14bd
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Sep 7 14:09:20 2010 +0200

    NFO, tracker-extract, libtracker-extract, flickr: Change nfo:Equipment to use canonical uris

 data/ontologies/33-nfo.ontology                  |    6 +-
 src/libtracker-extract/tracker-xmp.c             |   35 ++++++++++-----
 src/libtracker-extract/tracker-xmp.h             |    3 +-
 src/miners/flickr/tracker-miner-flickr.vala      |   38 ++++++++++++++++-
 src/tracker-extract/tracker-extract-gif.c        |   32 +++++++++-----
 src/tracker-extract/tracker-extract-gstreamer.c  |   34 ++++++++++-----
 src/tracker-extract/tracker-extract-gupnp-dlna.c |   33 ++++++++++-----
 src/tracker-extract/tracker-extract-jpeg.c       |   32 +++++++++-----
 src/tracker-extract/tracker-extract-pdf.cpp      |   32 +++++++++-----
 src/tracker-extract/tracker-extract-png.c        |   32 +++++++++-----
 src/tracker-extract/tracker-extract-xmp.c        |    2 +-
 tests/libtracker-extract/tracker-xmp-test.c      |   48 +++++++++++----------
 12 files changed, 217 insertions(+), 110 deletions(-)
---
diff --git a/data/ontologies/33-nfo.ontology b/data/ontologies/33-nfo.ontology
index cc86144..7dc93a3 100644
--- a/data/ontologies/33-nfo.ontology
+++ b/data/ontologies/33-nfo.ontology
@@ -958,9 +958,9 @@ nfo:equipment a rdf:Property ;
 	rdfs:domain nfo:Media ;
 	rdfs:range nfo:Equipment .
 
-nfo:make a rdf:Property ;
-	rdfs:label "Make" ;
-	rdfs:comment "The make of the equipment" ;
+nfo:manufacturer a rdf:Property ;
+	rdfs:label "Manufacturer" ;
+	rdfs:comment "The manufacturer of the equipment" ;
 	nrl:maxCardinality 1 ;
 	rdfs:domain nfo:Equipment ;
 	rdfs:range xsd:string .
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 4a3f752..bd7012d 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -655,7 +655,8 @@ tracker_xmp_free (TrackerXmpData *data)
  * Since: 0.8
  **/
 gboolean
-tracker_xmp_apply (TrackerSparqlBuilder *metadata,
+tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
+                   TrackerSparqlBuilder *metadata,
                    const gchar          *uri,
                    TrackerXmpData       *data)
 {
@@ -750,19 +751,29 @@ tracker_xmp_apply (TrackerSparqlBuilder *metadata,
 	}
 
 	if (data->make || data->model) {
-		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-		tracker_sparql_builder_object_blank_open (metadata);
-		tracker_sparql_builder_predicate (metadata, "a");
-		tracker_sparql_builder_object (metadata, "nco:Equipment");
-		if (data->model) {
-			tracker_sparql_builder_predicate (metadata, "nco:model");
-			tracker_sparql_builder_object_unvalidated (metadata, data->model);
-		}
+		gchar *equip_uri;
+
+		equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+		                                              data->make ? data->make : "",
+		                                              data->model ? data->model : "");
+
+		tracker_sparql_builder_insert_open (preupdate, NULL);
+		tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+		tracker_sparql_builder_predicate (preupdate, "a");
+		tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 		if (data->make) {
-			tracker_sparql_builder_predicate (metadata, "nco:make");
-			tracker_sparql_builder_object_unvalidated (metadata, data->make);
+			tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+			tracker_sparql_builder_object_unvalidated (preupdate, data->make);
 		}
-		tracker_sparql_builder_object_blank_close (metadata);
+		if (data->model) {
+			tracker_sparql_builder_predicate (preupdate, "nfo:model");
+			tracker_sparql_builder_object_unvalidated (preupdate, data->model);
+		}
+		tracker_sparql_builder_insert_close (preupdate);
+		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+		tracker_sparql_builder_object_iri (metadata, equip_uri);
+		g_free (equip_uri);
 	}
 
 	if (data->title || data->title2 || data->pdf_title) {
diff --git a/src/libtracker-extract/tracker-xmp.h b/src/libtracker-extract/tracker-xmp.h
index 088abc3..c51debc 100644
--- a/src/libtracker-extract/tracker-xmp.h
+++ b/src/libtracker-extract/tracker-xmp.h
@@ -88,7 +88,8 @@ TrackerXmpData * tracker_xmp_new   (const gchar          *buffer,
                                     gsize                 len,
                                     const gchar          *uri);
 void             tracker_xmp_free  (TrackerXmpData       *data);
-gboolean         tracker_xmp_apply (TrackerSparqlBuilder *metadata,
+gboolean         tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
+                                    TrackerSparqlBuilder *metadata,
                                     const gchar          *uri,
                                     TrackerXmpData       *data);
 
diff --git a/src/miners/flickr/tracker-miner-flickr.vala b/src/miners/flickr/tracker-miner-flickr.vala
index 4a470f7..178680c 100644
--- a/src/miners/flickr/tracker-miner-flickr.vala
+++ b/src/miners/flickr/tracker-miner-flickr.vala
@@ -47,7 +47,8 @@ public class MinerFlickr : Tracker.MinerWeb {
 
 	/* Values taken from the EXIF spec */
 	private enum ExifTag {
-		CAMERA = 271,
+		CAMERA_MAKE = 271,
+		CAMERA_MODEL = 272,
 		FLASH = 37385,
 		FNUMBER = 33437,
 		FOCAL_LENGTH = 37386,
@@ -351,6 +352,7 @@ public class MinerFlickr : Tracker.MinerWeb {
 		Rest.XmlNode root_node;
 		Rest.XmlNode exif_node;
 		string exif_value;
+		string make = null, model = null;
 
 		exif_call.add_params ("method", "flickr.photos.getExif",
 		                      "photo_id", photo_node.get_attr ("id"));
@@ -370,8 +372,11 @@ public class MinerFlickr : Tracker.MinerWeb {
 			exif_value = exif_node.find ("raw").content;
 
 			switch (exif_node.get_attr ("tag").to_int ()) {
-				case ExifTag.CAMERA:
-					update_triple_string (builder, graph, urn, "nfo:device", exif_value);
+				case ExifTag.CAMERA_MAKE:
+					make = exif_value;
+					break;
+				case ExifTag.CAMERA_MODEL:
+					model = exif_value;
 					break;
 				case ExifTag.FLASH:
 					update_triple_object (builder, graph, urn, "nmm:flash", exif_value.to_int ()%2 == 1 ? "nmm:flash-on" : "nmm:flash-off");
@@ -425,6 +430,33 @@ public class MinerFlickr : Tracker.MinerWeb {
 			}
 			exif_node = exif_node.next;
 		}
+
+		if (make != null || model != null) {
+			string equip_uri;
+
+			equip_uri = Sparql.escape_uri_printf ("urn:equipment:%s:%s:",
+			                                       make != null ? make : "",
+			                                       model != null ? model : "");
+
+			builder.insert_open (graph);
+			builder.subject_iri (equip_uri);
+			builder.predicate ("a");
+			builder.object ("nfo:Equipment");
+
+			if (make != null) {
+				builder.predicate ("nfo:manufacturer");
+				builder.object_unvalidated (make);
+			}
+
+			if (model != null) {
+				builder.predicate ("nfo:model");
+				builder.object_unvalidated (model);
+			}
+
+			builder.insert_close ();
+
+			update_triple_object (builder, graph, urn, "nfo:equipment", equip_uri);
+		}
 	}
 
 	private void add_tags (string photo_id, string[] tags) {
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c
index 8618edc..190db0a 100644
--- a/src/tracker-extract/tracker-extract-gif.c
+++ b/src/tracker-extract/tracker-extract-gif.c
@@ -223,19 +223,29 @@ read_metadata (TrackerSparqlBuilder *preupdate,
 	}
 
 	if (xd->make || xd->model) {
-		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-		tracker_sparql_builder_object_blank_open (metadata);
-		tracker_sparql_builder_predicate (metadata, "a");
-		tracker_sparql_builder_object (metadata, "nco:Equipment");
-		if (xd->model) {
-			tracker_sparql_builder_predicate (metadata, "nco:model");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->model);
-		}
+		gchar *equip_uri;
+
+		equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+		                                              xd->make ? xd->make : "",
+		                                              xd->model ? xd->model : "");
+
+		tracker_sparql_builder_insert_open (preupdate, NULL);
+		tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+		tracker_sparql_builder_predicate (preupdate, "a");
+		tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 		if (xd->make) {
-			tracker_sparql_builder_predicate (metadata, "nco:make");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->make);
+			tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->make);
 		}
-		tracker_sparql_builder_object_blank_close (metadata);
+		if (xd->model) {
+			tracker_sparql_builder_predicate (preupdate, "nfo:model");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->model);
+		}
+		tracker_sparql_builder_insert_close (preupdate);
+		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+		tracker_sparql_builder_object_iri (metadata, equip_uri);
+		g_free (equip_uri);
 	}
 
 	if (md.title) {
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 8c96075..06d7ada 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -761,21 +761,31 @@ extract_metadata (MetadataExtractor      *extractor,
 		gst_tag_list_get_string (extractor->tagcache, GST_TAG_DEVICE_MAKE, &make);
 		gst_tag_list_get_string (extractor->tagcache, GST_TAG_DEVICE_MANUFACTURER, &manuf);
 
-
 		if (make || model || manuf) {
-			tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-			tracker_sparql_builder_object_blank_open (metadata);
-			tracker_sparql_builder_predicate (metadata, "a");
-			tracker_sparql_builder_object (metadata, "nco:Equipment");
-			if (model) {
-				tracker_sparql_builder_predicate (metadata, "nco:model");
-				tracker_sparql_builder_object_unvalidated (metadata, model);
-			}
+			gchar *equip_uri;
+
+			equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+			                                              manuf ? manuf : make ? make : "",
+			                                              model ? model : "");
+
+			tracker_sparql_builder_insert_open (preupdate, NULL);
+			tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+			tracker_sparql_builder_predicate (preupdate, "a");
+			tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 			if (make || manuf) {
-				tracker_sparql_builder_predicate (metadata, "nco:make");
-				tracker_sparql_builder_object_unvalidated (metadata, manuf ? manuf : make);
+				tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+				tracker_sparql_builder_object_unvalidated (preupdate, manuf ? manuf : make);
+			}
+			if (model) {
+				tracker_sparql_builder_predicate (preupdate, "nfo:model");
+				tracker_sparql_builder_object_unvalidated (preupdate, model);
 			}
-			tracker_sparql_builder_object_blank_close (metadata);
+			tracker_sparql_builder_insert_close (preupdate);
+
+			tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+			tracker_sparql_builder_object_iri (metadata, equip_uri);
+			g_free (equip_uri);
 		}
 
 		g_free (make);
diff --git a/src/tracker-extract/tracker-extract-gupnp-dlna.c b/src/tracker-extract/tracker-extract-gupnp-dlna.c
index ecf859d..9eec600 100644
--- a/src/tracker-extract/tracker-extract-gupnp-dlna.c
+++ b/src/tracker-extract/tracker-extract-gupnp-dlna.c
@@ -667,19 +667,30 @@ extract_metadata (MetadataExtractor      *extractor,
 		gst_tag_list_get_string (extractor->tags, GST_TAG_DEVICE_MANUFACTURER, &manuf);
 
 		if (make || model || manuf) {
-			tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-			tracker_sparql_builder_object_blank_open (metadata);
-			tracker_sparql_builder_predicate (metadata, "a");
-			tracker_sparql_builder_object (metadata, "nco:Equipment");
-			if (model) {
-				tracker_sparql_builder_predicate (metadata, "nco:model");
-				tracker_sparql_builder_object_unvalidated (metadata, model);
-			}
+			gchar *equip_uri;
+
+			equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+			                                              manuf ? manuf : make ? make : "",
+			                                              model ? model : "");
+
+			tracker_sparql_builder_insert_open (preupdate, NULL);
+			tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+			tracker_sparql_builder_predicate (preupdate, "a");
+			tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 			if (make || manuf) {
-				tracker_sparql_builder_predicate (metadata, "nco:make");
-				tracker_sparql_builder_object_unvalidated (metadata, manuf ? manuf : make);
+				tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+				tracker_sparql_builder_object_unvalidated (preupdate, manuf ? manuf : make);
+			}
+			if (model) {
+				tracker_sparql_builder_predicate (preupdate, "nfo:model");
+				tracker_sparql_builder_object_unvalidated (preupdate, model);
 			}
-			tracker_sparql_builder_object_blank_close (metadata);
+			tracker_sparql_builder_insert_close (preupdate);
+
+			tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+			tracker_sparql_builder_object_iri (metadata, equip_uri);
+			g_free (equip_uri);
 		}
 
 		g_free (make);
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index b888975..429b1dd 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -378,19 +378,29 @@ extract_jpeg (const gchar          *uri,
 	g_ptr_array_free (keywords, TRUE);
 
 	if (md.make || md.model) {
-		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-		tracker_sparql_builder_object_blank_open (metadata);
-		tracker_sparql_builder_predicate (metadata, "a");
-		tracker_sparql_builder_object (metadata, "nco:Equipment");
-		if (md.model) {
-			tracker_sparql_builder_predicate (metadata, "nco:model");
-			tracker_sparql_builder_object_unvalidated (metadata, md.model);
-		}
+		gchar *equip_uri;
+
+		equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+		                                              md.make ? md.make : "",
+		                                              md.model ? md.model : "");
+
+		tracker_sparql_builder_insert_open (preupdate, NULL);
+		tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+		tracker_sparql_builder_predicate (preupdate, "a");
+		tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 		if (md.make) {
-			tracker_sparql_builder_predicate (metadata, "nco:make");
-			tracker_sparql_builder_object_unvalidated (metadata, md.make);
+			tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+			tracker_sparql_builder_object_unvalidated (preupdate, md.make);
 		}
-		tracker_sparql_builder_object_blank_close (metadata);
+		if (md.model) {
+			tracker_sparql_builder_predicate (preupdate, "nfo:model");
+			tracker_sparql_builder_object_unvalidated (preupdate, md.model);
+		}
+		tracker_sparql_builder_insert_close (preupdate);
+		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+		tracker_sparql_builder_object_iri (metadata, equip_uri);
+		g_free (equip_uri);
 	}
 
 	if (md.title) {
diff --git a/src/tracker-extract/tracker-extract-pdf.cpp b/src/tracker-extract/tracker-extract-pdf.cpp
index c36a306..465b817 100644
--- a/src/tracker-extract/tracker-extract-pdf.cpp
+++ b/src/tracker-extract/tracker-extract-pdf.cpp
@@ -637,19 +637,29 @@ extract_pdf (const gchar          *uri,
 			}
 
 			if (xd->make || xd->model) {
-				tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-				tracker_sparql_builder_object_blank_open (metadata);
-				tracker_sparql_builder_predicate (metadata, "a");
-				tracker_sparql_builder_object (metadata, "nco:Equipment");
-				if (xd->model) {
-					tracker_sparql_builder_predicate (metadata, "nco:model");
-					tracker_sparql_builder_object_unvalidated (metadata, xd->model);
-				}
+				gchar *equip_uri;
+
+				equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+				                                              xd->make ? xd->make : "",
+				                                              xd->model ? xd->model : "");
+
+				tracker_sparql_builder_insert_open (preupdate, NULL);
+				tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+				tracker_sparql_builder_predicate (preupdate, "a");
+				tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 				if (xd->make) {
-					tracker_sparql_builder_predicate (metadata, "nco:make");
-					tracker_sparql_builder_object_unvalidated (metadata, xd->make);
+					tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+					tracker_sparql_builder_object_unvalidated (preupdate, xd->make);
 				}
-				tracker_sparql_builder_object_blank_close (metadata);
+				if (xd->model) {
+					tracker_sparql_builder_predicate (preupdate, "nfo:model");
+					tracker_sparql_builder_object_unvalidated (preupdate, xd->model);
+				}
+				tracker_sparql_builder_insert_close (preupdate);
+				tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+				tracker_sparql_builder_object_iri (metadata, equip_uri);
+				g_free (equip_uri);
 			}
 
 			if (xd->orientation) {
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index b73fb47..699f2c5 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -261,19 +261,29 @@ read_metadata (TrackerSparqlBuilder *preupdate,
 	}
 
 	if (md.make || md.model) {
-		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
-		tracker_sparql_builder_object_blank_open (metadata);
-		tracker_sparql_builder_predicate (metadata, "a");
-		tracker_sparql_builder_object (metadata, "nco:Equipment");
-		if (md.model) {
-			tracker_sparql_builder_predicate (metadata, "nco:model");
-			tracker_sparql_builder_object_unvalidated (metadata, md.model);
-		}
+		gchar *equip_uri;
+
+		equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+		                                              md.make ? md.make : "",
+		                                              md.model ? md.model : "");
+
+		tracker_sparql_builder_insert_open (preupdate, NULL);
+		tracker_sparql_builder_subject_iri (preupdate, equip_uri);
+		tracker_sparql_builder_predicate (preupdate, "a");
+		tracker_sparql_builder_object (preupdate, "nfo:Equipment");
+
 		if (md.make) {
-			tracker_sparql_builder_predicate (metadata, "nco:make");
-			tracker_sparql_builder_object_unvalidated (metadata, md.make);
+			tracker_sparql_builder_predicate (preupdate, "nfo:manufacturer");
+			tracker_sparql_builder_object_unvalidated (preupdate, md.make);
 		}
-		tracker_sparql_builder_object_blank_close (metadata);
+		if (md.model) {
+			tracker_sparql_builder_predicate (preupdate, "nfo:model");
+			tracker_sparql_builder_object_unvalidated (preupdate, md.model);
+		}
+		tracker_sparql_builder_insert_close (preupdate);
+		tracker_sparql_builder_predicate (metadata, "nfo:equipment");
+		tracker_sparql_builder_object_iri (metadata, equip_uri);
+		g_free (equip_uri);
 	}
 
 	if (md.artist) {
diff --git a/src/tracker-extract/tracker-extract-xmp.c b/src/tracker-extract/tracker-extract-xmp.c
index 57e026d..af6bb7c 100644
--- a/src/tracker-extract/tracker-extract-xmp.c
+++ b/src/tracker-extract/tracker-extract-xmp.c
@@ -154,7 +154,7 @@ extract_xmp (const gchar          *uri,
 		                      original_uri ? original_uri : uri);
 
 		if (xd) {
-			tracker_xmp_apply (metadata, uri, xd);
+			tracker_xmp_apply (preupdate, metadata, uri, xd);
 		}
 
 		g_free (original_uri);
diff --git a/tests/libtracker-extract/tracker-xmp-test.c b/tests/libtracker-extract/tracker-xmp-test.c
index 8d121d5..5fef88e 100644
--- a/tests/libtracker-extract/tracker-xmp-test.c
+++ b/tests/libtracker-extract/tracker-xmp-test.c
@@ -272,22 +272,23 @@ test_xmp_orientation (void)
 static void
 test_xmp_apply (void)
 {
-        TrackerSparqlBuilder *metadata;
-        TrackerXmpData *data;
+	TrackerSparqlBuilder *metadata, *preupdate;
+	TrackerXmpData *data;
 
-        metadata = tracker_sparql_builder_new_update ();;
+	metadata = tracker_sparql_builder_new_update ();;
+	preupdate = tracker_sparql_builder_new_update ();;
 
-        data = tracker_xmp_new (EXAMPLE_XMP, strlen (EXAMPLE_XMP), "urn:uuid:test");
+	data = tracker_xmp_new (EXAMPLE_XMP, strlen (EXAMPLE_XMP), "urn:uuid:test");
 	g_assert (data != NULL);
 
-        tracker_sparql_builder_insert_open (metadata, NULL);
-        tracker_sparql_builder_subject_iri (metadata, "urn:uuid:test");
+	tracker_sparql_builder_insert_open (metadata, NULL);
+	tracker_sparql_builder_subject_iri (metadata, "urn:uuid:test");
 
-        g_assert (tracker_xmp_apply (metadata, "urn:uuid:test", data));
+	g_assert (tracker_xmp_apply (preupdate, metadata, "urn:uuid:test", data));
 
-        tracker_sparql_builder_insert_close (metadata);
+	tracker_sparql_builder_insert_close (metadata);
 
-        /* This is the only way to check the sparql is kinda correct */
+	/* This is the only way to check the sparql is kinda correct */
 
 	/* Disabled this for 0.8.5. It was reporting 41 not 50, this
 	 * test is not credible and I can't see how it can be trusted
@@ -296,31 +297,32 @@ test_xmp_apply (void)
 	 * -mr
 	 */
 
-        /* g_assert_cmpint (tracker_sparql_builder_get_length (metadata), ==, 50); */
+	/* g_assert_cmpint (tracker_sparql_builder_get_length (metadata), ==, 50); */
 }
 
 static void
 test_xmp_apply_location (void)
 {
-        TrackerXmpData data = { 0, };
-        TrackerSparqlBuilder *metadata;
+	TrackerXmpData data = { 0, };
+	TrackerSparqlBuilder *metadata, *preupdate;
 
-        data.address = g_strdup ("Itamerenkatu 11-13");
-        data.city = g_strdup ("Helsinki");
-        data.state = g_strdup ("N/A");
-        data.country = g_strdup ("Findland");
+	data.address = g_strdup ("Itamerenkatu 11-13");
+	data.city = g_strdup ("Helsinki");
+	data.state = g_strdup ("N/A");
+	data.country = g_strdup ("Findland");
 
-        metadata = tracker_sparql_builder_new_update ();
+	metadata = tracker_sparql_builder_new_update ();
+	preupdate = tracker_sparql_builder_new_update ();
 
-        tracker_sparql_builder_insert_open (metadata, NULL);
-        tracker_sparql_builder_subject_iri (metadata, "urn:uuid:test");
+	tracker_sparql_builder_insert_open (metadata, NULL);
+	tracker_sparql_builder_subject_iri (metadata, "urn:uuid:test");
 
-        g_assert (tracker_xmp_apply (metadata, "urn:uuid:test", &data));
+	g_assert (tracker_xmp_apply (preupdate, metadata, "urn:uuid:test", &data));
 
-        tracker_sparql_builder_insert_close (metadata);
+	tracker_sparql_builder_insert_close (metadata);
 
-        /* This is the only way to check the sparql is kinda correct */
-        g_assert_cmpint (tracker_sparql_builder_get_length (metadata), ==, 6);
+	/* This is the only way to check the sparql is kinda correct */
+	g_assert_cmpint (tracker_sparql_builder_get_length (metadata), ==, 6);
 }
 
 int



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