[Mulgara-svn] r1455 - branches/xa11/src/jar/resolver-store/java/org/mulgara/store/statement/xa11

pag at mulgara.org pag at mulgara.org
Sat Jan 24 01:07:45 UTC 2009


Author: pag
Date: 2009-01-23 17:07:45 -0800 (Fri, 23 Jan 2009)
New Revision: 1455

Modified:
   branches/xa11/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java
Log:
Correctly dealing with a request for all variables unbound

Modified: branches/xa11/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java
===================================================================
--- branches/xa11/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java	2009-01-24 01:06:42 UTC (rev 1454)
+++ branches/xa11/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java	2009-01-24 01:07:45 UTC (rev 1455)
@@ -1514,6 +1514,16 @@
         // get the graphNodes if not already configured
         if (graphNodes.isEmpty()) throw new IllegalStateException("Unable to query for variable graphs until graphs are initialized");
 
+        if (variableMask == (MASK0 | MASK1 | MASK2)) {
+          LiteralGraphTuples result = new LiteralGraphTuples(false);
+          for (long graphNode: graphNodes) {
+            if (tripleAVLFilePhases[TI_3012].existsTriple(node0, node1, node2, graphNode)) {
+              result.appendTuple(new long[] { graphNode });
+            }
+          }
+          return result;
+        }
+
         ArrayList<StoreTuples> graphedTuples = new ArrayList<StoreTuples>();
         for (long graphNode: graphNodes) {
           StoreTuples partialResult = null;
@@ -1539,14 +1549,6 @@
             case MASK1 | MASK2:
               partialResult = tripleAVLFilePhases[TI_3120].findTuplesForMeta(graphNode, node1, node2);
               break;
-            case MASK0 | MASK1 | MASK2:
-              if (tripleAVLFilePhases[TI_3012].existsTriple(node0, node1, node2, graphNode)) {
-                // TODO: convert this to a literal tuples TestTuples(node1, node1, node2, graphNode)
-                partialResult = TuplesOperations.unconstrained();
-              } else {
-                partialResult = TuplesOperations.empty();
-              }
-              break;
             default:
               throw new AssertionError("Search structure incorrectly calculated");
           }




More information about the Mulgara-svn mailing list