[tracker/sparql-refactor: 11/16] libtracker-data: Add second predicate variable test



commit 090e0902ce4408ed41c5aba104bbca907c0726a5
Author: Jürg Billeter <j bitron ch>
Date:   Tue Mar 30 17:06:22 2010 +0200

    libtracker-data: Add second predicate variable test

 tests/libtracker-data/basic/Makefile.am            |   16 +++++++++-------
 tests/libtracker-data/basic/data-1.ontology        |    2 +-
 tests/libtracker-data/basic/data-1.ttl             |    8 +++-----
 .../libtracker-data/basic/predicate-variable-2.out |    2 ++
 .../libtracker-data/basic/predicate-variable-2.rq  |    4 ++++
 tests/libtracker-data/basic/predicate-variable.out |    2 +-
 tests/libtracker-data/tracker-sparql-test.c        |    1 +
 7 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/tests/libtracker-data/basic/Makefile.am b/tests/libtracker-data/basic/Makefile.am
index cd7b1dc..b0f3265 100644
--- a/tests/libtracker-data/basic/Makefile.am
+++ b/tests/libtracker-data/basic/Makefile.am
@@ -1,10 +1,12 @@
 include $(top_srcdir)/Makefile.decl
 
-EXTRA_DIST = 	 	\
-	base-prefix-3.out	\
-	base-prefix-3.rq	\
-	data-1.ontology	\
-	data-1.ttl	\
-	predicate-variable.out	\
-	predicate-variable.rq
+EXTRA_DIST =                     \
+	base-prefix-3.out        \
+	base-prefix-3.rq         \
+	data-1.ontology          \
+	data-1.ttl               \
+	predicate-variable.out   \
+	predicate-variable.rq    \
+	predicate-variable-2.out \
+	predicate-variable-2.rq
 
diff --git a/tests/libtracker-data/basic/data-1.ontology b/tests/libtracker-data/basic/data-1.ontology
index 47752d6..bdaad6b 100644
--- a/tests/libtracker-data/basic/data-1.ontology
+++ b/tests/libtracker-data/basic/data-1.ontology
@@ -27,7 +27,7 @@ ns:p a rdf:Property ;
 
 x:p a rdf:Property ;
 	rdfs:domain x:A ;
-	rdfs:range xsd:string .
+	rdfs:range xsd:integer .
 
 z:p a rdf:Property ;
 	rdfs:domain z:A ;
diff --git a/tests/libtracker-data/basic/data-1.ttl b/tests/libtracker-data/basic/data-1.ttl
index 8a4c14f..08e1add 100755
--- a/tests/libtracker-data/basic/data-1.ttl
+++ b/tests/libtracker-data/basic/data-1.ttl
@@ -2,9 +2,7 @@
 @prefix x:  <http://example.org/x/> .
 @prefix z:  <http://example.org/x/#> .
 
-x:x a x:A .
+x:x a x:A, z:A .
 x:x ns:p  "d:x ns:p" .
-x:x x:p   "x:x x:p" .
-
-z:x a z:A .
-z:x z:p   "z:x z:p" .
+x:x x:p   42 .
+x:x z:p   "z:x z:p" .
diff --git a/tests/libtracker-data/basic/predicate-variable-2.out b/tests/libtracker-data/basic/predicate-variable-2.out
new file mode 100644
index 0000000..48c4bd0
--- /dev/null
+++ b/tests/libtracker-data/basic/predicate-variable-2.out
@@ -0,0 +1,2 @@
+"http://example.org/ns#p";	"d:x ns:p"
+"http://example.org/x/#p";	"z:x z:p"
diff --git a/tests/libtracker-data/basic/predicate-variable-2.rq b/tests/libtracker-data/basic/predicate-variable-2.rq
new file mode 100644
index 0000000..918654c
--- /dev/null
+++ b/tests/libtracker-data/basic/predicate-variable-2.rq
@@ -0,0 +1,4 @@
+PREFIX ns: <http://example.org/ns#>
+PREFIX x:  <http://example.org/x/>
+
+SELECT ?p ?v WHERE { x:x ?p ?v . ?p rdfs:range xsd:string } ORDER BY ?p ?v
diff --git a/tests/libtracker-data/basic/predicate-variable.out b/tests/libtracker-data/basic/predicate-variable.out
index aa5651c..377c994 100644
--- a/tests/libtracker-data/basic/predicate-variable.out
+++ b/tests/libtracker-data/basic/predicate-variable.out
@@ -1,2 +1,2 @@
 "http://example.org/ns#p";	"d:x ns:p"
-"http://example.org/x/p";	"x:x x:p"
+"http://example.org/x/p";	"42"
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index efd0cc6..861a53b 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -57,6 +57,7 @@ const TestInfo tests[] = {
 	{ "anon/query", "anon/data", FALSE },
 	{ "basic/base-prefix-3", "basic/data-1", FALSE },
 	{ "basic/predicate-variable", "basic/data-1", FALSE },
+	{ "basic/predicate-variable-2", "basic/data-1", FALSE },
 	{ "bnode-coreference/query", "bnode-coreference/data", FALSE },
 	{ "bound/bound1", "bound/data", FALSE },
 	{ "datetime/delete-1", "datetime/data-3", FALSE },



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