jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/8] git commit: JENA-793 : Clear prefixes on PUT; ensure prefixes overwrite when added.
Date Wed, 01 Oct 2014 10:12:38 GMT
JENA-793 : Clear prefixes on PUT; ensure prefixes overwrite when added.

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

Branch: refs/heads/master
Commit: f63051778da9cedf6ac9b1f825346d0f228d46c2
Parents: e54db9e
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Sep 30 22:55:12 2014 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Sep 30 22:55:12 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/jena/fuseki/FusekiLib.java       | 2 +-
 .../java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java   | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/f6305177/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLib.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLib.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLib.java
index 98723ba..cd405b6 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLib.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiLib.java
@@ -146,7 +146,7 @@ public class FusekiLib {
 
         PrefixMapping pmapSrc = data.getPrefixMapping() ;
         PrefixMapping pmapDest = dsg.getDefaultGraph().getPrefixMapping() ;
-        pmapDest.withDefaultMappings(pmapSrc) ;
+        pmapDest.setNsPrefixes(pmapSrc) ;
     }
     
     public static void addDataInto(DatasetGraph src, DatasetGraph dest) {

http://git-wip-us.apache.org/repos/asf/jena/blob/f6305177/jena-fuseki2/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java
b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java
index 2eb3c15..538a8c1 100644
--- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_GSP_RW.java
@@ -20,6 +20,10 @@ package org.apache.jena.fuseki.servlets;
 
 import static org.apache.jena.riot.WebContent.ctMultipartMixed ;
 import static org.apache.jena.riot.WebContent.matchContentType ;
+
+import java.util.Map ;
+import java.util.Map.Entry ;
+
 import org.apache.jena.atlas.web.ContentType ;
 import org.apache.jena.atlas.web.MediaType ;
 import org.apache.jena.fuseki.DEF ;
@@ -198,5 +202,8 @@ public class SPARQL_GSP_RW extends SPARQL_GSP_R
     protected static void clearGraph(Target target) {
         Graph g = target.graph() ;
         g.clear() ;
+        Map<String, String> pm = g.getPrefixMapping().getNsPrefixMap() ;
+        for ( Entry<String, String> e : pm.entrySet() ) 
+            g.getPrefixMapping().removeNsPrefix(e.getKey()) ;
     }
 }


Mime
View raw message