[tracker/parser] libtracker-data: Add optional/q-opt-complex-1 test
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] libtracker-data: Add optional/q-opt-complex-1 test
- Date: Fri, 14 Aug 2009 13:38:40 +0000 (UTC)
commit 401a559d0340a9c2485d119b77cdcd0adccfe7ed
Author: Jürg Billeter <j bitron ch>
Date: Fri Aug 14 14:49:11 2009 +0200
libtracker-data: Add optional/q-opt-complex-1 test
configure.ac | 1 +
tests/libtracker-data/Makefile.am | 1 +
tests/libtracker-data/optional/Makefile.am | 8 ++++
.../optional/complex-data-1.ontology | 36 ++++++++++++++++++++
tests/libtracker-data/optional/complex-data-1.ttl | 21 +++++++++++
tests/libtracker-data/optional/q-opt-complex-1.out | 2 +
tests/libtracker-data/optional/q-opt-complex-1.rq | 11 ++++++
tests/libtracker-data/tracker-sparql-test.c | 1 +
8 files changed, 81 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2a40912..ca8cd2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1432,6 +1432,7 @@ AC_CONFIG_FILES([
tests/libtracker-data/expr-ops/Makefile
tests/libtracker-data/nie/Makefile
tests/libtracker-data/nmo/Makefile
+ tests/libtracker-data/optional/Makefile
tests/libtracker-data/regex/Makefile
tests/libtracker-data/sort/Makefile
tests/libtracker-db/Makefile
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index 5c16de2..fa46894 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -7,6 +7,7 @@ SUBDIRS = \
expr-ops \
nie \
nmo \
+ optional \
regex \
sort
diff --git a/tests/libtracker-data/optional/Makefile.am b/tests/libtracker-data/optional/Makefile.am
new file mode 100644
index 0000000..0f534fb
--- /dev/null
+++ b/tests/libtracker-data/optional/Makefile.am
@@ -0,0 +1,8 @@
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST = \
+ complex-data-1.ontology \
+ complex-data-1.ttl \
+ q-opt-complex-1.out \
+ q-opt-complex-1.rq
+
diff --git a/tests/libtracker-data/optional/complex-data-1.ontology b/tests/libtracker-data/optional/complex-data-1.ontology
new file mode 100644
index 0000000..7babe91
--- /dev/null
+++ b/tests/libtracker-data/optional/complex-data-1.ontology
@@ -0,0 +1,36 @@
+ prefix foaf: <http://xmlns.com/foaf/0.1/> .
+ 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" .
+
+foaf:Person a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+foaf:mbox a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range rdfs:Resource .
+
+foaf:name a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range xsd:string .
+
+foaf:nick a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range xsd:string .
+
+foaf:firstName a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range xsd:string .
+
+foaf:depiction a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range rdfs:Resource .
+
+foaf:isPrimaryTopicOf a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range rdfs:Resource .
+
diff --git a/tests/libtracker-data/optional/complex-data-1.ttl b/tests/libtracker-data/optional/complex-data-1.ttl
new file mode 100644
index 0000000..48df4d9
--- /dev/null
+++ b/tests/libtracker-data/optional/complex-data-1.ttl
@@ -0,0 +1,21 @@
+ prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+<tag:alice example:foafUri> a foaf:Person;
+ foaf:mbox <mailto:alice example net>;
+ foaf:name "Alice";
+ foaf:nick "WhoMe?";
+ foaf:depiction <http://example.com/alice.png> .
+
+<tag:bert example:foafUri> a foaf:Person;
+ foaf:mbox <mailto:bert example net> ;
+ foaf:nick "BigB" ;
+ foaf:name "Bert" .
+
+<tag:eve example:foafUri> a foaf:Person;
+ foaf:mbox <mailto:eve example net> ;
+ foaf:firstName "Eve" .
+
+<tag:john example:foafUri> a foaf:Person;
+ foaf:mbox <mailto:john example net> ;
+ foaf:nick "jDoe";
+ foaf:isPrimaryTopicOf <http://example.com/people/johnDoe> .
diff --git a/tests/libtracker-data/optional/q-opt-complex-1.out b/tests/libtracker-data/optional/q-opt-complex-1.out
new file mode 100644
index 0000000..9fc8d6d
--- /dev/null
+++ b/tests/libtracker-data/optional/q-opt-complex-1.out
@@ -0,0 +1,2 @@
+"tag:alice example:foafUri" "WhoMe?" "http://example.com/alice.png" "Alice"
+"tag:john example:foafUri" "jDoe" "http://example.com/people/johnDoe"
diff --git a/tests/libtracker-data/optional/q-opt-complex-1.rq b/tests/libtracker-data/optional/q-opt-complex-1.rq
new file mode 100644
index 0000000..1b91d97
--- /dev/null
+++ b/tests/libtracker-data/optional/q-opt-complex-1.rq
@@ -0,0 +1,11 @@
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+SELECT ?person ?nick ?page ?img ?name ?firstN
+{
+ ?person foaf:nick ?nick
+ OPTIONAL { ?person foaf:isPrimaryTopicOf ?page }
+ OPTIONAL {
+ ?person foaf:name ?name
+ { ?person foaf:depiction ?img } UNION
+ { ?person foaf:firstName ?firstN }
+ } FILTER ( bound(?page) || bound(?img) || bound(?firstN) )
+}
\ No newline at end of file
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 498ab75..48f7885 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -59,6 +59,7 @@ const TestInfo tests[] = {
{ "expr-ops/query-plus-1", "expr-ops/data" },
{ "expr-ops/query-unminus-1", "expr-ops/data" },
{ "expr-ops/query-unplus-1", "expr-ops/data" },
+ { "optional/q-opt-complex-1", "optional/complex-data-1" },
{ "regex/regex-query-001", "regex/regex-data-01" },
{ "regex/regex-query-002", "regex/regex-data-01" },
{ "sort/query-sort-1", "sort/data-sort-1" },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]