4 Replies Latest reply on May 21, 2010 2:04 PM by 766393

    ArrayIndexOutOfBoundsException during query execution (COUNT() + brackets)

    766393
      Hi

      The following query (and almost any other query combining a "select count" and a node written with brackets) raised an ArrayIndexOutOfBoundsException :
      PREFIX someinfo:<http://.......someuri/info#>
      SELECT count(?item) ?kind
      {
      ?item someinfo:Kind [someinfo:Value ?kind]
      }
      GROUP BY ?kind

      Here is part of the stack trace.
      java.lang.ArrayIndexOutOfBoundsException: 2
           at com.hp.hpl.jena.graph.query.Domain.get(Domain.java:48)
           at oracle.spatial.rdf.client.jena.OracleLeanQueryIter.moveToNextBinding(OracleLeanQueryIter.java:148)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:98)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.moveToNextBinding(QueryIterConvert.java:56)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:98)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.moveToNextBinding(QueryIterRepeatApply.java:76)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.nextBinding(QueryIteratorBase.java:98)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterGroup.calc(QueryIterGroup.java:50)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterGroup.<init>(QueryIterGroup.java:32)
           at oracle.spatial.rdf.client.jena.OracleOpExecutor.execute(OracleOpExecutor.java:1676)
           at oracle.spatial.rdf.client.jena.OracleExecutionDispatch.visit(OracleExecutionDispatch.java:341)
           at com.hp.hpl.jena.sparql.algebra.op.OpGroupAgg.visit(OpGroupAgg.java:36)
           at oracle.spatial.rdf.client.jena.OracleExecutionDispatch.exec(OracleExecutionDispatch.java:100)
           at oracle.spatial.rdf.client.jena.OracleOpExecutor.executeOp(OracleOpExecutor.java:665)
      [....]


      Am I doing something wrong ?
      FYI :
      - the same query works perfectly fine with an in-memory Jena model

      - the following query (only difference : no brackets) works fine :
      PREFIX someinfo:<http://.......someuri/info#>
      SELECT count(?item) ?kind
      {
      ?item someinfo:Kind ?k .
      ?k someinfo:Value ?kind
      }
      GROUP BY ?kind

      - here is the code launching the query :
      String queryString;
      //some code that returns the query string
      Query query = QueryFactory.create(queryString, Syntax.syntaxARQ) ;
      QueryExecution qexec = QueryExecutionFactory.create(query, rdfModel);
      ResultSet results = qexec.execSelect() ;

      Thanks
      Regards

      Julien