|
From: <tho...@us...> - 2014-09-30 16:50:06
|
Revision: 8674
http://sourceforge.net/p/bigdata/code/8674
Author: thompsonbry
Date: 2014-09-30 16:50:02 +0000 (Tue, 30 Sep 2014)
Log Message:
-----------
Added unit test for #1007.
Added Paths:
-----------
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestBindGraph1007.java
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.rq
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.srx
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.trig
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestBindGraph1007.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestBindGraph1007.java (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestBindGraph1007.java 2014-09-30 16:50:02 UTC (rev 8674)
@@ -0,0 +1,73 @@
+/**
+
+Copyright (C) SYSTAP, LLC 2013. All rights reserved.
+
+Contact:
+ SYSTAP, LLC
+ 4501 Tower Road
+ Greensboro, NC 27410
+ lic...@bi...
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+package com.bigdata.rdf.sparql.ast.eval;
+
+/**
+ * Test suite using a bound variable to refer to a graph.
+ *
+ * @see <a href="http://trac.bigdata.com/ticket/1007"> Using a bound variable to
+ * refer to a graph</a>
+ *
+ * @version $Id$
+ */
+public class TestBindGraph1007 extends AbstractDataDrivenSPARQLTestCase {
+
+ public TestBindGraph1007() {
+ }
+
+ public TestBindGraph1007(String name) {
+ super(name);
+ }
+
+ /**
+ * <pre>
+ * PREFIX : <http://www.interition.net/ref/>
+ *
+ * SELECT ?s ?p ?o ?literal WHERE {
+ *
+ * GRAPH <http://www.interition.net/g1> {
+ *
+ * <http://www.interition.net/s1> :aProperty ?literal .
+ *
+ * BIND ( URI(CONCAT("http://www.interition.net/graphs/", ?literal )) AS ?graph) .
+ *
+ * }
+ *
+ * GRAPH ?graph { ?s ?p ?o . }
+ *
+ * }
+ * </pre>
+ *
+ * @throws Exception
+ */
+ public void test_bindGraph_1007() throws Exception {
+ new TestHelper(
+ "bindGraph-1007",// testURI
+ "bindGraph-1007.rq", // queryURI
+ "bindGraph-1007.trig", // dataURI
+ "bindGraph-1007.srx" // resultURI
+ ).runTest();
+ }
+
+}
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.rq
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.rq (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.rq 2014-09-30 16:50:02 UTC (rev 8674)
@@ -0,0 +1,22 @@
+# See http://trac.bigdata.com/ticket/1007
+#
+# The query executes against the named graph g1 and extracts a binding for
+# ?literal of "g2". The ?literal is then combined into a ?graph variable
+# that should bind to the named graph g2. The solution should be the sole
+# triple in the named graph g2.
+
+PREFIX : <http://www.interition.net/ref/>
+
+SELECT ?s ?p ?o ?literal WHERE {
+
+ GRAPH <http://www.interition.net/g1> {
+
+ <http://www.interition.net/s1> :aProperty ?literal .
+
+ BIND ( URI(CONCAT("http://www.interition.net/graphs/", ?literal )) AS ?graph) .
+
+ }
+
+ GRAPH ?graph { ?s ?p ?o . }
+
+}
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.srx
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.srx (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.srx 2014-09-30 16:50:02 UTC (rev 8674)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<sparql
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema#"
+ xmlns="http://www.w3.org/2005/sparql-results#" >
+ <head>
+ <variable name="literal"/>
+ <variable name="s"/>
+ <variable name="p"/>
+ <variable name="o"/>
+ </head>
+ <results>
+ <result>
+ <binding name="literal">
+ <literal>g2</literal>
+ </binding>
+ <binding name="s">
+ <uri>http://www.interition.net/s2</uri>
+ </binding>
+ <binding name="p">
+ <uri>http://www.interition.net/ref/aProperty</uri>
+ </binding>
+ <binding name="o">
+ <literal>happy</literal>
+ </binding>
+ </result>
+ </results>
+</sparql>
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.trig
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.trig (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/bindGraph-1007.trig 2014-09-30 16:50:02 UTC (rev 8674)
@@ -0,0 +1,15 @@
+#<s1> <http://www.interition.net/ref/aProperty> "g2" <http://www.interition.net/g1> .
+
+<http://www.interition.net/g1> {
+
+ <http://www.interition.net/s1> <http://www.interition.net/ref/aProperty> "g2" .
+
+}
+
+#<s2> <http://www.interition.net/ref/aState> "happy" <http://www.interition.net/graphs/g2> .
+
+<http://www.interition.net/g2> {
+
+ <http://www.interition.net/s2> <http://www.interition.net/ref/aProperty> "happy" .
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|