jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1220558 - /incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java
Date Sun, 18 Dec 2011 22:36:45 GMT
Author: andy
Date: Sun Dec 18 22:36:45 2011
New Revision: 1220558

URL: http://svn.apache.org/viewvc?rev=1220558&view=rev
Log: (empty)

Modified:
    incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java

Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java?rev=1220558&r1=1220557&r2=1220558&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dsg/DatasetGraphSimpleMem.java Sun Dec 18
22:36:45 2011
@@ -18,15 +18,9 @@
 
 package dsg;
 
-import java.lang.management.GarbageCollectorMXBean ;
-import java.util.ArrayList ;
-import java.util.Collection ;
-import java.util.Iterator ;
-import java.util.List ;
+import java.util.* ;
 
-import org.openjena.atlas.iterator.Filter ;
 import org.openjena.atlas.iterator.Iter ;
-import org.openjena.atlas.lib.Lib ;
 
 import com.hp.hpl.jena.graph.Graph ;
 import com.hp.hpl.jena.graph.Node ;
@@ -34,10 +28,8 @@ import com.hp.hpl.jena.graph.Triple ;
 import com.hp.hpl.jena.graph.TripleMatch ;
 import com.hp.hpl.jena.graph.impl.GraphBase ;
 import com.hp.hpl.jena.sparql.ARQException ;
-import com.hp.hpl.jena.sparql.core.DSG_Mem ;
 import com.hp.hpl.jena.sparql.core.DatasetGraphBase ;
 import com.hp.hpl.jena.sparql.core.Quad ;
-import com.hp.hpl.jena.tdb.store.GraphNamedTDB ;
 import com.hp.hpl.jena.util.iterator.ExtendedIterator ;
 import com.hp.hpl.jena.util.iterator.WrappedIterator ;
 
@@ -91,16 +83,26 @@ public class DatasetGraphSimpleMem exten
     @Override
     public Iterator<Node> listGraphNodes()
     {
-        return null ;
+        return graphNodes().iterator() ;
+    }
+    
+    private Set<Node> graphNodes()
+    {
+        Set<Node> x = new HashSet<Node>() ;
+        for ( Quad q : quads )
+            x.add(q.getGraph()) ;
+        return x ;
     }
 
+    private Iterator<Quad> all() 
+    {
+        return Iter.concat(triples2quadsDftGraph(triples.iterator()), quads.iterator()) ;

+    }
+    
     @Override
     public Iterator<Quad> find(Node g, Node s, Node p, Node o)
     {
-        // match?
-        return match( Iter.concat(triples2quadsDftGraph(triples.iterator()),
-                                  quads.iterator()),
-                       g, s, p, o) ;
+        return match( all(), g, s, p, o) ;
     }
 
     private boolean isDefaultGraph(Quad quad)



Mime
View raw message