jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [5/6] jena git commit: Update the storage, not the USING projection.
Date Mon, 01 Feb 2016 12:54:43 GMT
Update the storage, not the USING projection.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/22ed57e7
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/22ed57e7
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/22ed57e7

Branch: refs/heads/master
Commit: 22ed57e7b3dfcd9de4c167ad0e74c8437d919a04
Parents: 18c86e7
Author: Andy Seaborne <andy@apache.org>
Authored: Mon Feb 1 12:00:36 2016 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Mon Feb 1 12:00:36 2016 +0000

----------------------------------------------------------------------
 .../jena/sparql/modify/UpdateEngineWorker.java     | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/22ed57e7/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
index 1f4de10..4394655 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
@@ -278,7 +278,7 @@ public class UpdateEngineWorker implements UpdateVisitor
         return new Sink<Quad>() {
             @Override
             public void send(Quad quad) {
-                addTodatasetGraph(datasetGraph, quad);
+                addToDatasetGraph(datasetGraph, quad);
             }
 
             @Override
@@ -294,7 +294,7 @@ public class UpdateEngineWorker implements UpdateVisitor
     @Override
     public void visit(UpdateDataInsert update) {
         for ( Quad quad : update.getQuads() )
-            addTodatasetGraph(datasetGraph, quad);
+            addToDatasetGraph(datasetGraph, quad);
     }
 
     @Override
@@ -407,11 +407,11 @@ public class UpdateEngineWorker implements UpdateVisitor
             Iter.close(bindings);
 
             Iterator<Binding> it = db.iterator();
-            execDelete(dsg, update.getDeleteQuads(), withGraph, it);
+            execDelete(datasetGraph, update.getDeleteQuads(), withGraph, it);
             Iter.close(it);
 
             Iterator<Binding> it2 = db.iterator();
-            execInsert(dsg, update.getInsertQuads(), withGraph, it2);
+            execInsert(datasetGraph, update.getInsertQuads(), withGraph, it2);
             Iter.close(it2);
         }
         finally {
@@ -423,7 +423,6 @@ public class UpdateEngineWorker implements UpdateVisitor
     protected DatasetGraph processUsing(UpdateModify update) {
         if ( update.getUsing().size() == 0 && update.getUsingNamed().size() == 0
)
             return null;
-
         return DynamicDatasets.dynamicDataset(update.getUsing(), update.getUsingNamed(),
datasetGraph, false);
     }
 
@@ -530,16 +529,16 @@ public class UpdateEngineWorker implements UpdateVisitor
     protected static void execInsert(DatasetGraph dsg, List<Quad> onceQuads, List<Quad>
templateQuads, Node dftGraph, Iterator<Binding> bindings) {
         if ( onceQuads != null && bindings.hasNext() ) {
             onceQuads = remapDefaultGraph(onceQuads, dftGraph) ;
-            onceQuads.forEach((q)->addTodatasetGraph(dsg, q)) ;
+            onceQuads.forEach((q)->addToDatasetGraph(dsg, q)) ;
         }
         Iterator<Quad> it = template(templateQuads, dftGraph, bindings) ;
         if ( it == null )
             return ;
-        it.forEachRemaining((q)->addTodatasetGraph(dsg, q)) ;
+        it.forEachRemaining((q)->addToDatasetGraph(dsg, q)) ;
     }
 
     // Catch all individual adds of quads
-    private static void addTodatasetGraph(DatasetGraph datasetGraph, Quad quad) {
+    private static void addToDatasetGraph(DatasetGraph datasetGraph, Quad quad) {
         // Check legal triple.
         if ( quad.isLegalAsData() )
             datasetGraph.add(quad);
@@ -549,6 +548,8 @@ public class UpdateEngineWorker implements UpdateVisitor
 
     // Catch all individual deletes of quads
     private static void deleteFromDatasetGraph(DatasetGraph datasetGraph, Quad quad) {
+        if ( datasetGraph instanceof DatasetGraphReadOnly )
+            System.err.println("READ ONLY") ;
         datasetGraph.delete(quad);
     }
 


Mime
View raw message