[tracker/uuid-geo-stuff: 4/7] tracker-extract: gif: Fixed nested use of anonymous blank nodes



commit 0a28c233213550cf2abddbc72d9d6e03b711c0d4
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Nov 24 15:12:37 2010 +0100

    tracker-extract: gif: Fixed nested use of anonymous blank nodes
    
    Fixes NB#202291

 src/tracker-extract/tracker-extract-gif.c |   36 +++++++++++++++++-----------
 1 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c
index 78a39fa..ab69748 100644
--- a/src/tracker-extract/tracker-extract-gif.c
+++ b/src/tracker-extract/tracker-extract-gif.c
@@ -419,9 +419,11 @@ read_metadata (TrackerSparqlBuilder *preupdate,
 	}
 
 	if (xd->address || xd->country || xd->city) {
+		gchar *addruri;
+
 		tracker_sparql_builder_predicate (metadata, "mlo:location");
 
-		tracker_sparql_builder_object_blank_open (metadata);
+		tracker_sparql_builder_object_blank_open (metadata); /* GeoPoint */
 		tracker_sparql_builder_predicate (metadata, "a");
 		tracker_sparql_builder_object (metadata, "mlo:GeoPoint");
 
@@ -445,35 +447,41 @@ read_metadata (TrackerSparqlBuilder *preupdate,
 			tracker_sparql_builder_object_unvalidated (metadata, xd->country);
 		}
 
+		addruri = tracker_sparql_get_uuid_urn ("postal-address");
+
 		tracker_sparql_builder_predicate (metadata, "mlo:asPostalAddress");
-		tracker_sparql_builder_object_blank_open (metadata); /* PostalAddress */
+		tracker_sparql_builder_object_iri (metadata, addruri);
 
-		tracker_sparql_builder_predicate (metadata, "a");
-		tracker_sparql_builder_object (metadata, "nco:PostalAddress");
+		tracker_sparql_builder_object_blank_close (metadata); /* GeoPoint */
+
+		tracker_sparql_builder_insert_open (preupdate, NULL);
+		tracker_sparql_builder_subject_iri (preupdate, addruri);
+
+		tracker_sparql_builder_predicate (preupdate, "a");
+		tracker_sparql_builder_object (preupdate, "nco:PostalAddress");
 
 		if (xd->address) {
-			tracker_sparql_builder_predicate (metadata, "nco:streetAddress");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->address);
+			tracker_sparql_builder_predicate (preupdate, "nco:streetAddress");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->address);
 		}
 
 		if (xd->state) {
-			tracker_sparql_builder_predicate (metadata, "nco:region");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->state);
+			tracker_sparql_builder_predicate (preupdate, "nco:region");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->state);
 		}
 
 		if (xd->city) {
-			tracker_sparql_builder_predicate (metadata, "nco:locality");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->city);
+			tracker_sparql_builder_predicate (preupdate, "nco:locality");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->city);
 		}
 
 		if (xd->country) {
-			tracker_sparql_builder_predicate (metadata, "nco:country");
-			tracker_sparql_builder_object_unvalidated (metadata, xd->country);
+			tracker_sparql_builder_predicate (preupdate, "nco:country");
+			tracker_sparql_builder_object_unvalidated (preupdate, xd->country);
 		}
 
-		tracker_sparql_builder_object_blank_close (metadata); /* PostalAddress */
+		tracker_sparql_builder_insert_close (preupdate);
 
-		tracker_sparql_builder_object_blank_close (metadata);
 	}
 
 	if (gd.width) {



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