[tracker/rss-enclosures] libtracker-data: Add test case for ORDER BY property function



commit cd78c9cf8be3862e457ab0d4576fac857b99e31c
Author: Jürg Billeter <j bitron ch>
Date:   Tue Oct 5 18:21:39 2010 +0200

    libtracker-data: Add test case for ORDER BY property function

 tests/libtracker-data/sort/Makefile.am          |    6 +++++-
 tests/libtracker-data/sort/data-sort-5.ontology |   22 ++++++++++++++++++++++
 tests/libtracker-data/sort/data-sort-5.ttl      |   23 +++++++++++++++++++++++
 tests/libtracker-data/sort/query-sort-8.out     |    8 ++++++++
 tests/libtracker-data/sort/query-sort-8.rq      |    4 ++++
 tests/libtracker-data/tracker-sparql-test.c     |    1 +
 6 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-data/sort/Makefile.am b/tests/libtracker-data/sort/Makefile.am
index e35db6f..9f3cfd6 100644
--- a/tests/libtracker-data/sort/Makefile.am
+++ b/tests/libtracker-data/sort/Makefile.am
@@ -7,6 +7,8 @@ EXTRA_DIST = 			\
 	data-sort-3.ttl		\
 	data-sort-4.ontology	\
 	data-sort-4.ttl		\
+	data-sort-5.ontology	\
+	data-sort-5.ttl		\
 	query-sort-1.out	\
 	query-sort-1.rq		\
 	query-sort-2.out	\
@@ -20,4 +22,6 @@ EXTRA_DIST = 			\
 	query-sort-6.rq		\
 	query-sort-6.out	\
 	query-sort-7.rq		\
-	query-sort-7.out
+	query-sort-7.out	\
+	query-sort-8.rq		\
+	query-sort-8.out
diff --git a/tests/libtracker-data/sort/data-sort-5.ontology b/tests/libtracker-data/sort/data-sort-5.ontology
new file mode 100644
index 0000000..7d2e029
--- /dev/null
+++ b/tests/libtracker-data/sort/data-sort-5.ontology
@@ -0,0 +1,22 @@
+ prefix foaf: <http://xmlns.com/foaf/0.1/> .
+ prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+ prefix owl: <http://www.w3.org/2002/07/owl#> .
+ 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#> .
+
+foaf: a tracker:Namespace ;
+	tracker:prefix "foaf" .
+
+owl: a tracker:Namespace ;
+	tracker:prefix "owl" .
+
+owl:Thing a rdfs:Class ;
+	rdfs:subClassOf rdfs:Resource .
+
+foaf:name a rdf:Property ;
+	nrl:maxCardinality 1 ;
+	rdfs:domain owl:Thing ;
+	rdfs:range xsd:string .
+
diff --git a/tests/libtracker-data/sort/data-sort-5.ttl b/tests/libtracker-data/sort/data-sort-5.ttl
new file mode 100755
index 0000000..d0b6611
--- /dev/null
+++ b/tests/libtracker-data/sort/data-sort-5.ttl
@@ -0,0 +1,23 @@
+ prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ prefix foaf:       <http://xmlns.com/foaf/0.1/> .
+ prefix owl: <http://www.w3.org/2002/07/owl#> .
+
+_:a a owl:Thing .
+_:b a owl:Thing .
+_:c a owl:Thing .
+_:e a owl:Thing .
+
+_:a2 a owl:Thing .
+_:b2 a owl:Thing .
+_:c2 a owl:Thing .
+_:e2 a owl:Thing .
+
+_:a foaf:name "Eve".
+_:b foaf:name "Alice" .
+_:c foaf:name "Fred" .
+_:e foaf:name "Bob" .
+
+_:a2 foaf:name "eve".
+_:b2 foaf:name "alice" .
+_:c2 foaf:name "fred" .
+_:e2 foaf:name "bob" .
diff --git a/tests/libtracker-data/sort/query-sort-8.out b/tests/libtracker-data/sort/query-sort-8.out
new file mode 100644
index 0000000..754fb7f
--- /dev/null
+++ b/tests/libtracker-data/sort/query-sort-8.out
@@ -0,0 +1,8 @@
+"alice"
+"Alice"
+"bob"
+"Bob"
+"eve"
+"Eve"
+"fred"
+"Fred"
diff --git a/tests/libtracker-data/sort/query-sort-8.rq b/tests/libtracker-data/sort/query-sort-8.rq
new file mode 100644
index 0000000..f34f69d
--- /dev/null
+++ b/tests/libtracker-data/sort/query-sort-8.rq
@@ -0,0 +1,4 @@
+PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
+SELECT ?name
+WHERE { ?x foaf:name ?name }
+ORDER BY foaf:name(?x)
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 0380e56..0a7af1e 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -106,6 +106,7 @@ const TestInfo tests[] = {
 	{ "sort/query-sort-5", "sort/data-sort-4", FALSE },
 	{ "sort/query-sort-6", "sort/data-sort-4", FALSE },
 	{ "sort/query-sort-7", "sort/data-sort-1", FALSE },
+	{ "sort/query-sort-8", "sort/data-sort-5", FALSE },
 	{ "subqueries/subqueries-1", "subqueries/data-1", FALSE },
 	{ "subqueries/subqueries-union-1", "subqueries/data-1", FALSE },
 	{ "subqueries/subqueries-union-2", "subqueries/data-1", FALSE },



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