jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1506075 - in /jena/trunk/jena-arq/src/main/java/org/apache/jena: riot/WebContent.java web/DatasetGraphAccessorHTTP.java
Date Tue, 23 Jul 2013 14:48:23 GMT
Author: andy
Date: Tue Jul 23 14:48:23 2013
New Revision: 1506075

URL: http://svn.apache.org/r1506075
Log:
JENA-481

The default accept header for reading graphs and datasets from RIOT has been
set to favour efficient formats (e.g. n-triples, n-quads).  Use of XML formats
(which are inefficient) is not given a high q value.

Modified:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java?rev=1506075&r1=1506074&r2=1506075&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/WebContent.java Tue Jul 23 14:48:23
2013
@@ -123,9 +123,19 @@ public class WebContent
         mapContentTypeToLang.put(contentTypeTriGAlt2,       RDFLanguages.TRIG) ;
     }
 
-    public static final String defaultGraphAcceptHeader     =  "application/n-triples,text/turtle;q=0.9,application/rdf+xml;q=0.8,application/xml;q=0.7,*/*;q=0.5"
; 
-    // Old :: "application/rdf+xml,application/xml;q=0.9,*/*;q=0.5" ;
+    /** Accept header part when looking for a graph */
+    private static final String defaultGraphAccept          =  "application/n-triples,text/turtle;q=0.9,application/rdf+xml;q=0.8,application/xml;q=0.7"
;
+    /** Accept header when looking for a graph */
+    public static final String defaultGraphAcceptHeader     =  defaultGraphAccept+",*/*;q=0.5"
; 
 
+    /** Accept header part when looking for a dataset */
+    public static final String defaultDatasetAccept         =  "application/n-quads,text/x-nquads;q=0.9;application/trig;q=0.8,application/x-trig;q=0.7"
;
+    /** Accept header when looking for a dataset */
+    public static final String defaultDatasetAcceptHeader   =  defaultDatasetAccept+",*/*;q=0.5"
;
+    
+    /** Accept header when looking for a graph or dataset */
+    public static final String defaultRDFAcceptHeader       =  defaultGraphAccept+","+defaultDatasetAccept+",*/*;q=0.5"
;
+    
     
     /** Return our "canonical" name for a Content Type.
      * This should be the standard one, no X-* 

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java?rev=1506075&r1=1506074&r2=1506075&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java Tue
Jul 23 14:48:23 2013
@@ -127,10 +127,9 @@ public class DatasetGraphAccessorHTTP im
 
     private boolean doHead(String url)
     {
-        // TODO Shouldn't this use HttpOp.execHttpHead() ?
         HttpUriRequest httpHead = new HttpHead(url) ;
         try {
-            HttpOp.execHttpGet(url, WebContent.defaultGraphAcceptHeader, noResponse, this.authenticator)
;
+            HttpOp.execHttpHead(url, WebContent.defaultGraphAcceptHeader, noResponse, null,
null, this.authenticator) ;
             return true ;
         } catch (HttpException ex) {
             if ( ex.getResponseCode() == HttpSC.NOT_FOUND_404 )



Mime
View raw message