~ ++ does not touch the given graphs for JenaModel
authorAlexandre Bertails <bertails@w3.org>
Thu, 05 May 2011 19:08:10 -0400
changeset 373 842aa232bce3
parent 372 4f0ff4640841
child 374 6903cc3274b5
~ ++ does not touch the given graphs for JenaModel
jena/src/main/scala/JenaModel.scala
--- a/jena/src/main/scala/JenaModel.scala	Thu May 05 16:59:13 2011 -0400
+++ b/jena/src/main/scala/JenaModel.scala	Thu May 05 19:08:10 2011 -0400
@@ -29,7 +29,15 @@
       def hasNext = iterator.hasNext
       def next = iterator.next
     }
-    def ++(other:Graph):Graph = new Graph(new com.hp.hpl.jena.graph.compose.Union(jenaGraph, other.jenaGraph))
+    def ++(other:Graph):Graph = {
+      val g = Factory.createDefaultGraph
+      iterator foreach { t => g add t }
+      other.iterator foreach { t => g add t }
+      new Graph(g)
+    }
+
+
+// new Graph(new com.hp.hpl.jena.graph.compose.Union(jenaGraph, other.jenaGraph))
 
  // {
  //      for(triple <- other) jenaGraph add triple