Repository: marmotta
Updated Branches:
  refs/heads/develop d3f9f7383 -> 3ce0fdcb4


CONSTRUCT tests for MARMOTTA 651


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/fd9bd52f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/fd9bd52f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/fd9bd52f

Branch: refs/heads/develop
Commit: fd9bd52f45969bf5578f9956255c93a06ea7dafa
Parents: bc09d27
Author: Rob Atkinson <[email protected]>
Authored: Thu Aug 18 17:36:16 2016 +1000
Committer: Rob Atkinson <[email protected]>
Committed: Thu Aug 18 17:36:16 2016 +1000

----------------------------------------------------------------------
 .../kiwi/sparql/test/KiWiSparqlTest.java        | 19 ++++++++++++++
 .../kiwi/sparql/test/MARMOTTA-651_1.sparql      | 26 ++++++++++++++++++++
 2 files changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/fd9bd52f/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java
----------------------------------------------------------------------
diff --git 
a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java
 
b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java
index 53ee91b..fa0ae12 100644
--- 
a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java
+++ 
b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java
@@ -338,6 +338,19 @@ public class KiWiSparqlTest {
         }
     }
 
+       private void testConstructEvaluation(String queryString) throws 
RepositoryException, MalformedQueryException, QueryEvaluationException {
+        RepositoryConnection conn = repository.getConnection();
+        try {
+            conn.begin();
+            GraphQuery query = conn.prepareGraphQuery(QueryLanguage.SPARQL, 
queryString);
+            GraphQueryResult results = query.evaluate();
+            results.close();
+            conn.commit();
+        } finally {
+            conn.close();
+        }
+    }
+       
     @Test
     public void testMarmotta640_1() throws Exception {
         final String queryString = 
IOUtils.toString(this.getClass().getResourceAsStream("MARMOTTA-640_1.sparql"), 
"UTF-8");
@@ -350,6 +363,12 @@ public class KiWiSparqlTest {
         testQueryEvaluation(queryString); //TODO: if we could get data, we 
could also test the result
     }
 
+       @Test
+    public void testMarmotta651_1() throws Exception {
+        final String queryString = 
IOUtils.toString(this.getClass().getResourceAsStream("MARMOTTA-651_1.sparql"), 
"UTF-8");
+        testConstructEvaluation(queryString); //TODO: if we could get data, we 
could also test the result
+    }
+       
     @Test
     public void testMarmotta640Regresion() throws Exception {
         final String queryString = "SELECT * WHERE { { ?x ?y ?z } UNION { ?x 
?y2 ?z2 } }";

http://git-wip-us.apache.org/repos/asf/marmotta/blob/fd9bd52f/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-651_1.sparql
----------------------------------------------------------------------
diff --git 
a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-651_1.sparql
 
b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-651_1.sparql
new file mode 100644
index 0000000..e096ee3
--- /dev/null
+++ 
b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-651_1.sparql
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+CONSTRUCT
+{ ?s a ?o. ?s rdfs:label ?l }
+WHERE {
+{ ?s a ?o . }
+UNION
+{ ?s rdfs:label ?l .}
+} LIMIT 10
+

Reply via email to