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

SPARQL 1.1 Graph Store HTTP Protocol Support

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: BIGDATA_RELEASE_1_2_3
    • Fix Version/s: None
    • Component/s: NanoSparqlServer
    • Labels:

      Description

      curl --verbose -D- -H 'Content-Type: text/turtle' --upload-file test-data/syapse_abox.ttl http://10.0.1.12:2333/sparql?graph=http://example.org/abox
      

      reports a 500 error, where the turtle file exists and is legal, and the URL is the nanoserver sparql end point.

      The following stack trace is given:

      java.lang.UnsupportedOperationException
      	at com.bigdata.rdf.sail.webapp.UpdateServlet.doUpdateWithQuery(UpdateServlet.java:125)
      	at com.bigdata.rdf.sail.webapp.UpdateServlet.doPut(UpdateServlet.java:99)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPut(RESTServlet.java:244)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:730)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:47)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
      	at org.eclipse.jetty.server.Server.handle(Server.java:352)
      	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
      	at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:599)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
      	at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
      	at java.lang.Thread.run(Thread.java:722)
      

      OTOH the POST and DELETE methods from
      http://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/
      work
      i.e.

      curl --verbose -D- -H 'Content-Type: text/turtle' --upload-file test-data/syapse_abox.ttl -X POST http://10.0.1.12:2333/sparql?graph=http://example.org/abox
      

      and

      curl --verbose -D-  -X DELETE http://10.0.1.12:2333/sparql?graph=http://example.org/abox
      

      work.
      This suggests that the current intent is to implement the SPARQL Update Rec., but this is incomplete.

      Note: This ticket is a duplicate of BLZG-665. I am going to close BLZG-665 and leave the work on this ticket here.

        Issue Links

          Activity

          Hide
          jeremycarroll jeremycarroll added a comment -

          On further investigation it seems that POST add triples to the default graph, and DELETE deletes all quads, and both ignore the graph parameter. Hence it appears that directly supporting the Graph Store Protocol may break backward compatibility for DELETE.

          Show
          jeremycarroll jeremycarroll added a comment - On further investigation it seems that POST add triples to the default graph, and DELETE deletes all quads, and both ignore the graph parameter. Hence it appears that directly supporting the Graph Store Protocol may break backward compatibility for DELETE.
          Hide
          jeremycarroll jeremycarroll added a comment -

          Looking at the code, there is quite extensive support for a Web API, presumably predating the standard one.
          Probably best to introduce a new end point URL for the standard ...

          Show
          jeremycarroll jeremycarroll added a comment - Looking at the code, there is quite extensive support for a Web API, presumably predating the standard one. Probably best to introduce a new end point URL for the standard ...
          Hide
          jeremycarroll jeremycarroll added a comment -

          https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer#REST_API
          defines the implemented API. The standard one would be preferable (IMO)

          Show
          jeremycarroll jeremycarroll added a comment - https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer#REST_API defines the implemented API. The standard one would be preferable (IMO)
          Hide
          bryanthompson bryanthompson added a comment -

          The concept for proceeding here is to:

          1. Implement the test suite.
          2. Implement a servlet that passes the test suite.
          3. Introduce the ability to configure the RESTServlet to use either the NSS's DELETE semantics or to give preference to the Graph Store HTTP Protocol support.

          We still need to decide on how to deal with the non-overlapping methods (and there are some). I would prefer to deprecate those NSS mutation methods which conflict with and overlap with the GraphStore HTTP Protocol.

          Show
          bryanthompson bryanthompson added a comment - The concept for proceeding here is to: 1. Implement the test suite. 2. Implement a servlet that passes the test suite. 3. Introduce the ability to configure the RESTServlet to use either the NSS's DELETE semantics or to give preference to the Graph Store HTTP Protocol support. We still need to decide on how to deal with the non-overlapping methods (and there are some). I would prefer to deprecate those NSS mutation methods which conflict with and overlap with the GraphStore HTTP Protocol.
          Hide
          michaelschmidt michaelschmidt added a comment -

          See also BLZG-1144

          Show
          michaelschmidt michaelschmidt added a comment - See also BLZG-1144
          Hide
          reto Reto Gmür added a comment - - edited

          The link to the description of the non-standard legacy API no longer works.

          I found this version on archive.org:

          https://web.archive.org/web/20130526071042/https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer

          It's quite a shame, that the standard still isn't supported.

          Show
          reto Reto Gmür added a comment - - edited The link to the description of the non-standard legacy API no longer works. I found this version on archive.org: https://web.archive.org/web/20130526071042/https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer It's quite a shame, that the standard still isn't supported.
          Hide
          reto Reto Gmür added a comment -

          So to upload the file file.rdf to the graph http://example.org/ in the namespace cldi:

          curl -H 'Content-Type: application/rdf+xml' -d @file.rdf -X POST http://cldi.synapta.io/blazegraph/namespace/cldi/sparql?context-uri=http://example.org/

          Show
          reto Reto Gmür added a comment - So to upload the file file.rdf to the graph http://example.org/ in the namespace cldi : curl -H 'Content-Type: application/rdf+xml' -d @file.rdf -X POST http://cldi.synapta.io/blazegraph/namespace/cldi/sparql?context-uri=http://example.org/
          Hide
          reto Reto Gmür added a comment -

          Unfortunately the workaround described above works only with POST and not with PUT, so to replace a graph as an atomic operation one still needs to resort to standard SPARQL update operations .

          Show
          reto Reto Gmür added a comment - Unfortunately the workaround described above works only with POST and not with PUT, so to replace a graph as an atomic operation one still needs to resort to standard SPARQL update operations .

            People

            • Assignee:
              igorkim igorkim
              Reporter:
              jeremycarroll jeremycarroll
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: