[tracker] libtracker-data: Add test for anonymous blank nodes
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Add test for anonymous blank nodes
- Date: Thu, 18 Mar 2010 11:12:24 +0000 (UTC)
commit 0d0f6d606774f4d3792fe6bb24f4dfab786f6996
Author: Jürg Billeter <j bitron ch>
Date: Thu Mar 18 12:09:44 2010 +0100
libtracker-data: Add test for anonymous blank nodes
configure.ac | 1 +
tests/libtracker-data/Makefile.am | 1 +
tests/libtracker-data/anon/Makefile.am | 7 +++++
tests/libtracker-data/anon/data.ontology | 34 +++++++++++++++++++++++++++
tests/libtracker-data/anon/data.ttl | 32 +++++++++++++++++++++++++
tests/libtracker-data/anon/query.out | 2 +
tests/libtracker-data/anon/query.rq | 8 ++++++
tests/libtracker-data/tracker-sparql-test.c | 1 +
8 files changed, 86 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dd8e544..4ea52d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1667,6 +1667,7 @@ AC_CONFIG_FILES([
tests/libtracker-data/Makefile
tests/libtracker-data/aggregates/Makefile
tests/libtracker-data/algebra/Makefile
+ tests/libtracker-data/anon/Makefile
tests/libtracker-data/bnode-coreference/Makefile
tests/libtracker-data/bound/Makefile
tests/libtracker-data/datetime/Makefile
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index 275b943..f8b7355 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = \
aggregates \
algebra \
+ anon \
bnode-coreference \
bound \
datetime \
diff --git a/tests/libtracker-data/anon/Makefile.am b/tests/libtracker-data/anon/Makefile.am
new file mode 100644
index 0000000..3f91c58
--- /dev/null
+++ b/tests/libtracker-data/anon/Makefile.am
@@ -0,0 +1,7 @@
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST = \
+ data.ontology \
+ data.ttl \
+ query.out \
+ query.rq
diff --git a/tests/libtracker-data/anon/data.ontology b/tests/libtracker-data/anon/data.ontology
new file mode 100644
index 0000000..de0a07b
--- /dev/null
+++ b/tests/libtracker-data/anon/data.ontology
@@ -0,0 +1,34 @@
+ 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:Agent a rdfs:Class ;
+ rdfs:subClassOf rdfs:Resource .
+
+foaf:Person a rdfs:Class ;
+ rdfs:subClassOf foaf:Agent .
+
+foaf:Group a rdfs:Class ;
+ rdfs:subClassOf foaf:Agent .
+
+foaf:knows a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range foaf:Person .
+
+foaf:mbox a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range rdfs:Resource .
+
+foaf:name a rdf:Property ;
+ rdfs:domain foaf:Agent ;
+ rdfs:range xsd:string .
+
+foaf:member a rdf:Property ;
+ rdfs:domain foaf:Person ;
+ rdfs:range foaf:Group .
+
diff --git a/tests/libtracker-data/anon/data.ttl b/tests/libtracker-data/anon/data.ttl
new file mode 100755
index 0000000..5088a80
--- /dev/null
+++ b/tests/libtracker-data/anon/data.ttl
@@ -0,0 +1,32 @@
+ 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#> .
+
+_:alice
+ rdf:type foaf:Person ;
+ foaf:name "Alice" ;
+ foaf:mbox <mailto:alice work> ;
+ foaf:knows _:bob ;
+ foaf:member [ a foaf:Group ; foaf:name "Foo" ] ;
+ .
+
+_:bob
+ rdf:type foaf:Person ;
+ foaf:name "Bob" ;
+ foaf:knows _:alice ;
+ foaf:mbox <mailto:bob work> ;
+ foaf:mbox <mailto:bob home> ;
+ foaf:member [ a foaf:Group ; foaf:name "Foo" ] ;
+ .
+
+
+_:eve
+ rdf:type foaf:Person ;
+ foaf:name "Eve" ;
+ foaf:knows _:fred ;
+ .
+
+_:fred
+ rdf:type foaf:Person ;
+ foaf:name "Fred" ;
+ foaf:mbox <mailto:fred edu> .
diff --git a/tests/libtracker-data/anon/query.out b/tests/libtracker-data/anon/query.out
new file mode 100755
index 0000000..c6ccd83
--- /dev/null
+++ b/tests/libtracker-data/anon/query.out
@@ -0,0 +1,2 @@
+"Alice" "Foo"
+"Bob" "Foo"
diff --git a/tests/libtracker-data/anon/query.rq b/tests/libtracker-data/anon/query.rq
new file mode 100755
index 0000000..07d9972
--- /dev/null
+++ b/tests/libtracker-data/anon/query.rq
@@ -0,0 +1,8 @@
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+SELECT ?x ?y
+WHERE {
+ [ foaf:name ?x ] foaf:member [ foaf:name ?y ] .
+}
+ORDER BY ?x
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index fbcb2ad..b04405d 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -54,6 +54,7 @@ const TestInfo tests[] = {
{ "algebra/filter-nested-2", "algebra/data-1", FALSE },
{ "algebra/filter-scope-1", "algebra/data-2", FALSE },
{ "algebra/var-scope-join-1", "algebra/var-scope-join-1", FALSE },
+ { "anon/query", "anon/data", 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]