You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by an...@apache.org on 2013/09/30 02:08:37 UTC

git commit: MARMOTTA-325 : Add hack to remove application/xml

Updated Branches:
  refs/heads/develop cadd9b921 -> 48db2490f


MARMOTTA-325 : Add hack to remove application/xml

There is no theoretical reason why we can't respond with application/xml
if they send application/xml, but in order to distinguish tuple and
graph results it may be easier just to remove it. This makes the
specific test that calls for application/sparql-results+xml as the
result for application/xml to succeed. Without the hack they get what
they asked for, application/xml

Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/48db2490
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/48db2490
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/48db2490

Branch: refs/heads/develop
Commit: 48db2490f4ae949e347e24e2d117e8dfc58ce3c3
Parents: cadd9b9
Author: Peter Ansell <p_...@yahoo.com>
Authored: Mon Sep 30 10:08:10 2013 +1000
Committer: Peter Ansell <p_...@yahoo.com>
Committed: Mon Sep 30 10:08:10 2013 +1000

----------------------------------------------------------------------
 .../marmotta/platform/sparql/webservices/SparqlWebService.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/48db2490/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
index 570ba2a..c1db1be 100644
--- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
+++ b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
@@ -248,7 +248,6 @@ public class SparqlWebService {
 	        	} else if (QueryType.GRAPH.equals(queryType)) {
 	        		Set<String> producedTypes = new HashSet<String>(exportService.getProducedTypes());
 	        		producedTypes.remove("application/xml");
-	        		producedTypes.remove("application/xml");
 	        		producedTypes.remove("text/plain");
 	        		producedTypes.remove("text/html");
 	        		producedTypes.remove("application/xhtml+xml");
@@ -539,6 +538,10 @@ public class SparqlWebService {
         for(QueryResultFormat type : types) {
             results.addAll(type.getMIMETypes());
         }
+        // HACK: Remove application/xml so that application/sparql-results+xml 
+        // and application/rdf+xml, for tuple/boolean and graph results, respectively, 
+        // will be preferred
+        results.remove("application/xml");
         return results;
     }