[tracker] libtracker-data: Add insert-delete-insert test for named graphs



commit e80a2fb8e47362257faae14639a01dd7dd0339e5
Author: Jürg Billeter <j bitron ch>
Date:   Tue Feb 16 08:22:55 2010 +0100

    libtracker-data: Add insert-delete-insert test for named graphs

 tests/libtracker-data/graph/Makefile.am     |    6 +++++-
 tests/libtracker-data/graph/data-2.ontology |   16 ++++++++++++++++
 tests/libtracker-data/graph/data-2.rq       |   11 +++++++++++
 tests/libtracker-data/graph/graph-2.out     |    1 +
 tests/libtracker-data/graph/graph-2.rq      |    5 +++++
 tests/libtracker-data/tracker-sparql-test.c |    1 +
 6 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-data/graph/Makefile.am b/tests/libtracker-data/graph/Makefile.am
index 74c152e..6bc5c11 100644
--- a/tests/libtracker-data/graph/Makefile.am
+++ b/tests/libtracker-data/graph/Makefile.am
@@ -3,5 +3,9 @@ include $(top_srcdir)/Makefile.decl
 EXTRA_DIST = 		\
 	data-1.ontology	\
 	data-1.rq	\
+	data-2.ontology	\
+	data-2.rq	\
 	graph-1.out	\
-	graph-1.rq
+	graph-1.rq	\
+	graph-2.out	\
+	graph-2.rq
diff --git a/tests/libtracker-data/graph/data-2.ontology b/tests/libtracker-data/graph/data-2.ontology
new file mode 100644
index 0000000..e831f2a
--- /dev/null
+++ b/tests/libtracker-data/graph/data-2.ontology
@@ -0,0 +1,16 @@
+ 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#> .
+
+example: a tracker:Namespace ;
+	tracker:prefix "example" .
+
+example:A a rdfs:Class ;
+	rdfs:subClassOf rdfs:Resource .
+
+example:p a rdf:Property ;
+	rdfs:domain example:A ;
+	rdfs:range xsd:integer .
+
diff --git a/tests/libtracker-data/graph/data-2.rq b/tests/libtracker-data/graph/data-2.rq
new file mode 100644
index 0000000..d5e6441
--- /dev/null
+++ b/tests/libtracker-data/graph/data-2.rq
@@ -0,0 +1,11 @@
+INSERT INTO example:graphA {
+	example:resource a example:A ;
+		example:p 42
+}
+DELETE {
+	example:resource example:p 42
+}
+INSERT INTO example:graphB {
+	example:resource a example:A ;
+		example:p 42
+}
diff --git a/tests/libtracker-data/graph/graph-2.out b/tests/libtracker-data/graph/graph-2.out
new file mode 100644
index 0000000..cf0a28d
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-2.out
@@ -0,0 +1 @@
+"http://example/graphB";	"http://example/resource";
diff --git a/tests/libtracker-data/graph/graph-2.rq b/tests/libtracker-data/graph/graph-2.rq
new file mode 100644
index 0000000..b2464d2
--- /dev/null
+++ b/tests/libtracker-data/graph/graph-2.rq
@@ -0,0 +1,5 @@
+SELECT ?g ?s WHERE {
+	GRAPH ?g {
+		?s example:p 42
+	}
+}
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index d89c2f0..caa0902 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -70,6 +70,7 @@ const TestInfo tests[] = {
 	{ "functions/functions-xpath-1", "functions/data-1", FALSE },
 	{ "functions/functions-xpath-2", "functions/data-1", FALSE },
 	{ "graph/graph-1", "graph/data-1", FALSE },
+	{ "graph/graph-2", "graph/data-2", FALSE },
 	{ "optional/q-opt-complex-1", "optional/complex-data-1", FALSE },
 	{ "regex/regex-query-001", "regex/regex-data-01", FALSE },
 	{ "regex/regex-query-002", "regex/regex-data-01", FALSE },



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