Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Fuseki 1.0.0
-
None
Description
If you want to upload a large file to Fuseki it would be nice if it supported compressed data formats such as GZip.
Currently trying to upload a GZipped file results in the following:
13:00:01 INFO Fuseki :: [1] POST http://localhost:3030/ds/upload 13:00:01 INFO Fuseki :: [1] Upload: Filename: med-triangles.nt.gz, Content-Type=application/x-gzip, Charset=null => N-Triples org.apache.jena.atlas.AtlasException: java.nio.charset.MalformedInputException: Input length = 1 at org.apache.jena.atlas.io.IO.exception(IO.java:206) at org.apache.jena.atlas.io.CharStreamBuffered$SourceReader.fill(CharStreamBuffered.java:79) at org.apache.jena.atlas.io.CharStreamBuffered.fillArray(CharStreamBuffered.java:156) at org.apache.jena.atlas.io.CharStreamBuffered.advance(CharStreamBuffered.java:139) at org.apache.jena.atlas.io.PeekReader.advanceAndSet(PeekReader.java:251) at org.apache.jena.atlas.io.PeekReader.init(PeekReader.java:244) at org.apache.jena.atlas.io.PeekReader.peekChar(PeekReader.java:169) at org.apache.jena.atlas.io.PeekReader.makeUTF8(PeekReader.java:108) at org.apache.jena.riot.tokens.TokenizerFactory.makeTokenizerUTF8(TokenizerFactory.java:41) at org.apache.jena.riot.RiotReader.createParser(RiotReader.java:130) at org.apache.jena.fuseki.servlets.SPARQL_REST.parse(SPARQL_REST.java:298) at org.apache.jena.fuseki.servlets.SPARQL_Upload.uploadWorker(SPARQL_Upload.java:236) at org.apache.jena.fuseki.servlets.SPARQL_Upload.uploadNonTxn(SPARQL_Upload.java:124) at org.apache.jena.fuseki.servlets.SPARQL_Upload.upload(SPARQL_Upload.java:117) at org.apache.jena.fuseki.servlets.SPARQL_Upload.perform(SPARQL_Upload.java:83) at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.executeLifecycle(SPARQL_ServletBase.java:184) at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.executeAction(SPARQL_ServletBase.java:165) at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:153) at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:73) at org.apache.jena.fuseki.servlets.SPARQL_Upload.doPost(SPARQL_Upload.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72) at org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:744) Caused by: java.nio.charset.MalformedInputException: Input length = 1 at java.nio.charset.CoderResult.throwException(CoderResult.java:277) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:338) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.Reader.read(Reader.java:140) ... 42 more
It should be possible to determine the appropriate type by examining the file extension of the attachments and then open an appropriate GZip stream over the uploaded data stream.
I'm gonna take a look at doing this later today.
Attachments
Issue Links
- is related to
-
JENA-601 Provide better support for compressed input formats
- Closed