Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1050

REST API: INSERT methods do not handle .gz

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: In Progress
    • Resolution: Unresolved
    • Affects Version/s: BIGDATA_RELEASE_1_3_1
    • Fix Version/s: None
    • Component/s: NanoSparqlServer
    • Labels:
      None

      Description

      curl -v -X POST --data-binary 'uri=file:///global/data/lubm/U50/data/University0/University0/University0_0.owl.gz'  http://localhost:80/bigdata/sparq
      

      fails with

      * About to connect() to localhost port 80 (#0)
      *   Trying 127.0.0.1... connected
      > POST /bigdata/sparql HTTP/1.1
      > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
      > Host: localhost
      > Accept: */*
      > Content-Length: 82
      > Content-Type: application/x-www-form-urlencoded
      >
      * upload completely sent off: 82out of 82 bytes
      < HTTP/1.1 500 Server Error
      < Content-Type: text/plain
      < Transfer-Encoding: chunked
      < Server: Jetty(9.1.4.v20140401)
      <
      uri=[file:/global/data/lubm/U50/data/University0/University0/University0_0.owl.gz], context-uri=[]
      java.util.concurrent.ExecutionException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
      	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:111)
      	at com.bigdata.rdf.sail.webapp.InsertServlet.doPostWithURIs(InsertServlet.java:391)
      	at com.bigdata.rdf.sail.webapp.InsertServlet.doPost(InsertServlet.java:118)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:267)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:462)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
      	at java.lang.Thread.run(Thread.java:724)
      Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
      	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
      	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:557)
      	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
      	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(XMLEntityScanner.java:1629)
      	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(XMLEntityScanner.java:1667)
      	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:196)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:799)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
      	at org.openrdf.rio.rdfxml.RDFXMLParser.parse(RDFXMLParser.java:260)
      	at org.openrdf.rio.rdfxml.RDFXMLParser.parse(RDFXMLParser.java:209)
      	at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithURLsTask.call(InsertServlet.java:551)
      	at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithURLsTask.call(InsertServlet.java:404)
      	at com.bigdata.rdf.sail.webapp.RestApiTaskForIndexManager.call(RestApiTaskForIndexManager.java:64)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:284)
      	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:226)
      	... 25 more
      

      Also INSERT with BODY does not handle .gz either:

      curl -X POST -H 'Content-Type:application/rdf+xml' --data-binary '@University0_0.owl.gz' http://localhost:80/bigdata/sparql
      

      Results in:

      Warning: Couldn't read data from file "University0_0.owl.gz", this makes an
      Warning: empty POST.
      INSERT-WITH-BODY: baseURI=http://localhost/bigdata/sparql, context-uri=[]
      java.util.concurrent.ExecutionException: org.openrdf.rio.RDFParseException: Premature end of file. [line 1, column 1]
      	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:111)
      	at com.bigdata.rdf.sail.webapp.InsertServlet.doPostWithBody(InsertServlet.java:204)
      	at com.bigdata.rdf.sail.webapp.InsertServlet.doPost(InsertServlet.java:121)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:272)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:462)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
      	at java.lang.Thread.run(Thread.java:724)
      Caused by: org.openrdf.rio.RDFParseException: Premature end of file. [line 1, column 1]
      	at org.openrdf.rio.helpers.RDFParserBase.reportFatalError(RDFParserBase.java:622)
      	at org.openrdf.rio.rdfxml.RDFXMLParser.parse(RDFXMLParser.java:267)
      	at org.openrdf.rio.rdfxml.RDFXMLParser.parse(RDFXMLParser.java:209)
      	at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithBodyTask.call(InsertServlet.java:295)
      	at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithBodyTask.call(InsertServlet.java:227)
      	at com.bigdata.rdf.sail.webapp.RestApiTaskForIndexManager.call(RestApiTaskForIndexManager.java:64)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:284)
      	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:226)
      	... 25 more
      Caused by: org.xml.sax.SAXParseException; systemId: http://localhost/bigdata/sparql; lineNumber: 1; columnNumber: 1; Premature end of file.
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1236)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
      	at org.openrdf.rio.rdfxml.RDFXMLParser.parse(RDFXMLParser.java:260)
      	... 33 more
      

      Add a unit test for this and fix INSERT with URLs and INSERT with BODY.

        Attachments

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: