|
From: <tho...@us...> - 2014-01-24 18:42:11
|
Revision: 7827
http://bigdata.svn.sourceforge.net/bigdata/?rev=7827&view=rev
Author: thompsonbry
Date: 2014-01-24 18:42:02 +0000 (Fri, 24 Jan 2014)
Log Message:
-----------
Added test for #806.
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java
Added Paths:
-----------
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.rq
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.srx
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.trig
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java 2014-01-23 22:48:03 UTC (rev 7826)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java 2014-01-24 18:42:02 UTC (rev 7827)
@@ -318,4 +318,21 @@
).runTest();
}
+
+ /**
+ * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/806" >
+ * Incorrect computation of shared variables when lifting out named
+ * subqueries </a>
+ */
+ public void test_ticket_806() throws Exception {
+
+ new TestHelper("ticket-806",// testURI,
+ "ticket-806.rq",// queryFileURL
+ "ticket-806.trig",// dataFileURL
+ "ticket-806.srx",// resultFileURL
+ false// checkOrder
+ ).runTest();
+
+ }
+
}
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.rq
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.rq (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.rq 2014-01-24 18:42:02 UTC (rev 7827)
@@ -0,0 +1,27 @@
+PREFIX g: <http://example.org/graphs#>
+PREFIX d: <http://example.org/data#>
+PREFIX p: <http://example.org/person#>
+
+# since all 3 predicates are used in the test data, all 3 variables should end up bound here
+SELECT ?id ?fullName ?legalName {
+ {select ?entity ?id {
+ graph ?g { ?entity p:id ?id }
+ graph g:pointers { ?entity ?a ?g }
+ }}
+
+ # ?a and ?g end up being projected into the next query
+ # changing ?a => ?a1; ?g => ?g1 fixes this
+ optional {
+ select ?entity ?fullName {
+ graph g:pointers { ?entity ?a ?g }
+ graph ?g { ?entity p:fullName ?fullName }
+ }
+ }
+
+ optional {
+ select ?entity ?legalName {
+ graph ?g { ?entity p:legalName ?legalName }
+ graph g:pointers { ?entity ?a ?g }
+ }
+ }
+}
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.srx
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.srx (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.srx 2014-01-24 18:42:02 UTC (rev 7827)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
+ <head>
+ <variable name='id'/>
+ <variable name='fullName'/>
+ <variable name='legalName'/>
+ </head>
+ <results>
+ <result>
+ <binding name='id'>
+ <literal>123</literal>
+ </binding>
+ <binding name='fullName'>
+ <literal>Bryan Thompson</literal>
+ </binding>
+ <binding name='legalName'>
+ <literal>Bryan Thompson 123</literal>
+ </binding>
+ </result>
+ </results>
+</sparql>
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.trig
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.trig (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/ticket-806.trig 2014-01-24 18:42:02 UTC (rev 7827)
@@ -0,0 +1,21 @@
+@prefix g: <http://example.org/graphs#> .
+@prefix d: <http://example.org/data#> .
+@prefix p: <http://example.org/person#> .
+
+g:graph1 {
+ d:foo p:id "123"
+}
+
+g:graph2 {
+ d:foo p:fullName "Bryan Thompson"
+}
+
+g:graph3 {
+ d:foo p:legalName "Bryan Thompson 123"
+}
+
+g:pointers {
+ d:foo d:a g:graph1 .
+ d:foo d:b g:graph2 .
+ d:foo d:c g:graph3
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|