Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1094

"Attempt to reassign ?graph" when using text:query with VALUES ?graph

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.0.1
    • Jena 3.1.0
    • None
    • None

    Description

      A strange problem involving jena-text, GRAPH and VALUES that I noticed as the 3.0.1 release was being prepared.

      To reproduce:

      1. Start Fuseki 1.3.1 with the included jena-text example configuration:

      ./fuseki-server --config config-tdb-text.ttl
      

      2. Insert example data:

      PREFIX ex: <http://example.com/>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      INSERT DATA {
        GRAPH ex: {
          ex:s rdfs:label "Example" .
        }
      }
      

      3. Perform this query:

      PREFIX ex: <http://example.com/>
      PREFIX text: <http://jena.apache.org/text#>
      SELECT *
      WHERE {
        GRAPH ?graph {
          ?s text:query 'example' .
        }
      }
      VALUES ?graph { ex: } 
      

      Result:

      16:26:37 WARN  [2] RC = 500 : Attempt to reassign '?graph' from '<http://example.com/>' to '<http://example.com/>'
      org.apache.jena.sparql.ARQInternalErrorException: Attempt to reassign '?graph' from '<http://example.com/>' to '<http://example.com/>'
      	at org.apache.jena.sparql.engine.binding.BindingHashMap.checkAdd(BindingHashMap.java:112)
      	at org.apache.jena.sparql.engine.binding.BindingHashMap.add(BindingHashMap.java:91)
      	at org.apache.jena.sparql.engine.binding.BindingFactory.materialize(BindingFactory.java:60)
      	at org.apache.jena.tdb.solver.QueryEngineTDB$QueryIteratorMaterializeBinding.moveToNextBinding(QueryEngineTDB.java:131)
      	at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:153)
      	at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.moveToNextBinding(QueryIteratorWrapper.java:42)
      	at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:153)
      	at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.next(QueryIteratorBase.java:128)
      	at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.next(QueryIteratorBase.java:40)
      	at org.apache.jena.sparql.engine.ResultSetStream.nextBinding(ResultSetStream.java:86)
      	at org.apache.jena.sparql.engine.ResultSetCheckCondition.nextBinding(ResultSetCheckCondition.java:83)
      	at org.apache.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:87)
      	at org.apache.jena.query.ResultSetFactory.makeRewindable(ResultSetFactory.java:404)
      	at org.apache.jena.sparql.resultset.TextOutput.write(TextOutput.java:145)
      	at org.apache.jena.sparql.resultset.TextOutput.write(TextOutput.java:130)
      	at org.apache.jena.sparql.resultset.TextOutput.write(TextOutput.java:118)
      	at org.apache.jena.sparql.resultset.TextOutput.format(TextOutput.java:66)
      	at org.apache.jena.query.ResultSetFormatter.out(ResultSetFormatter.java:157)
      	at org.apache.jena.fuseki.servlets.ResponseResultSet$3.output(ResponseResultSet.java:242)
      	at org.apache.jena.fuseki.servlets.ResponseResultSet.output(ResponseResultSet.java:301)
      	at org.apache.jena.fuseki.servlets.ResponseResultSet.textOutput(ResponseResultSet.java:248)
      	at org.apache.jena.fuseki.servlets.ResponseResultSet.doResponseResultSet$(ResponseResultSet.java:147)
      	at org.apache.jena.fuseki.servlets.ResponseResultSet.doResponseResultSet(ResponseResultSet.java:88)
      	at org.apache.jena.fuseki.servlets.SPARQL_Query.sendResults(SPARQL_Query.java:364)
      	at org.apache.jena.fuseki.servlets.SPARQL_Query.execute(SPARQL_Query.java:254)
      	at org.apache.jena.fuseki.servlets.SPARQL_Query.executeWithParameter(SPARQL_Query.java:205)
      	at org.apache.jena.fuseki.servlets.SPARQL_Query.perform(SPARQL_Query.java:81)
      	at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.executeLifecycle(SPARQL_ServletBase.java:227)
      	at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.executeAction(SPARQL_ServletBase.java:204)
      	at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:186)
      	at org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:79)
      	at org.apache.jena.fuseki.servlets.SPARQL_Query.doGet(SPARQL_Query.java:64)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
      	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$CachedChain.doFilter(ServletHandler.java:1496)
      	at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)
      	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:294)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
      	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:494)
      	at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
      	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
      	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      	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:745)
      

      Already present in Jena 3.0.0.

      If I change the query to avoid the VALUES block (i.e. GRAPH ex:

      { ... }

      ) then it will no longer break.

      Moving the VALUES block inside the WHERE block doesn't help.

      I haven't seen this happen in any of my real world queries, even though they have the same elements as this one.

      Attachments

        Activity

          People

            andy Andy Seaborne
            osma Osma Suominen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: