marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject [5/6] marmotta git commit: MARMOTTA-640: aliased NULL projections to avoid issues evaluating queries on h2
Date Mon, 20 Jun 2016 10:48:32 GMT
MARMOTTA-640: aliased NULL projections to avoid issues evaluating queries on h2


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

Branch: refs/heads/develop
Commit: b1b899c5168a8e364a183329bc833ae8606513bf
Parents: 05ecd8a
Author: Sergio Fernández <wikier@apache.org>
Authored: Mon Jun 20 09:50:29 2016 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Mon Jun 20 09:50:29 2016 +0200

----------------------------------------------------------------------
 .../org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java     | 5 +++--
 .../org/apache/marmotta/kiwi/sparql/test/KiWiSparqlTest.java    | 5 ++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b1b899c5/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java
b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java
index 9ae8927..9dc1426 100644
--- a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/builder/SQLBuilder.java
@@ -614,8 +614,9 @@ public class SQLBuilder {
         Collections.sort(vars, SQLVariable.sparqlNameComparator);
 
         for(SQLVariable v : vars) {
+            final String projectedName = v.getName();
             if(v.getProjectionType() != ValueType.NONE && (projectedVars.isEmpty()
|| projectedVars.contains(v.getSparqlName()))) {
-                final String projectedName = v.getName();
+
 
                 if (v.getExpressions() != null && v.getExpressions().size() >
0) {
                     String fromName = v.getExpressions().get(0);
@@ -630,7 +631,7 @@ public class SQLBuilder {
                     projections.add(v.getLiteralLangExpression() + " AS " + projectedName
+ "_LANG");
                 }
             } else {
-                projections.add("NULL"); //fix for MARMOTTA-460
+                projections.add("NULL AS " + projectedName); //fix for MARMOTTA-460
             }
         }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b1b899c5/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 9ab8d3d..53ee91b 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
@@ -23,7 +23,6 @@ import info.aduna.iteration.Iterations;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.marmotta.kiwi.config.KiWiConfiguration;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
 import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
@@ -342,13 +341,13 @@ public class KiWiSparqlTest {
     @Test
     public void testMarmotta640_1() throws Exception {
         final String queryString = IOUtils.toString(this.getClass().getResourceAsStream("MARMOTTA-640_1.sparql"),
"UTF-8");
-        testQueryEvaluation(queryString);
+        testQueryEvaluation(queryString); //TODO: if we could get data, we could also test
the result
     }
 
     @Test
     public void testMarmotta640_2() throws Exception {
         final String queryString = IOUtils.toString(this.getClass().getResourceAsStream("MARMOTTA-640_2.sparql"),
"UTF-8");
-        testQueryEvaluation(queryString);
+        testQueryEvaluation(queryString); //TODO: if we could get data, we could also test
the result
     }
 
     @Test


Mime
View raw message