jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1202207 - in /incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql: core/Quad.java engine/main/OpExecutor.java engine/main/iterator/QueryIterGraph.java
Date Tue, 15 Nov 2011 14:27:25 GMT
Author: andy
Date: Tue Nov 15 14:27:25 2011
New Revision: 1202207

URL: http://svn.apache.org/viewvc?rev=1202207&view=rev
Log:
Allow for synthetic graph (union, explicitly named default) in GRAPH.

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/core/Quad.java
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/OpExecutor.java
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/iterator/QueryIterGraph.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/core/Quad.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/core/Quad.java?rev=1202207&r1=1202206&r2=1202207&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/core/Quad.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/core/Quad.java Tue
Nov 15 14:27:25 2011
@@ -37,15 +37,15 @@ public class Quad
     /** Name of the default for explict use in GRAPH */
     public static final Node defaultGraphIRI        =  Node.createURI("urn:x-arq:DefaultGraph")
;
 
+    /** Name of the merge of all named graphs (use this for the graph of all named graphs)
*/
+    public static final Node unionGraph           =  Node.createURI("urn:x-arq:UnionGraph")
;
+
     /** Name of the non-graph when a quad is really a triple - also parsing of triples formats

      *  (and the default graph when parsing N-Quads or TriG) 
      *  Not for access to the default graph by name - use Quad.defaultGraphIRI.
      */
     public static final Node tripleInQuad           =  null ;
     
-    /** Name of the merge of all named graphs (use this for the graph of all named graphs)
*/
-    public static final Node unionGraph           =  Node.createURI("urn:x-arq:UnionGraph")
;
-
     private final Node graph, subject, predicate, object ;
     
     public Quad(Node graph, Triple triple)

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/OpExecutor.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/OpExecutor.java?rev=1202207&r1=1202206&r2=1202207&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/OpExecutor.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/OpExecutor.java
Tue Nov 15 14:27:25 2011
@@ -305,6 +305,9 @@ public class OpExecutor
     
     private QueryIterator specialcase(Node gn, Op subOp, QueryIterator input)
     {
+        // This is a placeholder fro code to specially handle explicitly named 
+        // default graph and union graph.
+        
         if ( true ) return null ;
         
         if ( gn == Quad.defaultGraphIRI || gn == Quad.defaultGraphNodeGenerated )

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/iterator/QueryIterGraph.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/iterator/QueryIterGraph.java?rev=1202207&r1=1202206&r2=1202207&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/iterator/QueryIterGraph.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/engine/main/iterator/QueryIterGraph.java
Tue Nov 15 14:27:25 2011
@@ -30,6 +30,7 @@ import com.hp.hpl.jena.sparql.ARQInterna
 import com.hp.hpl.jena.sparql.algebra.Op ;
 import com.hp.hpl.jena.sparql.algebra.op.OpGraph ;
 import com.hp.hpl.jena.sparql.core.DatasetGraph ;
+import com.hp.hpl.jena.sparql.core.Quad ;
 import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
@@ -174,7 +175,12 @@ public class QueryIterGraph extends Quer
             // Think about avoiding substitution.
             // If the subpattern does not involve the vars from the binding, avoid the substitute.
 
             Op op = QC.substitute(opGraph.getSubOp(), binding) ;
-            if ( ! outerCxt.getDataset().containsGraph(graphNode) )
+            
+            // We can't just use DatasetGraph.getGraph because it may "auto-create" graphs.
+            // Use the containsGraph function.
+            
+            boolean syntheticGraph = ( Quad.isDefaultGraphExplicit(graphNode) || Quad.isUnionGraph(graphNode)
) ;
+            if ( ! syntheticGraph && ! outerCxt.getDataset().containsGraph(graphNode)
)
                 return null ;
 
             Graph g = outerCxt.getDataset().getGraph(graphNode) ;



Mime
View raw message