You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/02/06 13:51:08 UTC

[1/4] jena git commit: Add SSE.parseExprList

Repository: jena
Updated Branches:
  refs/heads/master 6140aa13c -> 387bc73e5


Add SSE.parseExprList

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

Branch: refs/heads/master
Commit: 0d8a674c3404cc6bf55716cd039d625c0b10985e
Parents: 1122fdf
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Feb 6 10:18:09 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Feb 6 10:18:09 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/0d8a674c/jena-arq/src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java
index dbdb1fb..77dee79 100644
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/sse/SSE.java
@@ -41,6 +41,7 @@ import com.hp.hpl.jena.sparql.core.DatasetGraph ;
 import com.hp.hpl.jena.sparql.core.Prologue ;
 import com.hp.hpl.jena.sparql.core.Quad ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
+import com.hp.hpl.jena.sparql.expr.ExprList ;
 import com.hp.hpl.jena.sparql.graph.NodeConst ;
 import com.hp.hpl.jena.sparql.path.Path ;
 import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
@@ -144,6 +145,15 @@ public class SSE
         return BuilderExpr.buildExpr(item) ;
     }
 
+    /** Parse a string to obtain a list of SPARQL expressions  */
+    public static ExprList parseExprList(String s) { return parseExprList(s, null) ; }
+    
+    /** Parse a string to obtain a list of SPARQL expressions  */
+    public static ExprList parseExprList(String s, PrefixMapping pmap) { 
+        Item item = parse(s, pmap) ;
+        return BuilderExpr.buildExprOrExprList(item) ;
+    }
+
     /** Parse a string, and obtain a graph */
     public static Graph parseGraph(String string) { return parseGraph(string, null) ; }
     
@@ -203,7 +213,6 @@ public class SSE
         Item item = readFile(filename, pmap) ;
         BuilderGraph.buildDataset(dsg, item) ;
     }
-    
 
     /** Read in a file, parse, and obtain a SPARQL algebra op */
     public static Op readOp(String filename) { return Algebra.read(filename) ; }


[2/4] jena git commit: Fix error message (1.7 not 1.6)

Posted by an...@apache.org.
Fix error message (1.7 not 1.6)


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

Branch: refs/heads/master
Commit: 2b3569f862540197348370f8508e45047d5baafe
Parents: 0d8a674
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Feb 6 12:04:51 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Feb 6 12:04:51 2015 +0000

----------------------------------------------------------------------
 jena-fuseki/fuseki | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/2b3569f8/jena-fuseki/fuseki
----------------------------------------------------------------------
diff --git a/jena-fuseki/fuseki b/jena-fuseki/fuseki
index a4735a3..4ba1682 100755
--- a/jena-fuseki/fuseki
+++ b/jena-fuseki/fuseki
@@ -181,7 +181,7 @@ then
 fi
 if [ -z "$JAVA" ]
 then
-  echo "Cannot find a Java JDK. Please set either set JAVA or put java (>=1.6) in your PATH." 2>&2
+  echo "Cannot find a Java JDK. Please set either set JAVA or put java (>=1.7) in your PATH." 2>&2
   exit 1
 fi
 


[4/4] jena git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/jena

Posted by an...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/jena


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

Branch: refs/heads/master
Commit: 387bc73e5017ee450aa8f83d048bfa97ab000adc
Parents: fd14ac1 6140aa1
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Feb 6 12:50:56 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Feb 6 12:50:56 2015 +0000

----------------------------------------------------------------------
 .../optimize/TestTransformConstantFolding.java  | 18 +++++++++
 jena-fuseki/fuseki                              | 15 +++++--
 jena-fuseki2/apache-jena-fuseki/fuseki          | 15 +++++--
 .../src/main/webapp/dataset.html                | 19 +++++----
 jena-osgi/pom.xml                               | 42 ++++++++++++++++++++
 5 files changed, 93 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/387bc73e/jena-fuseki/fuseki
----------------------------------------------------------------------


[3/4] jena git commit: Help for debugging filter placement.

Posted by an...@apache.org.
Help for debugging filter placement.

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

Branch: refs/heads/master
Commit: fd14ac19722b99f762fcb493d6f3d322a9f4a151
Parents: 2b3569f
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Feb 6 12:05:03 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Feb 6 12:05:03 2015 +0000

----------------------------------------------------------------------
 .../optimize/TransformFilterPlacement.java      | 92 +++++++++++++-------
 1 file changed, 61 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/fd14ac19/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
index c0f1ca1..023b03c 100644
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
+++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
@@ -18,10 +18,14 @@ z * Licensed to the Apache Software Foundation (ASF) under one
 
 package com.hp.hpl.jena.sparql.algebra.optimize ;
 
-import java.util.* ;
+import java.util.Collection ;
+import java.util.Iterator ;
+import java.util.List ;
+import java.util.Set ;
 
 import org.apache.jena.atlas.lib.CollectionUtils ;
 import org.apache.jena.atlas.lib.DS ;
