tracker r2614 - in branches/turtle: . src/libtracker-data src/tracker-indexer
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2614 - in branches/turtle: . src/libtracker-data src/tracker-indexer
- Date: Fri, 28 Nov 2008 17:08:16 +0000 (UTC)
Author: pvanhoof
Date: Fri Nov 28 17:08:16 2008
New Revision: 2614
URL: http://svn.gnome.org/viewvc/tracker?rev=2614&view=rev
Log:
2008-11-28 Philip Van Hoof <philip codeminded be>
* src/tracker-indexer/tracker-removable-device.c
* src/libtracker-data/tracker-turtle.c
* src/libtracker-data/tracker-data-update.c: Making removals work
Modified:
branches/turtle/ChangeLog
branches/turtle/src/libtracker-data/tracker-data-update.c
branches/turtle/src/libtracker-data/tracker-turtle.c
branches/turtle/src/tracker-indexer/tracker-removable-device.c
Modified: branches/turtle/src/libtracker-data/tracker-data-update.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-data-update.c (original)
+++ branches/turtle/src/libtracker-data/tracker-data-update.c Fri Nov 28 17:08:16 2008
@@ -589,9 +589,11 @@
/* When merging from the decomposed branch to trunk then this function
* wont exist in the decomposed branch. Create it based on this one. */
- tracker_data_update_delete_service (service, service_id);
- tracker_data_update_delete_service_recursively (service, (gchar *) path);
- tracker_data_update_delete_all_metadata (service, service_id);
+ if (service_id != 0) {
+ tracker_data_update_delete_service (service, service_id);
+ tracker_data_update_delete_service_recursively (service, (gchar *) path);
+ tracker_data_update_delete_all_metadata (service, service_id);
+ }
}
/* TODO: URI branch path -> uri */
@@ -720,9 +722,12 @@
gchar *dirname;
const gchar *basename;
- /* TODO untested and unfinished port that came from the decomposed
- * branch of JÃrg. When merging from the decomposed branch to trunk
- * then pick the version in the decomposed branch for this function */
+ /* When merging from the decomposed branch to trunk then pick the version
+ * in the decomposed branch for this function. However, carefully
+ * compare the features, as this version is more recent and has
+ * implemented a few significant items, whereas the version in the
+ * decomposed branch was a proof of concept implementation, and might
+ * not have these needed features. */
if (!rdf_type)
return;
Modified: branches/turtle/src/libtracker-data/tracker-turtle.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-turtle.c (original)
+++ branches/turtle/src/libtracker-data/tracker-turtle.c Fri Nov 28 17:08:16 2008
@@ -147,21 +147,25 @@
(GDestroyNotify) g_free);
}
+ if (triple->object_type == RAPTOR_IDENTIFIER_TYPE_RESOURCE) {
- /* TODO: Add conflict resolution here (if any is needed) */
+ /* TODO: these checks for removals of resources and predicates
+ * are incorrect atm */
- if (triple->object_type == RAPTOR_IDENTIFIER_TYPE_RESOURCE) {
if (g_str_has_suffix (predicate, ":")) {
- /* <URI> <:> <:> */
+ /* <URI> <> <> */
g_hash_table_destroy (info->hash);
g_free (info->last_subject);
info->last_subject = NULL;
info->hash = NULL;
} else {
- /* <URI> <Pfx:Predicate> <:> */
+ /* <URI> <Pfx:Predicate> <> */
g_hash_table_remove (info->hash, predicate);
}
} else {
+
+ /* TODO: Add conflict resolution here (if any is needed) */
+
g_hash_table_replace (info->hash,
g_strdup (predicate),
g_strdup (triple->object));
Modified: branches/turtle/src/tracker-indexer/tracker-removable-device.c
==============================================================================
--- branches/turtle/src/tracker-indexer/tracker-removable-device.c (original)
+++ branches/turtle/src/tracker-indexer/tracker-removable-device.c Fri Nov 28 17:08:16 2008
@@ -93,24 +93,30 @@
* the database api becomes sane and uses URIs everywhere, the
* '+ 7' means that we cut away the 'file://' prefix. */
- switch (task) {
- case REMOVAL:
+ if (info->rdf_type) {
+
+ /* We ignore records that didn't have an <rdf:type>
+ * predicate. Those are just wrong anyway. */
+
+ switch (task) {
+ case REMOVAL:
tracker_data_delete_service (info->last_subject + 7,
info->rdf_type);
- break;
- case MOVE:
+ break;
+ case MOVE:
tracker_data_delete_service (info->last_subject + 7,
info->rdf_type);
tracker_data_replace_service (destination + 7,
info->rdf_type,
info->metadata);
- break;
- default:
- case REPLACE:
+ break;
+ default:
+ case REPLACE:
tracker_data_replace_service (info->last_subject + 7,
info->rdf_type,
info->metadata);
- break;
+ break;
+ }
}
info->amount++;
@@ -186,12 +192,13 @@
}
} else if (triple->object_type == RAPTOR_IDENTIFIER_TYPE_RESOURCE) {
- gchar *key = g_strdup_printf ("file://%s/:", info->base);
+ gchar *key = g_strdup_printf ("file://%s/", info->base);
if (triple->object && strcmp (key, triple->object) == 0 &&
triple->predicate && strcmp (key, triple->predicate) == 0)
{
- /* <URI> <:> <:> - is a removal of the resource */
+ /* <URI> <rdf:type> "Type" ; *
+ * <> <> - is a removal of the resource */
/* We commit this subject as a removal, the last_subject
* field will be cleared for the next subject to be set
@@ -206,8 +213,10 @@
gchar *predicate;
TrackerField *field;
- /* <URI> <Pfx:Predicate> <:> - is a removal of the
- * resource's Pfx:Predicate */
+ /* <URI> <rdf:type> "Type" ; *
+ * <Pfx:Predicate> <> - is a removal of the *
+ * resource's Pfx:Predicate */
+
predicate = (gchar *) raptor_uri_as_string ((raptor_uri *) triple->predicate);
/* We put NULL here, so that a null value goes into
@@ -231,7 +240,7 @@
triple->predicate && strcmp (key, triple->predicate) == 0)
{
gchar *object;
- /* <URI> <:> <to-URI> - is a move of the subject */
+ /* <URI> <> <to-URI> - is a move of the subject */
object = (gchar *) raptor_uri_as_string ((raptor_uri *) triple->object);
commit_turtle_parse_info_storer (info, FALSE, MOVE, object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]