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

Named subquery results not referenced within query (bottom-up evaluation)

    XMLWordPrintable

    Details

      Description

      This query against an empty Journal produces the stack trace listed below. The problem appears to be that a named solution set is generated by a bottom up rewrite of the query. There is probably an intermediate layer of this query that is forcing the bottom-up rewrite. It is that bottom-up rewrite that is hitting the problem. I would check to make sure that you do not have variables that have the same name in the top and bottom groups in this query that do not also appear in the intermediate levels. That is what forces a bottom up rewrite. This is also nearly always an error in the query.

      SELECT * WHERE {
        ?host <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://example.com#Host> .
        ?host <http://example.com#displayName> ?device.
        ?host <http://example.com#containsHostAdapter> ?hostAdapter.
        ?hostAdapter <http://example.com#containsHostPort> ?hostPort.
        ?hostPort <http://example.com#containsProtocolEndpoint> ?hostPEP.
        ?hostPEP <http://example.com#maskedTo> ?maskingView.
        ?maskingView <http://example.com#maskedToTarget> ?arrayFrontEndPort.
        ?hostPEP <http://example.com#connectedTo> ?hostSwitchPEP.
        ?hostSwitchPEP <http://example.com#residesOnLogicalSwitch> ?hostSwitch.
        ?hostSwitch <http://example.com#residesOnFabric> ?fabric.
        {
          ?fabric <http://example.com#containsLogicalSwitch> ?logicalSwitch1.
        } UNION {
            ?fabric <http://example.com#containsLogicalSwitch> ?arraySwitch.
            ?arraySwitch <http://example.com#containsProtocolEndpoint> ?switchPEP.
            OPTIONAL {
              ?switchPEP <http://example.com#connectedTo> ?arrayPEP.
              ?arrayPEP <http://example.com#residesOnStorageFrontEndPort> ?arrayFrontEndPort.
            }
        }
      } LIMIT 100
      
      java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Named subquery results are not used by this query: %-bottom-up-0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:520)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:191)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:237)
      	at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doPost(MultiTenancyServlet.java:144)
      	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:769)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:497)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Named subquery results are not used by this query: %-bottom-up-0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:202)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.explainQuery(QueryServlet.java:952)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.access$1(QueryServlet.java:810)
      	at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:634)
      	at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:1)
      	at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:67)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at com.bigdata.rdf.task.AbstractApiTask.submitApiTask(AbstractApiTask.java:315)
      	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:220)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:517)
      	... 25 more
      Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Named subquery results are not used by this query: %-bottom-up-0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1296)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	... 1 more
      Caused by: java.lang.RuntimeException: Named subquery results are not used by this query: %-bottom-up-0
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.assertEachNamedSubqueryIsUsed(ASTNamedSubqueryOptimizer.java:294)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.optimize(ASTNamedSubqueryOptimizer.java:121)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTOptimizerList.optimize(ASTOptimizerList.java:104)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:222)
      	at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateTupleQuery(ASTEvalHelper.java:244)
      	at com.bigdata.rdf.sail.BigdataSailTupleQuery.evaluate(BigdataSailTupleQuery.java:93)
      	at com.bigdata.rdf.sail.BigdataSailTupleQuery.evaluate(BigdataSailTupleQuery.java:75)
      	at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:75)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1405)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask$SparqlRestApiTask.call(BigdataRDFContext.java:1235)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask$SparqlRestApiTask.call(BigdataRDFContext.java:1)
      	at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:67)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at com.bigdata.rdf.task.AbstractApiTask.submitApiTask(AbstractApiTask.java:315)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1294)
      	... 5 more
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: