jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1517261 - /jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java
Date Sun, 25 Aug 2013 09:55:15 GMT
Author: andy
Date: Sun Aug 25 09:55:15 2013
New Revision: 1517261

URL: http://svn.apache.org/r1517261
Log:
Add missing parse operations.
Choose language hint over file extension when determining syntax.

Modified:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java?rev=1517261&r1=1517260&r2=1517261&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/RDFDataMgr.java Sun Aug 25 09:55:15
2013
@@ -683,6 +683,16 @@ public class RDFDataMgr
     /** Read RDF data.
      * @param sink      Destination for the RDF read.
      * @param in        Bytes to read.
+     * @param lang      Syntax for the stream.
+     */
+    public static void parse(StreamRDF sink, InputStream in, Lang lang)
+    {
+        parse(sink, in, null, lang, null) ;  
+    }
+
+    /** Read RDF data.
+     * @param sink      Destination for the RDF read.
+     * @param in        Bytes to read.
      * @param base      Base URI (defaults to uri).
      * @param hintLang  Hint for the syntax
      */
@@ -705,6 +715,16 @@ public class RDFDataMgr
 
     /** Read RDF data.
      * @param sink      Destination for the RDF read.
+     * @param in        Bytes to read.  This must include the content type.
+     */
+    public static void parse(StreamRDF sink, TypedInputStream in)
+    {
+        parse(sink, in, (String)null) ;
+    }
+
+
+    /** Read RDF data.
+     * @param sink      Destination for the RDF read.
      * @param in        Bytes to read.
      * @param base      Base URI
      */
@@ -863,11 +883,12 @@ public class RDFDataMgr
         // server setups return text/plain for any file type.
         // We use the file extension.
         
+        if ( ct == null && hintLang != null ) 
+            ct = hintLang.getContentType() ;
+
         if ( ct == null || isTextPlain )
             ct = RDFLanguages.guessContentType(target) ;
         
-        if ( ct == null && hintLang != null ) 
-            ct = hintLang.getContentType() ;
         return ct ;
     }
     



Mime
View raw message