Details

      Description

      SELECT *
      {  { SELECT * { ?s ?p ?o } LIMIT 1 }
         FILTER ( ?s = <eg:a> )
      }
      

      stack trace below

      workaround

      SELECT *
      {  { SELECT * { ?s ?p ?o } LIMIT 1 }
         FILTER ( ?s = <eg:a>|| 1 = 0 )
      }
      
      java.util.concurrent.ExecutionException: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.ConstantNode cannot be cast to com.bigdata.rdf.sparql.ast.VarNode
      	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.QueryServlet.doQuery(QueryServlet.java:640)
      	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:177)
      	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:206)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	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.content(HttpConnection.java:1068)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
      	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)
      Caused by: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.ConstantNode cannot be cast to com.bigdata.rdf.sparql.ast.VarNode
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1092)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:454)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	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.ClassCastException: com.bigdata.rdf.sparql.ast.ConstantNode cannot be cast to com.bigdata.rdf.sparql.ast.VarNode
      	at com.bigdata.rdf.sparql.ast.AssignmentNode.getVarNode(AssignmentNode.java:56)
      	at com.bigdata.rdf.sparql.ast.AssignmentNode.getVar(AssignmentNode.java:62)
      	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:1408)
      	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:860)
      	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:1132)
      	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getMaybeProducedBindings(StaticAnalysis.java:1192)
      	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getMaybeProducedBindings(StaticAnalysis.java:982)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTBottomUpOptimizer.handleFiltersWithVariablesNotInScope(ASTBottomUpOptimizer.java:664)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTBottomUpOptimizer.optimize(ASTBottomUpOptimizer.java:253)
      	at com.bigdata.rdf.sparql.ast.optimizers.ASTOptimizerList.optimize(ASTOptimizerList.java:92)
      	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:220)
      	at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateTupleQuery(ASTEvalHelper.java:235)
      	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:62)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1211)
      	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1065)
      

        Activity

        beebs Brad Bebee created issue -
        Hide
        bryanthompson bryanthompson added a comment -

        Jeremy,

        Can you please create a unit test for this ticket and then assign it to Mike. The bug is most likely to be in the StaticAnalysis class. The core test suite for that class is TestStaticAnalysis.

        Thanks,
        Bryan

        Show
        bryanthompson bryanthompson added a comment - Jeremy, Can you please create a unit test for this ticket and then assign it to Mike. The bug is most likely to be in the StaticAnalysis class. The core test suite for that class is TestStaticAnalysis. Thanks, Bryan
        Hide
        jeremycarroll jeremycarroll added a comment -

        A different class cast exception comes from this one:

        base <http://localhost:8000/>
        prefix owl: <http://www.w3.org/2002/07/owl#>
        prefix dc: <http://purl.org/dc/elements/1.1/>
        prefix sys: </bdm/api/kbobject/sys:>
        prefix base: </bdm/api/kbobject/base:>
        prefix sysd: </bdm/api/appindividual/sysd:>
        prefix skos: <http://www.w3.org/2004/02/skos/core#>
        prefix syapse: </graph/syapse#>
        prefix based: </bdm/api/appindividual/based:>
        prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        prefix s: </bdm/api/>
        prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        prefix xsd: <http://www.w3.org/2001/XMLSchema#>
        prefix sd: <http://www.w3.org/ns/sparql-service-description#>
        prefix c2: </bdm/api/kbobject/c2:>
        prefix c2d: </bdm/api/appindividual/c2d:>
        
        SELECT DISTINCT $j__11 $j__4 $j__7 $j__1 $j__10 $j__12
        FROM <http://localhost:8000/graph/catCo/abox>
        FROM <http://localhost:8000/graph/ontology/sys>
        FROM <http://localhost:8000/graph/syapse>
        FROM <http://localhost:8000/graph/vocabulary>
        FROM <http://localhost:8000/graph/catCo/vocabulary>
        FROM <http://localhost:8000/graph/ontology/base>
        FROM NAMED <http://localhost:8000/graph/catCo/abox>
        FROM NAMED <http://localhost:8000/graph/ontology/sys>
        FROM NAMED <http://localhost:8000/graph/syapse>
        FROM NAMED <http://localhost:8000/graph/vocabulary>
        FROM NAMED <http://localhost:8000/graph/catCo/vocabulary>
        FROM NAMED <http://localhost:8000/graph/ontology/base>
        
        WHERE {
        
        
         
          OPTIONAL {
            { FILTER ( false ) }
            UNION
            {  SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT 
                           REPLACE($j__5,'[\\\\"]','\\\\$0') ;
                           SEPARATOR='" "' ), '"') AS $j__4 )
              WHERE {
                { SELECT $j__5 ?Subject_A
                  {
                    base:secondaryIndication syapse:hasLiteralProperty $j__6 .
                    ?Subject_A $j__6 $j__5
                  } ORDER BY $j__5
                }
              } GROUP BY ?Subject_A
            }
          }
          OPTIONAL {
            {  SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT 
                           REPLACE($j__8,'[\\\\"]','\\\\$0') ;
                           SEPARATOR='" "' ), '"') AS $j__7 )
              WHERE {
                { SELECT $j__8 ?Subject_A
                  {
                    base:raceEthnicity syapse:hasLiteralProperty $j__9 .
                    ?Subject_A $j__9 $j__8
                  } ORDER BY $j__8
                }
              } GROUP BY ?Subject_A
            }
          }
          OPTIONAL {
            ?Subject_A sys:name $j__10
          }
          OPTIONAL {
            ?Subject_A base:hasSample $j__11
          }
          OPTIONAL {
            ?Subject_A base:gender $j__12
          }
          ?Subject_A rdf:type / rdfs:subClassOf * base:HumanSubject
        }
        

        i.e.

        ava.util.concurrent.ExecutionException: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode
        	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.QueryServlet.doQuery(QueryServlet.java:640)
        	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:177)
        	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:206)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        	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.content(HttpConnection.java:1068)
        	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
        	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
        	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)
        Caused by: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1092)
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:454)
        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        	... 1 more
        
        Show
        jeremycarroll jeremycarroll added a comment - A different class cast exception comes from this one: base <http://localhost:8000/> prefix owl: <http://www.w3.org/2002/07/owl#> prefix dc: <http://purl.org/dc/elements/1.1/> prefix sys: </bdm/api/kbobject/sys:> prefix base: </bdm/api/kbobject/base:> prefix sysd: </bdm/api/appindividual/sysd:> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix syapse: </graph/syapse#> prefix based: </bdm/api/appindividual/based:> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix s: </bdm/api/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix sd: <http://www.w3.org/ns/sparql-service-description#> prefix c2: </bdm/api/kbobject/c2:> prefix c2d: </bdm/api/appindividual/c2d:> SELECT DISTINCT $j__11 $j__4 $j__7 $j__1 $j__10 $j__12 FROM <http://localhost:8000/graph/catCo/abox> FROM <http://localhost:8000/graph/ontology/sys> FROM <http://localhost:8000/graph/syapse> FROM <http://localhost:8000/graph/vocabulary> FROM <http://localhost:8000/graph/catCo/vocabulary> FROM <http://localhost:8000/graph/ontology/base> FROM NAMED <http://localhost:8000/graph/catCo/abox> FROM NAMED <http://localhost:8000/graph/ontology/sys> FROM NAMED <http://localhost:8000/graph/syapse> FROM NAMED <http://localhost:8000/graph/vocabulary> FROM NAMED <http://localhost:8000/graph/catCo/vocabulary> FROM NAMED <http://localhost:8000/graph/ontology/base> WHERE { OPTIONAL { { FILTER ( false ) } UNION { SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT REPLACE($j__5,'[\\\\"]','\\\\$0') ; SEPARATOR='" "' ), '"') AS $j__4 ) WHERE { { SELECT $j__5 ?Subject_A { base:secondaryIndication syapse:hasLiteralProperty $j__6 . ?Subject_A $j__6 $j__5 } ORDER BY $j__5 } } GROUP BY ?Subject_A } } OPTIONAL { { SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT REPLACE($j__8,'[\\\\"]','\\\\$0') ; SEPARATOR='" "' ), '"') AS $j__7 ) WHERE { { SELECT $j__8 ?Subject_A { base:raceEthnicity syapse:hasLiteralProperty $j__9 . ?Subject_A $j__9 $j__8 } ORDER BY $j__8 } } GROUP BY ?Subject_A } } OPTIONAL { ?Subject_A sys:name $j__10 } OPTIONAL { ?Subject_A base:hasSample $j__11 } OPTIONAL { ?Subject_A base:gender $j__12 } ?Subject_A rdf:type / rdfs:subClassOf * base:HumanSubject } i.e. ava.util.concurrent.ExecutionException: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode 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.QueryServlet.doQuery(QueryServlet.java:640) at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:177) at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 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.content(HttpConnection.java:1068) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) 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) Caused by: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1092) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:454) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ... 1 more
        Hide
        jeremycarroll jeremycarroll added a comment -

        And a slightly differnet one is this:

        base <http://localhost:8000/>
        prefix owl: <http://www.w3.org/2002/07/owl#>
        prefix dc: <http://purl.org/dc/elements/1.1/>
        prefix sys: </bdm/api/kbobject/sys:>
        prefix base: </bdm/api/kbobject/base:>
        prefix sysd: </bdm/api/appindividual/sysd:>
        prefix skos: <http://www.w3.org/2004/02/skos/core#>
        prefix syapse: </graph/syapse#>
        prefix based: </bdm/api/appindividual/based:>
        prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
        prefix s: </bdm/api/>
        prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        prefix xsd: <http://www.w3.org/2001/XMLSchema#>
        prefix sd: <http://www.w3.org/ns/sparql-service-description#>
        prefix c2: </bdm/api/kbobject/c2:>
        prefix c2d: </bdm/api/appindividual/c2d:>
        
        SELECT DISTINCT $j__11 $j__4 $j__7 $j__1 $j__10 $j__12
        FROM <http://localhost:8000/graph/catCo/abox>
        FROM <http://localhost:8000/graph/ontology/sys>
        FROM <http://localhost:8000/graph/syapse>
        FROM <http://localhost:8000/graph/vocabulary>
        FROM <http://localhost:8000/graph/catCo/vocabulary>
        FROM <http://localhost:8000/graph/ontology/base>
        FROM NAMED <http://localhost:8000/graph/catCo/abox>
        FROM NAMED <http://localhost:8000/graph/ontology/sys>
        FROM NAMED <http://localhost:8000/graph/syapse>
        FROM NAMED <http://localhost:8000/graph/vocabulary>
        FROM NAMED <http://localhost:8000/graph/catCo/vocabulary>
        FROM NAMED <http://localhost:8000/graph/ontology/base>
        
        WHERE {
        
                    base:secondaryIndication syapse:hasLiteralProperty $j__6 .
        
            { FILTER NOT EXISTS { ?Subject_A $j__6 $j__5 } }
            UNION
            {  SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT 
                           REPLACE($j__5,'[\\\\"]','\\\\$0') ;
                           SEPARATOR='" "' ), '"') AS $j__4 )
              WHERE {
                { SELECT $j__5 ?Subject_A
                  {
          base:secondaryIndication syapse:hasLiteralProperty $j__6 .
                    ?Subject_A $j__6 $j__5
                  } ORDER BY $j__5
                }
              } GROUP BY ?Subject_A
            }
          OPTIONAL {
            {  SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT 
                           REPLACE($j__8,'[\\\\"]','\\\\$0') ;
                           SEPARATOR='" "' ), '"') AS $j__7 )
              WHERE {
                { SELECT $j__8 ?Subject_A
                  {
                    base:raceEthnicity syapse:hasLiteralProperty $j__9 .
                    ?Subject_A $j__9 $j__8
                  } ORDER BY $j__8
                }
              } GROUP BY ?Subject_A
            }
          }
          OPTIONAL {
            ?Subject_A sys:name $j__10
          }
          OPTIONAL {
            ?Subject_A base:hasSample $j__11
          }
          OPTIONAL {
            ?Subject_A base:gender $j__12
          }
          ?Subject_A rdf:type / rdfs:subClassOf * base:HumanSubject
        }
        java.util.concurrent.ExecutionException: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode
        	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.QueryServlet.doQuery(QueryServlet.java:640)
        	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:177)
        	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:206)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        	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.content(HttpConnection.java:1068)
        	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
        	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
        	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)
        Caused by: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1092)
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:454)
        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        	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.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode
        	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:1260)
        	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:829)
        	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyIncomingBindings(StaticAnalysis.java:659)
        	at com.bigdata.rdf.sparql.ast.StaticAnalysis._getJoinVars(StaticAnalysis.java:2010)
        	at com.bigdata.rdf.sparql.ast.StaticAnalysis.getJoinVars(StaticAnalysis.java:1957)
        	at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.assignJoinVars(ASTNamedSubqueryOptimizer.java:397)
        	at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.optimize(ASTNamedSubqueryOptimizer.java:126)
        	at com.bigdata.rdf.sparql.ast.optimizers.ASTOptimizerList.optimize(ASTOptimizerList.java:92)
        	at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:220)
        	at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateTupleQuery(ASTEvalHelper.java:236)
        	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:62)
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1211)
        	at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1065)
        	... 6 more
        
        Show
        jeremycarroll jeremycarroll added a comment - And a slightly differnet one is this: base <http://localhost:8000/> prefix owl: <http://www.w3.org/2002/07/owl#> prefix dc: <http://purl.org/dc/elements/1.1/> prefix sys: </bdm/api/kbobject/sys:> prefix base: </bdm/api/kbobject/base:> prefix sysd: </bdm/api/appindividual/sysd:> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix syapse: </graph/syapse#> prefix based: </bdm/api/appindividual/based:> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix s: </bdm/api/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix sd: <http://www.w3.org/ns/sparql-service-description#> prefix c2: </bdm/api/kbobject/c2:> prefix c2d: </bdm/api/appindividual/c2d:> SELECT DISTINCT $j__11 $j__4 $j__7 $j__1 $j__10 $j__12 FROM <http://localhost:8000/graph/catCo/abox> FROM <http://localhost:8000/graph/ontology/sys> FROM <http://localhost:8000/graph/syapse> FROM <http://localhost:8000/graph/vocabulary> FROM <http://localhost:8000/graph/catCo/vocabulary> FROM <http://localhost:8000/graph/ontology/base> FROM NAMED <http://localhost:8000/graph/catCo/abox> FROM NAMED <http://localhost:8000/graph/ontology/sys> FROM NAMED <http://localhost:8000/graph/syapse> FROM NAMED <http://localhost:8000/graph/vocabulary> FROM NAMED <http://localhost:8000/graph/catCo/vocabulary> FROM NAMED <http://localhost:8000/graph/ontology/base> WHERE { base:secondaryIndication syapse:hasLiteralProperty $j__6 . { FILTER NOT EXISTS { ?Subject_A $j__6 $j__5 } } UNION { SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT REPLACE($j__5,'[\\\\"]','\\\\$0') ; SEPARATOR='" "' ), '"') AS $j__4 ) WHERE { { SELECT $j__5 ?Subject_A { base:secondaryIndication syapse:hasLiteralProperty $j__6 . ?Subject_A $j__6 $j__5 } ORDER BY $j__5 } } GROUP BY ?Subject_A } OPTIONAL { { SELECT ?Subject_A ( CONCAT( '"', GROUP_CONCAT( DISTINCT REPLACE($j__8,'[\\\\"]','\\\\$0') ; SEPARATOR='" "' ), '"') AS $j__7 ) WHERE { { SELECT $j__8 ?Subject_A { base:raceEthnicity syapse:hasLiteralProperty $j__9 . ?Subject_A $j__9 $j__8 } ORDER BY $j__8 } } GROUP BY ?Subject_A } } OPTIONAL { ?Subject_A sys:name $j__10 } OPTIONAL { ?Subject_A base:hasSample $j__11 } OPTIONAL { ?Subject_A base:gender $j__12 } ?Subject_A rdf:type / rdfs:subClassOf * base:HumanSubject } java.util.concurrent.ExecutionException: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode 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.QueryServlet.doQuery(QueryServlet.java:640) at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:177) at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 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.content(HttpConnection.java:1068) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) 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) Caused by: java.lang.Exception: java.lang.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1092) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:454) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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.ClassCastException: com.bigdata.rdf.sparql.ast.NamedSubqueryInclude cannot be cast to com.bigdata.rdf.sparql.ast.JoinGroupNode at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:1260) at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyProducedBindings(StaticAnalysis.java:829) at com.bigdata.rdf.sparql.ast.StaticAnalysis.getDefinitelyIncomingBindings(StaticAnalysis.java:659) at com.bigdata.rdf.sparql.ast.StaticAnalysis._getJoinVars(StaticAnalysis.java:2010) at com.bigdata.rdf.sparql.ast.StaticAnalysis.getJoinVars(StaticAnalysis.java:1957) at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.assignJoinVars(ASTNamedSubqueryOptimizer.java:397) at com.bigdata.rdf.sparql.ast.optimizers.ASTNamedSubqueryOptimizer.optimize(ASTNamedSubqueryOptimizer.java:126) at com.bigdata.rdf.sparql.ast.optimizers.ASTOptimizerList.optimize(ASTOptimizerList.java:92) at com.bigdata.rdf.sparql.ast.eval.AST2BOpUtility.convert(AST2BOpUtility.java:220) at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.evaluateTupleQuery(ASTEvalHelper.java:236) 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:62) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1211) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1065) ... 6 more
        Hide
        jeremycarroll jeremycarroll added a comment -

        The last two seem to reduce to the following sample query that bombs out:

        SELECT *
        
        WHERE {
        
           { FILTER ( false ) }
            UNION
            {
            {  SELECT ?Subject_A 
              WHERE {
                { SELECT $j__5 ?Subject_A
                  {
                  } ORDER BY $j__5
                }
              } GROUP BY ?Subject_A
            }
           }
          OPTIONAL {
            {  SELECT ?Subject_A 
              WHERE {
                { SELECT $j__8 ?Subject_A
                  {
                 
                  }  ORDER BY $j_8
                }
              } GROUP BY ?Subject_A
            }
          }
        }
        
        Show
        jeremycarroll jeremycarroll added a comment - The last two seem to reduce to the following sample query that bombs out: SELECT * WHERE { { FILTER ( false ) } UNION { { SELECT ?Subject_A WHERE { { SELECT $j__5 ?Subject_A { } ORDER BY $j__5 } } GROUP BY ?Subject_A } } OPTIONAL { { SELECT ?Subject_A WHERE { { SELECT $j__8 ?Subject_A { } ORDER BY $j_8 } } GROUP BY ?Subject_A } } }
        Hide
        jeremycarroll jeremycarroll added a comment -

        Fixed in r7426 and r7425. Taking discussion of defensive code at
        https://github.com/jeremycarroll/bigdata/commit/c9dfa430d68c03c4246ebd5025415d58cb1ce230
        onto list

        Show
        jeremycarroll jeremycarroll added a comment - Fixed in r7426 and r7425. Taking discussion of defensive code at https://github.com/jeremycarroll/bigdata/commit/c9dfa430d68c03c4246ebd5025415d58cb1ce230 onto list
        beebs Brad Bebee made changes -
        Field Original Value New Value
        Workflow Trac Import v2 [ 12662 ] Trac Import v3 [ 14197 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v3 [ 14197 ] Trac Import v4 [ 15526 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v4 [ 15526 ] Trac Import v5 [ 16912 ]
        beebs Brad Bebee made changes -
        Labels Issue_patch_20150625
        beebs Brad Bebee made changes -
        Status Closed - Won't Fix [ 6 ] Open [ 1 ]
        beebs Brad Bebee made changes -
        Status Open [ 1 ] Accepted [ 10101 ]
        beebs Brad Bebee made changes -
        Status Accepted [ 10101 ] In Progress [ 3 ]
        beebs Brad Bebee made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        beebs Brad Bebee made changes -
        Status Resolved [ 5 ] In Review [ 10100 ]
        beebs Brad Bebee made changes -
        Resolution Fixed [ 1 ] Done [ 10000 ]
        Status In Review [ 10100 ] Done [ 10000 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v5 [ 16912 ] Trac Import v6 [ 18115 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v6 [ 18115 ] Trac Import v7 [ 19512 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v7 [ 19512 ] Trac Import v8 [ 21134 ]

          People

          • Assignee:
            jeremycarroll jeremycarroll
            Reporter:
            jeremycarroll jeremycarroll
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: