Commit a4d60c19 authored by Martyn Russell's avatar Martyn Russell

libtracker-common: Moved tracker-ontologies.h into libtracker-sparql

The Namespace has been cleaned up too, all APIs now start with:

  TRACKER_PREFIX_

or

  TRACKER_DATASOURCE_

The well known definition for the TrackerMinerFS graph has also been changed
to:

  TRACKER_OWN_GRAPH_URN

because it now applies to more than just the TrackerMinerFS, we're using it
in:

  tracker-writeback
  tracker-miner-apps
  tracker-miner-user-guides
  ...
  libtracker-data

It should probably be internal actually.
parent b44c1c82
......@@ -23,22 +23,17 @@
#include <libtracker-data/tracker-data.h>
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDF_PROPERTY RDF_PREFIX "Property"
#define RDF_TYPE RDF_PREFIX "type"
#define RDF_PROPERTY TRACKER_PREFIX_RDF "Property"
#define RDF_TYPE TRACKER_PREFIX_RDF "type"
#define RDFS_PREFIX TRACKER_RDFS_PREFIX
#define RDFS_CLASS RDFS_PREFIX "Class"
#define RDFS_DOMAIN RDFS_PREFIX "domain"
#define RDFS_RANGE RDFS_PREFIX "range"
#define RDFS_SUB_CLASS_OF RDFS_PREFIX "subClassOf"
#define RDFS_SUB_PROPERTY_OF RDFS_PREFIX "subPropertyOf"
#define RDFS_CLASS TRACKER_PREFIX_RDFS "Class"
#define RDFS_DOMAIN TRACKER_PREFIX_RDFS "domain"
#define RDFS_RANGE TRACKER_PREFIX_RDFS "range"
#define RDFS_SUB_CLASS_OF TRACKER_PREFIX_RDFS "subClassOf"
#define RDFS_SUB_PROPERTY_OF TRACKER_PREFIX_RDFS "subPropertyOf"
#define NRL_PREFIX TRACKER_NRL_PREFIX
#define NRL_INVERSE_FUNCTIONAL_PROPERTY TRACKER_NRL_PREFIX "InverseFunctionalProperty"
#define NRL_MAX_CARDINALITY NRL_PREFIX "maxCardinality"
#define TRACKER_PREFIX TRACKER_TRACKER_PREFIX
#define NRL_INVERSE_FUNCTIONAL_PROPERTY TRACKER_PREFIX_NRL "InverseFunctionalProperty"
#define NRL_MAX_CARDINALITY TRACKER_PREFIX_NRL "maxCardinality"
static gchar *ontology_dir = NULL;
static gchar *output_file = NULL;
......@@ -137,7 +132,7 @@ load_ontology_file_from_path (const gchar *ontology_file)
}
tracker_property_set_is_inverse_functional_property (property, TRUE);
} else if (g_strcmp0 (object, TRACKER_PREFIX "Namespace") == 0) {
} else if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Namespace") == 0) {
TrackerNamespace *namespace;
if (tracker_ontologies_get_namespace_by_uri (subject) != NULL) {
......@@ -228,7 +223,7 @@ load_ontology_file_from_path (const gchar *ontology_file)
if (atoi (object) == 1) {
tracker_property_set_multiple_values (property, FALSE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "indexed") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "indexed") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -240,7 +235,7 @@ load_ontology_file_from_path (const gchar *ontology_file)
if (strcmp (object, "true") == 0) {
tracker_property_set_indexed (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "transient") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "transient") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -252,7 +247,7 @@ load_ontology_file_from_path (const gchar *ontology_file)
if (g_strcmp0 (object, "true") == 0) {
tracker_property_set_transient (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "fulltextIndexed") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "fulltextIndexed") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -264,7 +259,7 @@ load_ontology_file_from_path (const gchar *ontology_file)
if (strcmp (object, "true") == 0) {
tracker_property_set_fulltext_indexed (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "prefix") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "prefix") == 0) {
TrackerNamespace *namespace;
namespace = tracker_ontologies_get_namespace_by_uri (subject);
......
......@@ -38,7 +38,6 @@ noinst_HEADERS = \
tracker-common.h \
tracker-date-time.h \
tracker-file-utils.h \
tracker-ontologies.h \
tracker-sched.h \
tracker-storage.h \
tracker-type-utils.h \
......
......@@ -34,7 +34,6 @@
#include "tracker-ioprio.h"
#include "tracker-language.h"
#include "tracker-log.h"
#include "tracker-ontologies.h"
#include "tracker-os-dependant.h"
#include "tracker-sched.h"
#include "tracker-storage.h"
......
......@@ -49,26 +49,19 @@
#include "tracker-sparql-query.h"
#include "tracker-data-query.h"
#define XSD_PREFIX TRACKER_XSD_PREFIX
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDF_PROPERTY RDF_PREFIX "Property"
#define RDF_TYPE RDF_PREFIX "type"
#define RDF_PROPERTY TRACKER_PREFIX_RDF "Property"
#define RDF_TYPE TRACKER_PREFIX_RDF "type"
#define RDFS_PREFIX TRACKER_RDFS_PREFIX
#define RDFS_CLASS RDFS_PREFIX "Class"
#define RDFS_DOMAIN RDFS_PREFIX "domain"
#define RDFS_RANGE RDFS_PREFIX "range"
#define RDFS_SUB_CLASS_OF RDFS_PREFIX "subClassOf"
#define RDFS_SUB_PROPERTY_OF RDFS_PREFIX "subPropertyOf"
#define RDFS_CLASS TRACKER_PREFIX_RDFS "Class"
#define RDFS_DOMAIN TRACKER_PREFIX_RDFS "domain"
#define RDFS_RANGE TRACKER_PREFIX_RDFS "range"
#define RDFS_SUB_CLASS_OF TRACKER_PREFIX_RDFS "subClassOf"
#define RDFS_SUB_PROPERTY_OF TRACKER_PREFIX_RDFS "subPropertyOf"
#define NRL_PREFIX TRACKER_NRL_PREFIX
#define NRL_INVERSE_FUNCTIONAL_PROPERTY TRACKER_NRL_PREFIX "InverseFunctionalProperty"
#define NRL_MAX_CARDINALITY NRL_PREFIX "maxCardinality"
#define NRL_INVERSE_FUNCTIONAL_PROPERTY TRACKER_PREFIX_NRL "InverseFunctionalProperty"
#define NRL_MAX_CARDINALITY TRACKER_PREFIX_NRL "maxCardinality"
#define NAO_PREFIX TRACKER_NAO_PREFIX
#define NAO_LAST_MODIFIED NAO_PREFIX "lastModified"
#define TRACKER_PREFIX TRACKER_TRACKER_PREFIX
#define NAO_LAST_MODIFIED TRACKER_PREFIX_NAO "lastModified"
#define ZLIBBUFSIZ 8192
......@@ -96,17 +89,17 @@ static Conversion allowed_cardinality_conversions[] = {
};
static Conversion allowed_range_conversions[] = {
{ XSD_PREFIX "integer", XSD_PREFIX "string" },
{ XSD_PREFIX "integer", XSD_PREFIX "double" },
{ XSD_PREFIX "integer", XSD_PREFIX "boolean" },
{ TRACKER_PREFIX_XSD "integer", TRACKER_PREFIX_XSD "string" },
{ TRACKER_PREFIX_XSD "integer", TRACKER_PREFIX_XSD "double" },
{ TRACKER_PREFIX_XSD "integer", TRACKER_PREFIX_XSD "boolean" },
{ XSD_PREFIX "string", XSD_PREFIX "integer" },
{ XSD_PREFIX "string", XSD_PREFIX "double" },
{ XSD_PREFIX "string", XSD_PREFIX "boolean" },
{ TRACKER_PREFIX_XSD "string", TRACKER_PREFIX_XSD "integer" },
{ TRACKER_PREFIX_XSD "string", TRACKER_PREFIX_XSD "double" },
{ TRACKER_PREFIX_XSD "string", TRACKER_PREFIX_XSD "boolean" },
{ XSD_PREFIX "double", XSD_PREFIX "integer" },
{ XSD_PREFIX "double", XSD_PREFIX "string" },
{ XSD_PREFIX "double", XSD_PREFIX "boolean" },
{ TRACKER_PREFIX_XSD "double", TRACKER_PREFIX_XSD "integer" },
{ TRACKER_PREFIX_XSD "double", TRACKER_PREFIX_XSD "string" },
{ TRACKER_PREFIX_XSD "double", TRACKER_PREFIX_XSD "boolean" },
{ NULL, NULL }
};
......@@ -692,7 +685,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_property_set_is_inverse_functional_property (property, TRUE);
} else if (g_strcmp0 (object, TRACKER_PREFIX "Namespace") == 0) {
} else if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Namespace") == 0) {
TrackerNamespace *namespace;
if (tracker_ontologies_get_namespace_by_uri (subject) != NULL) {
......@@ -707,7 +700,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
tracker_ontologies_add_namespace (namespace);
g_object_unref (namespace);
} else if (g_strcmp0 (object, TRACKER_PREFIX "Ontology") == 0) {
} else if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Ontology") == 0) {
TrackerOntology *ontology;
if (tracker_ontologies_get_ontology_by_uri (subject) != NULL) {
......@@ -737,7 +730,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
if (is_new != in_update) {
gboolean ignore = FALSE;
/* Detect unsupported ontology change (this needs a journal replay) */
if (in_update == TRUE && is_new == FALSE && g_strcmp0 (object, RDFS_PREFIX "Resource") != 0) {
if (in_update == TRUE && is_new == FALSE && g_strcmp0 (object, TRACKER_PREFIX_RDFS "Resource") != 0) {
TrackerClass **super_classes = tracker_class_get_super_classes (class);
gboolean had = FALSE;
......@@ -799,7 +792,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
tracker_class_add_super_class (class, super_class);
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "notify") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "notify") == 0) {
TrackerClass *class;
class = tracker_ontologies_get_class_by_uri (subject);
......@@ -810,7 +803,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_class_set_notify (class, (strcmp (object, "true") == 0));
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "domainIndex") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "domainIndex") == 0) {
TrackerClass *class;
TrackerProperty *property;
TrackerProperty **properties;
......@@ -896,7 +889,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
tracker_property_add_domain_index (property, class);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "writeback") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "writeback") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -907,7 +900,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_property_set_writeback (property, (strcmp (object, "true") == 0));
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "forceJournal") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "forceJournal") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -1075,7 +1068,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
tracker_property_set_last_multiple_values (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "indexed") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "indexed") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -1085,7 +1078,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_property_set_indexed (property, (strcmp (object, "true") == 0));
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "secondaryIndex") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "secondaryIndex") == 0) {
TrackerProperty *property, *secondary_index;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -1101,7 +1094,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_property_set_secondary_index (property, secondary_index);
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "transient") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "transient") == 0) {
TrackerProperty *property;
gboolean is_new;
......@@ -1137,7 +1130,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
if (g_strcmp0 (object, "true") == 0) {
tracker_property_set_transient (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "fulltextIndexed") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "fulltextIndexed") == 0) {
TrackerProperty *property;
gboolean is_new;
......@@ -1170,7 +1163,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
if (strcmp (object, "true") == 0) {
tracker_property_set_fulltext_indexed (property, TRUE);
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "defaultValue") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "defaultValue") == 0) {
TrackerProperty *property;
property = tracker_ontologies_get_property_by_uri (subject);
......@@ -1180,7 +1173,7 @@ tracker_data_ontology_load_statement (const gchar *ontology_path,
}
tracker_property_set_default_value (property, object);
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "prefix") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "prefix") == 0) {
TrackerNamespace *namespace;
namespace = tracker_ontologies_get_namespace_by_uri (subject);
......@@ -1286,7 +1279,7 @@ check_for_deleted_domain_index (TrackerClass *class)
tracker_class_del_domain_index (class, prop);
tracker_data_delete_statement (NULL, tracker_class_get_uri (class),
TRACKER_PREFIX "domainIndex",
TRACKER_PREFIX_TRACKER "domainIndex",
tracker_property_get_uri (prop),
&error);
......@@ -1325,7 +1318,7 @@ check_for_deleted_super_classes (TrackerClass *class,
gboolean found = FALSE;
TrackerClass **super_classes;
if (g_strcmp0 (tracker_class_get_uri (last_super_class), RDFS_PREFIX "Resource") == 0) {
if (g_strcmp0 (tracker_class_get_uri (last_super_class), TRACKER_PREFIX_RDFS "Resource") == 0) {
last_super_classes++;
continue;
}
......@@ -1390,11 +1383,12 @@ check_for_max_cardinality_change (TrackerProperty *property,
const gchar *subject = tracker_property_get_uri (property);
if (update_property_value (ontology_path,
"nrl:maxCardinality",
subject,
NRL_PREFIX "maxCardinality",
NULL, allowed_cardinality_conversions,
NULL, property, &n_error)) {
"nrl:maxCardinality",
subject,
TRACKER_PREFIX_NRL "maxCardinality",
NULL, allowed_cardinality_conversions,
NULL, property,
&n_error)) {
TrackerClass *class;
class = tracker_property_get_domain(property);
......@@ -1459,7 +1453,7 @@ check_for_deleted_super_properties (TrackerProperty *property,
tracker_property_del_super_property (property, prop_to_remove);
tracker_data_delete_statement (NULL, subject,
RDFS_PREFIX "subPropertyOf",
TRACKER_PREFIX_RDFS "subPropertyOf",
object, &n_error);
if (!n_error) {
......@@ -1545,14 +1539,14 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
update_property_value (ontology_path,
"tracker:notify",
subject,
TRACKER_PREFIX "notify",
TRACKER_PREFIX_TRACKER "notify",
"true", allowed_boolean_conversions,
class, NULL, &n_error);
} else {
update_property_value (ontology_path,
"tracker:notify",
subject,
TRACKER_PREFIX "notify",
TRACKER_PREFIX_TRACKER "notify",
"false", allowed_boolean_conversions,
class, NULL, &n_error);
}
......@@ -1612,14 +1606,14 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
update_property_value (ontology_path,
"tracker:writeback",
subject,
TRACKER_PREFIX "writeback",
TRACKER_PREFIX_TRACKER "writeback",
"true", allowed_boolean_conversions,
NULL, property, &n_error);
} else {
update_property_value (ontology_path,
"tracker:writeback",
subject,
TRACKER_PREFIX "writeback",
TRACKER_PREFIX_TRACKER "writeback",
"false", allowed_boolean_conversions,
NULL, property, &n_error);
}
......@@ -1633,7 +1627,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
if (update_property_value (ontology_path,
"tracker:indexed",
subject,
TRACKER_PREFIX "indexed",
TRACKER_PREFIX_TRACKER "indexed",
"true", allowed_boolean_conversions,
NULL, property, &n_error)) {
fix_indexed (property, TRUE, &n_error);
......@@ -1643,7 +1637,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
if (update_property_value (ontology_path,
"tracker:indexed",
subject,
TRACKER_PREFIX "indexed",
TRACKER_PREFIX_TRACKER "indexed",
"false", allowed_boolean_conversions,
NULL, property, &n_error)) {
fix_indexed (property, TRUE, &n_error);
......@@ -1662,7 +1656,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
if (update_property_value (ontology_path,
"tracker:secondaryIndex",
subject,
TRACKER_PREFIX "secondaryIndex",
TRACKER_PREFIX_TRACKER "secondaryIndex",
tracker_property_get_uri (secondary_index), NULL,
NULL, property, &n_error)) {
if (!indexed_set) {
......@@ -1673,7 +1667,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
if (update_property_value (ontology_path,
"tracker:secondaryIndex",
subject,
TRACKER_PREFIX "secondaryIndex",
TRACKER_PREFIX_TRACKER "secondaryIndex",
NULL, NULL,
NULL, property, &n_error)) {
if (!indexed_set) {
......@@ -1688,7 +1682,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
}
if (update_property_value (ontology_path,
"rdfs:range", subject, RDFS_PREFIX "range",
"rdfs:range", subject, TRACKER_PREFIX_RDFS "range",
tracker_class_get_uri (tracker_property_get_range (property)),
allowed_range_conversions,
NULL, property, &n_error)) {
......@@ -1705,7 +1699,7 @@ tracker_data_ontology_process_changes_post_db (GPtrArray *seen_classes,
}
if (update_property_value (ontology_path,
"tracker:defaultValue", subject, TRACKER_PREFIX "defaultValue",
"tracker:defaultValue", subject, TRACKER_PREFIX_TRACKER "defaultValue",
tracker_property_get_default_value (property),
NULL, NULL, property, &n_error)) {
TrackerClass *class;
......@@ -1820,7 +1814,7 @@ get_ontology_from_path (const gchar *ontology_path)
object = tracker_turtle_reader_get_object (reader);
if (g_strcmp0 (predicate, RDF_TYPE) == 0) {
if (g_strcmp0 (object, TRACKER_PREFIX "Ontology") == 0) {
if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Ontology") == 0) {
TrackerOntology *ontology;
ontology = tracker_ontology_new ();
......@@ -1923,7 +1917,7 @@ tracker_data_ontology_process_statement (const gchar *graph,
if (prop && tracker_property_get_is_new (prop) != in_update) {
return;
}
} else if (g_strcmp0 (object, TRACKER_PREFIX "Namespace") == 0) {
} else if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Namespace") == 0) {
TrackerNamespace *namespace;
namespace = tracker_ontologies_get_namespace_by_uri (subject);
......@@ -1931,7 +1925,7 @@ tracker_data_ontology_process_statement (const gchar *graph,
if (namespace && tracker_namespace_get_is_new (namespace) != in_update) {
return;
}
} else if (g_strcmp0 (object, TRACKER_PREFIX "Ontology") == 0) {
} else if (g_strcmp0 (object, TRACKER_PREFIX_TRACKER "Ontology") == 0) {
TrackerOntology *ontology;
ontology = tracker_ontologies_get_ontology_by_uri (subject);
......@@ -1952,9 +1946,9 @@ tracker_data_ontology_process_statement (const gchar *graph,
g_strcmp0 (predicate, RDFS_DOMAIN) == 0 ||
g_strcmp0 (predicate, RDFS_RANGE) == 0 ||
/* g_strcmp0 (predicate, NRL_MAX_CARDINALITY) == 0 || */
g_strcmp0 (predicate, TRACKER_PREFIX "indexed") == 0 ||
g_strcmp0 (predicate, TRACKER_PREFIX "transient") == 0 ||
g_strcmp0 (predicate, TRACKER_PREFIX "fulltextIndexed") == 0) {
g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "indexed") == 0 ||
g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "transient") == 0 ||
g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "fulltextIndexed") == 0) {
TrackerProperty *prop;
prop = tracker_ontologies_get_property_by_uri (subject);
......@@ -1962,7 +1956,7 @@ tracker_data_ontology_process_statement (const gchar *graph,
if (prop && tracker_property_get_is_new (prop) != in_update) {
return;
}
} else if (g_strcmp0 (predicate, TRACKER_PREFIX "prefix") == 0) {
} else if (g_strcmp0 (predicate, TRACKER_PREFIX_TRACKER "prefix") == 0) {
TrackerNamespace *namespace;
namespace = tracker_ontologies_get_namespace_by_uri (subject);
......
......@@ -25,8 +25,8 @@
#include <glib.h>
#include <libtracker-common/tracker-language.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-common/tracker-common.h>
#include <libtracker-sparql/tracker-sparql.h>
#include <libtracker-data/tracker-data-update.h>
#include <libtracker-data/tracker-db-interface.h>
......
......@@ -25,12 +25,8 @@
#include <math.h>
#include <time.h>
#include <libtracker-common/tracker-date-time.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-common/tracker-utils.h>
#include <libtracker-miner/tracker-miner-common.h>
#include <libtracker-common/tracker-common.h>
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-class.h"
#include "tracker-data-manager.h"
......@@ -43,15 +39,6 @@
#include "tracker-property.h"
#include "tracker-sparql-query.h"
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDFS_PREFIX TRACKER_RDFS_PREFIX
#define TRACKER_PREFIX TRACKER_TRACKER_PREFIX
#define NAO_PREFIX TRACKER_NAO_PREFIX
#define NAO_LAST_MODIFIED NAO_PREFIX "lastModified"
#define RDF_PREFIX TRACKER_RDF_PREFIX
#define RDF_PROPERTY RDF_PREFIX "Property"
#define RDF_TYPE RDF_PREFIX "type"
typedef struct _TrackerDataUpdateBuffer TrackerDataUpdateBuffer;
typedef struct _TrackerDataUpdateBufferResource TrackerDataUpdateBufferResource;
typedef struct _TrackerDataUpdateBufferPredicate TrackerDataUpdateBufferPredicate;
......@@ -1811,11 +1798,11 @@ delete_first_object (TrackerProperty *field,
#ifndef DISABLE_JOURNAL
if (!in_journal_replay && change && !tracker_property_get_transient (field)) {
if (!tracker_property_get_force_journal (field) &&
g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
g_strcmp0 (graph, TRACKER_OWN_GRAPH_URN) == 0) {
/* do not journal this statement extracted from filesystem */
TrackerProperty *damaged;
damaged = tracker_ontologies_get_property_by_uri (TRACKER_TRACKER_PREFIX "damaged");
damaged = tracker_ontologies_get_property_by_uri (TRACKER_PREFIX_TRACKER "damaged");
tracker_db_journal_append_insert_statement (graph_id,
resource_buffer->id,
......@@ -2082,7 +2069,7 @@ cache_delete_resource_type_full (TrackerClass *class,
if (!single_type) {
if (!HAVE_TRACKER_FTS &&
strcmp (tracker_class_get_uri (class), RDFS_PREFIX "Resource") == 0 &&
strcmp (tracker_class_get_uri (class), TRACKER_PREFIX_RDFS "Resource") == 0 &&
g_hash_table_size (resource_buffer->tables) == 0) {
/* skip subclass query when deleting whole resource
to improve performance */
......@@ -2369,7 +2356,7 @@ tracker_data_delete_statement (const gchar *graph,
resource_buffer_switch (graph, 0, subject, subject_id);
if (object && g_strcmp0 (predicate, RDF_PREFIX "type") == 0) {
if (object && g_strcmp0 (predicate, TRACKER_PREFIX_RDF "type") == 0) {
class = tracker_ontologies_get_class_by_uri (object);
if (class != NULL) {
has_persistent = TRUE;
......@@ -2423,11 +2410,11 @@ tracker_data_delete_statement (const gchar *graph,
#ifndef DISABLE_JOURNAL
if (!tracker_property_get_force_journal (field) &&
g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
g_strcmp0 (graph, TRACKER_OWN_GRAPH_URN) == 0) {
/* do not journal this statement extracted from filesystem */
TrackerProperty *damaged;
damaged = tracker_ontologies_get_property_by_uri (TRACKER_TRACKER_PREFIX "damaged");
damaged = tracker_ontologies_get_property_by_uri (TRACKER_PREFIX_TRACKER "damaged");
tracker_db_journal_append_insert_statement (graph_id,
resource_buffer->id,
......@@ -2854,11 +2841,11 @@ tracker_data_insert_statement_with_string (const gchar *graph,
pred_id = (pred_id != 0) ? pred_id : tracker_data_query_resource_id (predicate);
}
if (!tracker_property_get_force_journal (property) &&
g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
g_strcmp0 (graph, TRACKER_OWN_GRAPH_URN) == 0) {
/* do not journal this statement extracted from filesystem */
TrackerProperty *damaged;
damaged = tracker_ontologies_get_property_by_uri (TRACKER_TRACKER_PREFIX "damaged");
damaged = tracker_ontologies_get_property_by_uri (TRACKER_PREFIX_TRACKER "damaged");
tracker_db_journal_append_insert_statement (graph_id,
resource_buffer->id,
tracker_property_get_id (damaged),
......@@ -3199,11 +3186,11 @@ tracker_data_update_statement_with_string (const gchar *graph,
pred_id = (pred_id != 0) ? pred_id : tracker_data_query_resource_id (predicate);
}
if (!tracker_property_get_force_journal (property) &&
g_strcmp0 (graph, TRACKER_MINER_FS_GRAPH_URN) == 0) {
g_strcmp0 (graph, TRACKER_OWN_GRAPH_URN) == 0) {
/* do not journal this statement extracted from filesystem */
TrackerProperty *damaged;
damaged = tracker_ontologies_get_property_by_uri (TRACKER_TRACKER_PREFIX "damaged");
damaged = tracker_ontologies_get_property_by_uri (TRACKER_PREFIX_TRACKER "damaged");
tracker_db_journal_append_update_statement (graph_id,
resource_buffer->id,
tracker_property_get_id (damaged),
......
......@@ -24,7 +24,7 @@
#include <glib.h>
#include <gio/gio.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-db-interface.h"
......
......@@ -27,7 +27,8 @@
#include <gvdb/gvdb-builder.h>
#include <gvdb/gvdb-reader.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-ontologies.h"
......@@ -330,7 +331,7 @@ tracker_ontologies_add_property (TrackerProperty *field)
uri = tracker_property_get_uri (field);
if (g_strcmp0 (uri, TRACKER_RDF_PREFIX "type") == 0) {
if (g_strcmp0 (uri, TRACKER_PREFIX_RDF "type") == 0) {
if (rdf_type) {
g_object_unref (rdf_type);
}
......
......@@ -24,18 +24,18 @@
#include <glib.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-namespace.h"
#include "tracker-ontologies.h"
#include "tracker-property.h"
#define XSD_BOOLEAN TRACKER_XSD_PREFIX "boolean"
#define XSD_DATE TRACKER_XSD_PREFIX "date"
#define XSD_DATETIME TRACKER_XSD_PREFIX "dateTime"
#define XSD_DOUBLE TRACKER_XSD_PREFIX "double"
#define XSD_INTEGER TRACKER_XSD_PREFIX "integer"
#define XSD_STRING TRACKER_XSD_PREFIX "string"
#define XSD_BOOLEAN TRACKER_PREFIX_XSD "boolean"
#define XSD_DATE TRACKER_PREFIX_XSD "date"
#define XSD_DATETIME TRACKER_PREFIX_XSD "dateTime"
#define XSD_DOUBLE TRACKER_PREFIX_XSD "double"
#define XSD_INTEGER TRACKER_PREFIX_XSD "integer"
#define XSD_STRING TRACKER_PREFIX_XSD "string"
#define GET_PRIV(obj) (((TrackerProperty*) obj)->priv)
#define TRACKER_PROPERTY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_PROPERTY, TrackerPropertyPrivate))
......
......@@ -94,7 +94,6 @@ libtracker_minerinclude_HEADERS = \
tracker-enumerator.h \
tracker-indexing-tree.h \
tracker-miner.h \
tracker-miner-common.h \
tracker-miner-enums.h \
tracker-miner-enum-types.h \
tracker-miner-object.h \
......
......@@ -20,8 +20,8 @@
#include <glib.h>
#include <libtracker-common/tracker-ontologies.h>
#include <libtracker-common/tracker-storage.h>
#include <libtracker-common/tracker-common.h>
#include <libtracker-sparql/tracker-sparql.h>
#include "tracker-decorator-fs.h"