summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Aastrand Grimnes <gromgull@gmail.com>2017-01-20 10:53:29 +0100
committerGunnar Aastrand Grimnes <gromgull@gmail.com>2017-01-20 10:53:29 +0100
commit0f38e7d67fb94367ae9e773d0936dc3718a3b027 (patch)
tree8e221fd0532133bc3931c23161c218785eb79eba
parent738e19ba8dee6250756d225fe99fafef32e282f9 (diff)
downloadrdflib-0f38e7d67fb94367ae9e773d0936dc3718a3b027.tar.gz
added dawg tests for #607
Fixes #607 (not really, but it was fixed already, probably in https://github.com/RDFLib/rdflib/commit/acc6ed3e3548a75541607ec753d05d5061028465
-rw-r--r--test/DAWG/rdflib/manifest.ttl69
-rw-r--r--test/DAWG/rdflib/subquery.tsv2
-rw-r--r--test/DAWG/rdflib/subquery.ttl4
-rw-r--r--test/DAWG/rdflib/subquery1.rq9
-rw-r--r--test/DAWG/rdflib/subquery2.rq12
-rw-r--r--test/DAWG/rdflib/subquery3.rq12
6 files changed, 97 insertions, 11 deletions
diff --git a/test/DAWG/rdflib/manifest.ttl b/test/DAWG/rdflib/manifest.ttl
index 081f911d..87ecdcad 100644
--- a/test/DAWG/rdflib/manifest.ttl
+++ b/test/DAWG/rdflib/manifest.ttl
@@ -22,6 +22,11 @@
:filtersubquery2
:filtersubquery3
:filteroptional
+
+ :subquery1
+ :subquery2
+ :subquery3
+
) .
@@ -30,7 +35,7 @@
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/> ;
mf:action
- [ qt:query <optsubq.rq> ;
+ [ qt:query <optsubq.rq> ;
qt:data <optsubq.ttl> ] ;
mf:result <optsubq.srx>
.
@@ -40,7 +45,7 @@
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <unicode.rq> ;
+ [ qt:query <unicode.rq> ;
qt:data <unicode.ttl> ] ;
mf:result <unicode.srx>
.
@@ -51,7 +56,7 @@
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <nestedbnode.rq> ] ;
+ [ qt:query <nestedbnode.rq> ] ;
mf:result <nestedbnode.srx>
.
@@ -71,7 +76,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <minusfilter.rq> ;
+ [ qt:query <minusfilter.rq> ;
qt:data <minusfilter.ttl> ] ;
mf:result <minusfilter.srx>
.
@@ -83,7 +88,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <notexistsfilter.rq> ;
+ [ qt:query <notexistsfilter.rq> ;
qt:data <minusfilter.ttl> ] ;
mf:result <notexistsfilter.srx>
.
@@ -97,7 +102,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <bindscope.rq> ;
+ [ qt:query <bindscope.rq> ;
qt:data <bindscope.ttl> ] ;
mf:result <bindscope.srx>
.
@@ -111,7 +116,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <bindscope2.rq> ;
+ [ qt:query <bindscope2.rq> ;
qt:data <bindscope.ttl> ] ;
mf:result <bindscope2.tsv>
.
@@ -124,7 +129,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <filtersubquery1.rq> ] ;
+ [ qt:query <filtersubquery1.rq> ] ;
mf:result <filtersubquery.tsv>
.
@@ -137,7 +142,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <filtersubquery2.rq> ] ;
+ [ qt:query <filtersubquery2.rq> ] ;
mf:result <filtersubquery.tsv>
.
@@ -150,7 +155,7 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <filtersubquery3.rq> ] ;
+ [ qt:query <filtersubquery3.rq> ] ;
mf:result <filtersubquery.tsv>
.
@@ -163,6 +168,48 @@ From https://github.com/RDFLib/rdflib/issues/615, contributed by https://github.
dawgt:approval dawgt:Approved ;
dawgt:approvedBy <http://gromgull.net/me> ;
mf:action
- [ qt:query <filteroptional.rq> ] ;
+ [ qt:query <filteroptional.rq> ] ;
mf:result <filtersubquery.tsv>
.
+
+
+:subquery1 rdf:type mf:QueryEvaluationTest ;
+ mf:name "subquery1";
+ rdfs:comment """
+ From https://github.com/RDFLib/rdflib/issues/607, contributed by https://github.com/pfps
+""";
+ dawgt:approval dawgt:Approved ;
+ dawgt:approvedBy <http://gromgull.net/me> ;
+ mf:action
+ [ qt:query <subquery1.rq> ;
+ qt:data <subquery.ttl> ] ;
+ mf:result <subquery.tsv>
+ .
+
+
+:subquery2 rdf:type mf:QueryEvaluationTest ;
+ mf:name "subquery2";
+ rdfs:comment """
+ From https://github.com/RDFLib/rdflib/issues/607, contributed by https://github.com/pfps
+""";
+ dawgt:approval dawgt:Approved ;
+ dawgt:approvedBy <http://gromgull.net/me> ;
+ mf:action
+ [ qt:query <subquery2.rq> ;
+ qt:data <subquery.ttl> ] ;
+ mf:result <subquery.tsv>
+ .
+
+
+:subquery3 rdf:type mf:QueryEvaluationTest ;
+ mf:name "subquery3";
+ rdfs:comment """
+ From https://github.com/RDFLib/rdflib/issues/607, contributed by https://github.com/pfps
+""";
+ dawgt:approval dawgt:Approved ;
+ dawgt:approvedBy <http://gromgull.net/me> ;
+ mf:action
+ [ qt:query <subquery3.rq> ;
+ qt:data <subquery.ttl> ] ;
+ mf:result <subquery.tsv>
+ .
diff --git a/test/DAWG/rdflib/subquery.tsv b/test/DAWG/rdflib/subquery.tsv
new file mode 100644
index 00000000..9b33f488
--- /dev/null
+++ b/test/DAWG/rdflib/subquery.tsv
@@ -0,0 +1,2 @@
+?a ?b ?c
+<http://example.org/a> <http://example.org/b> <http://example.org/c> \ No newline at end of file
diff --git a/test/DAWG/rdflib/subquery.ttl b/test/DAWG/rdflib/subquery.ttl
new file mode 100644
index 00000000..77c2bdb7
--- /dev/null
+++ b/test/DAWG/rdflib/subquery.ttl
@@ -0,0 +1,4 @@
+@prefix x: <http://example.org/> .
+x:a x:p x:b .
+x:b x:p x:c .
+x:x x:p x:y . \ No newline at end of file
diff --git a/test/DAWG/rdflib/subquery1.rq b/test/DAWG/rdflib/subquery1.rq
new file mode 100644
index 00000000..862c6400
--- /dev/null
+++ b/test/DAWG/rdflib/subquery1.rq
@@ -0,0 +1,9 @@
+# baseline - actually no subquery
+# find 2 hop chain (this works)
+
+PREFIX x: <http://example.org/>
+
+SELECT ?a ?b ?c WHERE {
+ ?a x:p ?b .
+ ?b x:p ?c .
+}
diff --git a/test/DAWG/rdflib/subquery2.rq b/test/DAWG/rdflib/subquery2.rq
new file mode 100644
index 00000000..66125cdb
--- /dev/null
+++ b/test/DAWG/rdflib/subquery2.rq
@@ -0,0 +1,12 @@
+# find 2 hop chain with subquery
+
+PREFIX x: <http://example.org/>
+
+SELECT ?a ?b ?c WHERE {
+ ?a x:p ?b .
+ {
+ SELECT ?b ?c WHERE {
+ ?b x:p ?c .
+ }
+ }
+}
diff --git a/test/DAWG/rdflib/subquery3.rq b/test/DAWG/rdflib/subquery3.rq
new file mode 100644
index 00000000..f2e12618
--- /dev/null
+++ b/test/DAWG/rdflib/subquery3.rq
@@ -0,0 +1,12 @@
+# find 2 hop chain with subquery, exec subquery first
+
+PREFIX x: <http://example.org/>
+
+SELECT ?a ?b ?c WHERE {
+ {
+ SELECT ?b ?c WHERE {
+ ?b x:p ?c .
+ }
+ }
+ ?a x:p ?b .
+}