Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F1A9E200B21 for ; Fri, 10 Jun 2016 12:29:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F05F5160A38; Fri, 10 Jun 2016 10:29:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 456A5160A04 for ; Fri, 10 Jun 2016 12:29:13 +0200 (CEST) Received: (qmail 16620 invoked by uid 500); 10 Jun 2016 10:29:12 -0000 Mailing-List: contact commits-help@marmotta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@marmotta.apache.org Delivered-To: mailing list commits@marmotta.apache.org Received: (qmail 16604 invoked by uid 99); 10 Jun 2016 10:29:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2016 10:29:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0BE66DFC7E; Fri, 10 Jun 2016 10:29:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: wikier@apache.org To: commits@marmotta.apache.org Message-Id: <3c456ed72b35434fa2ca71cfdd6df188@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: marmotta git commit: MARMOTTA-640: added test with the reported query Date: Fri, 10 Jun 2016 10:29:12 +0000 (UTC) archived-at: Fri, 10 Jun 2016 10:29:14 -0000 Repository: marmotta Updated Branches: refs/heads/MARMOTTA-640 [created] 861efd789 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-640 Commit: 861efd789261963dabe02f9ef4a5ff157cb60b7d Parents: 54e9ca1 Author: Sergio Fernández Authored: Fri Jun 10 12:02:03 2016 +0200 Committer: Sergio Fernández 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: +PREFIX void: +PREFIX rdf: + +SELECT * +WHERE { + { + rdf:type ?___0 + OPTIONAL { ?___0 rdfs:label ?___1 } + } UNION { + rdfs:label ?___2 + } UNION { + void:sparqlendpoint ?___10 + } +} \ No newline at end of file