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 2013/10/10 18:48:34 UTC

svn commit: r1531048 - in /jena/trunk: jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java

Author: andy
Date: Thu Oct 10 16:48:34 2013
New Revision: 1531048

URL: http://svn.apache.org/r1531048
Log: (empty)

Added:
    jena/trunk/jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java
Modified:
    jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java

Added: jena/trunk/jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java?rev=1531048&view=auto
==============================================================================
--- jena/trunk/jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java (added)
+++ jena/trunk/jena-arq/src-examples/arq/examples/bgpmatching/OpExecutorAlt.java Thu Oct 10 16:48:34 2013
@@ -0,0 +1,69 @@
+/**
+ * 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.
+ */
+
+package arq.examples.bgpmatching;
+
+import com.hp.hpl.jena.sparql.ARQNotImplemented ;
+import com.hp.hpl.jena.sparql.algebra.op.OpBGP ;
+import com.hp.hpl.jena.sparql.algebra.op.OpDatasetNames ;
+import com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern ;
+import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
+import com.hp.hpl.jena.sparql.engine.QueryIterator ;
+import com.hp.hpl.jena.sparql.engine.main.OpExecutor ;
+import com.hp.hpl.jena.sparql.engine.main.OpExecutorFactory ;
+
+/** Example of an alternative OpExecutor */
+public class OpExecutorAlt extends OpExecutor {
+
+    public static OpExecutorFactory factory = new OpExecutorFactory() {
+
+        @Override
+        public OpExecutor create(ExecutionContext execCxt) {
+            return new OpExecutorAlt(execCxt) ;
+        }} ;
+
+        
+    public OpExecutorAlt(ExecutionContext execCxt) {
+        super(execCxt) ;
+    }
+    
+    // The two places where we touch the storage, dpeneding on whether this is a
+    // triple or a quad based execution.
+    
+    @Override
+    protected QueryIterator execute(OpBGP opBGP, QueryIterator input) {
+        return super.execute(opBGP, input) ;
+    }
+    
+    // Default OpQuadPattern execution is a loop and it will call back into
+    // execute(OpBGP, QueryIterator)
+    @Override
+    protected QueryIterator execute(OpQuadPattern opQuadPattern, QueryIterator input) {
+        return super.execute(opQuadPattern, input) ;
+    }
+
+    // Quad form, "GRAPH ?g {}" 
+    // Flip back to OpGraph.
+    // Not needed for triples-based execution 
+    // Normally quad stores override this.
+    @Override
+    protected QueryIterator execute(OpDatasetNames dsNames, QueryIterator input) {
+        throw new ARQNotImplemented("execute/OpDatasetNames") ;
+    }
+}
+

Modified: jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java?rev=1531048&r1=1531047&r2=1531048&view=diff
==============================================================================
--- jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java (original)
+++ jena/trunk/jena-text/src/main/java/org/apache/jena/query/text/TextIndexLucene.java Thu Oct 10 16:48:34 2013
@@ -70,7 +70,6 @@ public class TextIndexLucene implements 
     private IndexWriter indexWriter ;
     private Analyzer analyzer = new StandardAnalyzer(VER);
     
-    
     public TextIndexLucene(Directory directory, EntityDefinition def)
     {
         this.directory = directory ;