[tracker/domain-specific-indexes-review: 20/21] tests/libtracker-data: Added some more domainIndex tests
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/domain-specific-indexes-review: 20/21] tests/libtracker-data: Added some more domainIndex tests
- Date: Wed, 14 Jul 2010 12:56:43 +0000 (UTC)
commit 1ea1be81369180e6caed3725fb8de51731b8c8ef
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Jul 14 10:43:31 2010 +0200
tests/libtracker-data: Added some more domainIndex tests
tests/libtracker-data/change/change-test-3.out | 3 +
tests/libtracker-data/change/change-test-3.rq | 3 +
.../change/source/99-example.ontology.v2 | 4 ++
.../change/source/99-example.ontology.v3 | 3 +
.../change/source/99-example.ontology.v4 | 5 ++
.../change/source/99-example.ontology.v5 | 1 +
.../change/source/99-example.ontology.v6 | 1 +
.../change/source/99-example.ontology.v7 | 55 ++++++++++++++++++++
tests/libtracker-data/tracker-ontology-test.c | 9 ++--
9 files changed, 80 insertions(+), 4 deletions(-)
---
diff --git a/tests/libtracker-data/change/change-test-3.out b/tests/libtracker-data/change/change-test-3.out
new file mode 100644
index 0000000..f0ceea2
--- /dev/null
+++ b/tests/libtracker-data/change/change-test-3.out
@@ -0,0 +1,3 @@
+"1"
+~
+"2"
diff --git a/tests/libtracker-data/change/change-test-3.rq b/tests/libtracker-data/change/change-test-3.rq
new file mode 100644
index 0000000..4e8f2fb
--- /dev/null
+++ b/tests/libtracker-data/change/change-test-3.rq
@@ -0,0 +1,3 @@
+select ?s1 { <a02> example:single1 ?s1 }
+~
+select ?s2 { <a02> example:single2 ?s2 }
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v2 b/tests/libtracker-data/change/source/99-example.ontology.v2
index 10bdbb2..5f93fec 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v2
+++ b/tests/libtracker-data/change/source/99-example.ontology.v2
@@ -9,12 +9,16 @@ example: a tracker:Namespace, tracker:Ontology ;
nao:lastModified "2010-03-23T11:00:02Z" ;
tracker:prefix "example" .
+# Creation of a class
example:A a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+# Creation of a class
example:B a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+# Creation of a property at the same time of creation of a the classes in domain
+# and range
example:b a rdf:Property ;
rdfs:domain example:A ;
rdfs:range example:B ;
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v3 b/tests/libtracker-data/change/source/99-example.ontology.v3
index 5048df1..bd7f0c5 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v3
+++ b/tests/libtracker-data/change/source/99-example.ontology.v3
@@ -20,14 +20,17 @@ example:b a rdf:Property ;
rdfs:domain example:A ;
rdfs:range example:B .
+# Creation of a property
example:i1 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer .
+# Creation of a property
example:i2 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer .
+# Creation of a property
example:single1 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer ;
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v4 b/tests/libtracker-data/change/source/99-example.ontology.v4
index 84ce7a2..0a6f9b9 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v4
+++ b/tests/libtracker-data/change/source/99-example.ontology.v4
@@ -13,6 +13,7 @@ example: a tracker:Namespace, tracker:Ontology ;
example:A a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+# Creation of a class
example:DomA a rdfs:Class ;
rdfs:subClassOf example:A .
@@ -31,22 +32,26 @@ example:i2 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer .
+# Index change of a property
example:single1 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer ;
nrl:maxCardinality 1 ;
tracker:indexed false .
+# Creation of a property
example:single2 a rdf:Property ;
rdfs:domain example:A ;
rdfs:range xsd:integer ;
nrl:maxCardinality 1 ;
tracker:indexed false .
+# Creation of a property
example:ib a rdf:Property ;
rdfs:domain example:B ;
rdfs:range xsd:integer .
+# Creation of a property
example:sb a rdf:Property ;
rdfs:domain example:B ;
rdfs:range xsd:string .
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v5 b/tests/libtracker-data/change/source/99-example.ontology.v5
index 4229990..453da6c 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v5
+++ b/tests/libtracker-data/change/source/99-example.ontology.v5
@@ -13,6 +13,7 @@ example: a tracker:Namespace, tracker:Ontology ;
example:A a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+# Adding two domainIndexes to a class
example:DomA a rdfs:Class ;
tracker:domainIndex example:single1, example:single2 ;
rdfs:subClassOf example:A .
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v6 b/tests/libtracker-data/change/source/99-example.ontology.v6
index 5b12426..c31c03e 100644
--- a/tests/libtracker-data/change/source/99-example.ontology.v6
+++ b/tests/libtracker-data/change/source/99-example.ontology.v6
@@ -13,6 +13,7 @@ example: a tracker:Namespace, tracker:Ontology ;
example:A a rdfs:Class ;
rdfs:subClassOf rdfs:Resource .
+# We remove a domainIndex
example:DomA a rdfs:Class ;
tracker:domainIndex example:single2 ;
rdfs:subClassOf example:A .
diff --git a/tests/libtracker-data/change/source/99-example.ontology.v7 b/tests/libtracker-data/change/source/99-example.ontology.v7
new file mode 100644
index 0000000..c31c03e
--- /dev/null
+++ b/tests/libtracker-data/change/source/99-example.ontology.v7
@@ -0,0 +1,55 @@
+ prefix example: <http://example/> .
+ prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+ prefix tracker: <http://www.tracker-project.org/ontologies/tracker#> .
+ prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+ prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
+ prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+
+example: a tracker:Namespace, tracker:Ontology ;
+ nao:lastModified "2010-03-23T11:00:06Z" ;
+ tracker:prefix "example" .
+
+example:A a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+# We remove a domainIndex
+example:DomA a rdfs:Class ;
+ tracker:domainIndex example:single2 ;
+ rdfs:subClassOf example:A .
+
+example:B a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+example:b a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range example:B .
+
+example:i1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:i2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer .
+
+example:single1 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:single2 a rdf:Property ;
+ rdfs:domain example:A ;
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality 1 ;
+ tracker:indexed false .
+
+example:ib a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:integer .
+
+example:sb a rdf:Property ;
+ rdfs:domain example:B ;
+ rdfs:range xsd:string .
+
diff --git a/tests/libtracker-data/change/updates/99-example.queries.v7 b/tests/libtracker-data/change/updates/99-example.queries.v7
new file mode 100644
index 0000000..e69de29
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 1776e16..b49109d 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -99,6 +99,7 @@ const ChangeInfo changes[] = {
{ "99-example.ontology.v4", "99-example.queries.v4", NULL, NULL },
{ "99-example.ontology.v5", "99-example.queries.v5", "change/change-test-1", NULL },
{ "99-example.ontology.v6", "99-example.queries.v6", "change/change-test-2", NULL },
+ { "99-example.ontology.v7", "99-example.queries.v7", "change/change-test-3", NULL },
{ NULL }
};
@@ -198,7 +199,7 @@ query_helper (const gchar *query_filename, const gchar *results_filename)
g_object_unref (result_set);
}
- query = strtok (NULL, "~");
+ query = strtok (NULL, "~");
}
if (strcmp (results, test_results->str)) {
@@ -351,7 +352,7 @@ test_ontology_change (void)
g_free (test_schemas[0]);
g_free (test_schemas[1]);
g_free (test_schemas[2]);
- g_free (build_prefix);
+ g_free (build_prefix);
g_free (prefix);
}
@@ -448,7 +449,7 @@ main (int argc, char **argv)
g_test_init (&argc, &argv, NULL);
- data_dir = g_build_filename (g_get_current_dir (), "test-cache", NULL);
+ data_dir = g_build_filename (g_get_current_dir (), "test-cache", NULL);
g_setenv ("XDG_DATA_HOME", data_dir, TRUE);
g_setenv ("XDG_CACHE_HOME", data_dir, TRUE);
@@ -490,7 +491,7 @@ main (int argc, char **argv)
g_spawn_command_line_sync ("rm -R tracker/", NULL, NULL, NULL, NULL);
g_spawn_command_line_sync ("rm -R test-cache/", NULL, NULL, NULL, NULL);
- g_free (data_dir);
+ g_free (data_dir);
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]