+import org.apache.jena.atlas.lib.Lib ;
 
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.graph.Triple ;
@@ -45,12 +49,28 @@ import com.hp.hpl.jena.sparql.util.VarUtils ;
  */
 
 public class TransformFilterPlacement extends TransformCopy {
-    static class Placement {
-        final Op op ;
-        final ExprList unplaced ; 
-        Placement(Op op, ExprList remaining) { this.op = op ; this.unplaced = remaining ; }
+    public static class Placement {
+        final public Op op ;
+        final public ExprList unplaced ; 
+        public Placement(Op op, ExprList remaining) { 
+            this.op = op ; 
+            this.unplaced = remaining ; 
+        }
+        @Override
+        public String toString() { return ""+op+" : "+unplaced ; }
+        
+        @Override
+        public int hashCode() {
+            return 31*Lib.hashCodeObject(op,1) + Lib.hashCodeObject(unplaced) ;
+        }
         @Override
-        public String toString() { return ""+op+" : "+unplaced ; } 
+        public boolean equals(Object obj) {
+            if ( this == obj ) return true ;
+            if ( obj == null ) return false ;
+            if ( getClass() != obj.getClass() ) return false ;
+            Placement other = (Placement)obj ;
+            return Lib.equal(op, other.op) && Lib.equal(unplaced, other.unplaced) ;
+        }
     }
     
     // Empty, immutable ExprList
@@ -98,6 +118,16 @@ public class TransformFilterPlacement extends TransformCopy {
     public TransformFilterPlacement(boolean includeBGPs)
     { this.includeBGPs = includeBGPs ; }
 
+    /** Operation exposes the filter placement mechanism 
+     *  so that investigation of filter placement issues
+     *  can be done from outside this class.
+     *  <i>Do not use in application code : subject to removal or change at any time.</i>
+     */
+    public static Placement filterPlacement$(ExprList exprs, Op op) {
+        TransformFilterPlacement t = new TransformFilterPlacement() ;
+        return t.transform(exprs, op) ;
+    }
+    
     @Override
     public Op transform(OpFilter opFilter, Op x) {
         ExprList exprs = opFilter.getExprs() ;
@@ -507,7 +537,7 @@ public class TransformFilterPlacement extends TransformCopy {
             if ( pRight != null && ! pRight.unplaced.isEmpty() )
                 return noChangePlacement ;
 
-            // Musrt be guarded by the above.
+            // Must be guarded by the above.
             left = transformOpAlways(exprs, left) ;
             right = transformOpAlways(exprs, right) ;
             
@@ -574,30 +604,6 @@ public class TransformFilterPlacement extends TransformCopy {
         return processExtendAssign(exprs, input) ;
     }
     
-    /* Complete processing for an Op1. 
-     * Having split expressions into pushed and unpushed at this point,
-     * try to push "pushed" down further into the subOp.
-     */  
-    private Placement processSubOp1(ExprList pushed, ExprList unpushed, Op1 input) {
-        Op opSub = input.getSubOp() ;
-        Placement subPlacement = transform(pushed, opSub) ;
-        if ( subPlacement == null ) {
-            // (Same as if a placement of the exprlist and op passed in is given).
-            // Didn't make any changes below, so add a filter for the 'pushed' and
-            // return a placement for the unpushed. 
-            Op op1 = input.getSubOp() ;
-            if ( pushed != null &&! pushed.isEmpty() )
-                op1 = OpFilter.filter(pushed, op1) ;
-            Op op2 = input.copy(op1) ;
-            return result(op2, unpushed) ;
-        }
-        // We did make changes below.  Add filter for these (which includes the 
-        // "pushed" at this level, now in the p.op or left in p.unplaced.
-        Op op_a = OpFilter.filter(subPlacement.unplaced, subPlacement.op) ;
-        op_a =  input.copy(op_a) ;
-        return result(op_a, unpushed) ;
-    }
-    
     private Placement processExtendAssign(ExprList exprs, OpExtendAssign input) {
         // We assume that each (extend) and (assign) is usually in simple form -
         // always one assignment. We cope with the general form (multiple
@@ -669,6 +675,30 @@ public class TransformFilterPlacement extends TransformCopy {
     
     // This is the cause of JENA-874.
    
+    /* Complete processing for an Op1. 
+     * Having split expressions into pushed and unpushed at this point,
+     * try to push "pushed" down further into the subOp.
+     */  
+    private Placement processSubOp1(ExprList pushed, ExprList unpushed, Op1 input) {
+        Op opSub = input.getSubOp() ;
+        Placement subPlacement = transform(pushed, opSub) ;
+        if ( subPlacement == null ) {
+            // (Same as if a placement of the exprlist and op passed in is given).
+            // Didn't make any changes below, so add a filter for the 'pushed' and
+            // return a placement for the unpushed. 
+            Op op1 = input.getSubOp() ;
+            if ( pushed != null &&! pushed.isEmpty() )
+                op1 = OpFilter.filter(pushed, op1) ;
+            Op op2 = input.copy(op1) ;
+            return result(op2, unpushed) ;
+        }
+        // We did make changes below.  Add filter for these (which includes the 
+        // "pushed" at this level, now in the p.op or left in p.unplaced.
+        Op op_a = OpFilter.filter(subPlacement.unplaced, subPlacement.op) ;
+        op_a =  input.copy(op_a) ;
+        return result(op_a, unpushed) ;
+    }
+
     private Placement placeDistinctReduced(ExprList exprs, OpDistinctReduced input) {
         Op subOp = input.getSubOp() ;
         Placement p = transform(exprs, subOp) ;