jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject [43/50] [abbrv] jena git commit: Catch all unimplemented froms. Add some new forms as processed.
Date Wed, 09 Sep 2015 07:44:54 GMT
Catch all unimplemented froms.  Add some new forms as processed.

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

Branch: refs/heads/JENA-507
Commit: c9760dfa5067cf829f32575571f73b34c9737490
Parents: f4e017a
Author: Andy Seaborne <andy@apache.org>
Authored: Sat Sep 5 21:52:54 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sat Sep 5 21:52:54 2015 +0100

----------------------------------------------------------------------
 .../jena/sparql/engine/main/VarFinder.java      | 95 ++++++++++++++++++--
 1 file changed, 88 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/c9760dfa/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
index b5314da..a1a73fb 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
@@ -18,7 +18,11 @@
 
 package org.apache.jena.sparql.engine.main;
 
-import static org.apache.jena.sparql.util.VarUtils.* ;
+import static org.apache.jena.sparql.util.VarUtils.addVar ;
+import static org.apache.jena.sparql.util.VarUtils.addVars ;
+import static org.apache.jena.sparql.util.VarUtils.addVarsFromQuad ;
+import static org.apache.jena.sparql.util.VarUtils.addVarsFromTriple ;
+import static org.apache.jena.sparql.util.VarUtils.addVarsFromTriplePath ;
 
 import java.util.HashSet ;
 import java.util.List ;
@@ -26,14 +30,16 @@ import java.util.Map ;
 import java.util.Map.Entry ;
 import java.util.Set ;
 
+import org.apache.jena.atlas.lib.NotImplemented ;
 import org.apache.jena.sparql.algebra.Op ;
-import org.apache.jena.sparql.algebra.OpVisitorBase ;
+import org.apache.jena.sparql.algebra.OpVisitor ;
 import org.apache.jena.sparql.algebra.op.* ;
 import org.apache.jena.sparql.core.BasicPattern ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.core.VarExprList ;
 import org.apache.jena.sparql.expr.Expr ;
 import org.apache.jena.sparql.expr.ExprList ;
+import org.apache.jena.sparql.util.VarUtils ;
 
 public class VarFinder
 {
@@ -66,8 +72,9 @@ public class VarFinder
     public Set<Var> getAssign() { return varUsageVisitor.assignMentions ; }
     public Set<Var> getFixed() { return varUsageVisitor.defines ; }
     
-    private static class VarUsageVisitor extends OpVisitorBase // implements
-                                                               // OpVisitor
+    private static class VarUsageVisitor 
+        //extends OpVisitorBase
+        implements OpVisitor
     {
         static VarUsageVisitor apply(Op op) {
             VarUsageVisitor v = new VarUsageVisitor();
@@ -96,9 +103,7 @@ public class VarFinder
 
         @Override
         public void visit(OpQuadPattern quadPattern) {
-            addVar(defines, quadPattern.getGraphNode());
-            BasicPattern triples = quadPattern.getBasicPattern();
-            addVars(defines, triples);
+            addVars(defines, quadPattern.getGraphNode(), quadPattern.getBasicPattern());
         }
 
         @Override
@@ -108,6 +113,26 @@ public class VarFinder
         }
 
         @Override
+        public void visit(OpQuadBlock quadBlock) {
+            addVars(defines, quadBlock.getPattern()) ;
+        }
+
+        @Override
+        public void visit(OpTriple opTriple) {
+            addVarsFromTriple(defines, opTriple.getTriple()) ;
+        }
+
+        @Override
+        public void visit(OpQuad opQuad) {
+            addVarsFromQuad(defines, opQuad.getQuad()) ;
+        }
+
+        @Override
+        public void visit(OpPath opPath) {
+            addVarsFromTriplePath(defines, opPath.getTriplePath()); 
+        }
+
+        @Override
         public void visit(OpExt opExt) {
             opExt.effectiveOp().visit(this);
         }
@@ -235,5 +260,61 @@ public class VarFinder
 
         @Override
         public void visit(OpNull opNull) {}
+
+        @Override
+        public void visit(OpPropFunc opPropFunc) {
+            VarUtils.addVarNodes(defines, opPropFunc.getSubjectArgs().getArgList()) ;
+            VarUtils.addVarNodes(defines, opPropFunc.getObjectArgs().getArgList()) ;
+        }
+        
+        // Not implemented: with checking. 
+
+        private void no() { 
+            throw new NotImplemented() ;
+        }
+        
+        @Override
+        public void visit(OpProcedure opProc) { no() ; }
+
+
+        @Override
+        public void visit(OpService opService) { no(); }
+
+        @Override
+        public void visit(OpDatasetNames dsNames) { no(); }
+
+        @Override
+        public void visit(OpLabel opLabel) { no(); }
+
+        @Override
+        public void visit(OpDiff opDiff) { no(); }
+
+        @Override
+        public void visit(OpMinus opMinus) { no(); }
+
+        @Override
+        public void visit(OpDisjunction opDisjunction) { no(); }
+
+        @Override
+        public void visit(OpList opList) { no(); }
+
+        @Override
+        public void visit(OpOrder opOrder) { no(); }
+
+        @Override
+        public void visit(OpReduced opReduced) { no(); }
+
+        @Override
+        public void visit(OpDistinct opDistinct) { no(); }
+
+        @Override
+        public void visit(OpSlice opSlice) { no(); }
+
+        @Override
+        public void visit(OpGroup opGroup) { no(); }
+
+        @Override
+        public void visit(OpTopN opTop) { no(); }
     }
+
 }


Mime
View raw message