[tracker/wip/extract-graphs: 22/30] tracker-extract, jpeg: Do all inserts in miner-fs's graph
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/extract-graphs: 22/30] tracker-extract, jpeg: Do all inserts in miner-fs's graph
- Date: Tue, 6 Sep 2011 10:52:58 +0000 (UTC)
commit 9104a648dce486d0c6478ea8449f5eddd4a7f617
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Sep 6 10:36:41 2011 +0200
tracker-extract, jpeg: Do all inserts in miner-fs's graph
src/tracker-extract/tracker-extract-jpeg.c | 50 +++++++++++++++++++++++++++-
1 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index 1e4c302..9785c42 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -100,7 +100,7 @@ guess_dlna_profile (gint width,
const gchar **dlna_profile,
const gchar **dlna_mimetype)
{
- gchar *profile = NULL;
+ const gchar *profile = NULL;
if (dlna_profile) {
*dlna_profile = NULL;
@@ -331,11 +331,19 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
gchar *uri = tracker_sparql_escape_uri_printf ("urn:contact:%s", id->contact);
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, uri);
tracker_sparql_builder_predicate (preupdate, "a");
tracker_sparql_builder_object (preupdate, "nco:Contact");
tracker_sparql_builder_predicate (preupdate, "nco:fullname");
tracker_sparql_builder_object_unvalidated (preupdate, id->contact);
+
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
tracker_sparql_builder_insert_close (preupdate);
tracker_sparql_builder_predicate (metadata, "nco:representative");
@@ -361,11 +369,19 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
gchar *uri = tracker_sparql_escape_uri_printf ("urn:contact:%s", xd->publisher);
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, uri);
tracker_sparql_builder_predicate (preupdate, "a");
tracker_sparql_builder_object (preupdate, "nco:Contact");
tracker_sparql_builder_predicate (preupdate, "nco:fullname");
tracker_sparql_builder_object_unvalidated (preupdate, xd->publisher);
+
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
tracker_sparql_builder_insert_close (preupdate);
tracker_sparql_builder_predicate (metadata, "nco:publisher");
@@ -480,6 +496,10 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
md.model ? md.model : "");
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, equip_uri);
tracker_sparql_builder_predicate (preupdate, "a");
tracker_sparql_builder_object (preupdate, "nfo:Equipment");
@@ -492,7 +512,12 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
tracker_sparql_builder_predicate (preupdate, "nfo:model");
tracker_sparql_builder_object_unvalidated (preupdate, md.model);
}
+
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
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);
@@ -543,11 +568,19 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
gchar *uri = tracker_sparql_escape_uri_printf ("urn:contact:%s", md.artist);
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, uri);
tracker_sparql_builder_predicate (preupdate, "a");
tracker_sparql_builder_object (preupdate, "nco:Contact");
tracker_sparql_builder_predicate (preupdate, "nco:fullname");
tracker_sparql_builder_object_unvalidated (preupdate, md.artist);
+
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
tracker_sparql_builder_insert_close (preupdate);
tracker_sparql_builder_predicate (metadata, "nco:contributor");
@@ -590,11 +623,19 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
gchar *uri = tracker_sparql_escape_uri_printf ("urn:contact:%s", md.creator);
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, uri);
tracker_sparql_builder_predicate (preupdate, "a");
tracker_sparql_builder_object (preupdate, "nco:Contact");
tracker_sparql_builder_predicate (preupdate, "nco:fullname");
tracker_sparql_builder_object_unvalidated (preupdate, md.creator);
+
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
tracker_sparql_builder_insert_close (preupdate);
/* NOTE: We only have affiliation with
@@ -648,6 +689,10 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
tracker_sparql_builder_object_iri (metadata, addruri);
tracker_sparql_builder_insert_open (preupdate, NULL);
+ if (graph) {
+ tracker_sparql_builder_graph_open (preupdate, graph);
+ }
+
tracker_sparql_builder_subject_iri (preupdate, addruri);
g_free (addruri);
@@ -675,6 +720,9 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
tracker_sparql_builder_object_unvalidated (preupdate, md.country);
}
+ if (graph) {
+ tracker_sparql_builder_graph_close (preupdate);
+ }
tracker_sparql_builder_insert_close (preupdate);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]