changeset 373:842aa232bce3

~ ++ does not touch the given graphs for JenaModel
author Alexandre Bertails <bertails@w3.org>
date Thu, 05 May 2011 19:08:10 -0400
parents 4f0ff4640841
children 6903cc3274b5
files jena/src/main/scala/JenaModel.scala
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.