You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2016/07/01 12:16:30 UTC
[10/25] marmotta git commit: MARMOTTA-640: added test with the
reported query
MARMOTTA-640: added test with the reported query
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/861efd78
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/861efd78
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/861efd78
Branch: refs/heads/MARMOTTA-584
Commit: 861efd789261963dabe02f9ef4a5ff157cb60b7d
Parents: 54e9ca1
Author: Sergio Fern�ndez <wi...@apache.org>
Authored: Fri Jun 10 12:02:03 2016 +0200
Committer: Sergio Fern�ndez <wi...@apache.org>
Committed: Fri Jun 10 12:02:03 2016 +0200
----------------------------------------------------------------------
.../kiwi/sparql/test/KiWiSparqlTest.java | 15 +++++++++
.../kiwi/sparql/test/MARMOTTA-640.sparql | 33 ++++++++++++++++++++
2 files changed, 48 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/marmotta/blob/861efd78/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 bb61a5a..7a4c66a 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
@@ -326,4 +326,19 @@ public class KiWiSparqlTest {
testMarmotta627("SELECT ( 2.00*4.00 as ?c ) WHERE {}", 8.00);
}
+ @Test
+ public void testMarmotta640() throws Exception {
+ RepositoryConnection conn = repository.getConnection();
+ try {
+ conn.begin();
+ String queryString = IOUtils.toString(this.getClass().getResourceAsStream("MARMOTTA-640.sparql"), "UTF-8");
+ TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ TupleQueryResult results = query.evaluate();
+ //TODO: if we get some sample data, we could improve the test
+ results.close();
+ } finally {
+ conn.close();
+ }
+ }
+
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/861efd78/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-640.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-640.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-640.sparql
new file mode 100644
index 0000000..d2c2a42
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/MARMOTTA-640.sparql
@@ -0,0 +1,33 @@
+#
+# 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#>
+PREFIX void: <http://rdfs.org/ns/void#>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+SELECT *
+WHERE {
+ {
+ <http://resources.opengeospatial.org/def/voc/examples/mdg> rdf:type ?___0
+ OPTIONAL { ?___0 rdfs:label ?___1 }
+ } UNION {
+ <http://resources.opengeospatial.org/def/voc/examples/mdg> rdfs:label ?___2
+ } UNION {
+ <http://resources.opengeospatial.org/def/voc/examples/mdg> void:sparqlendpoint ?___10
+ }
+}
\ No newline at end of file