1 2 Previous Next 15 Replies Latest reply: Jul 2, 2013 3:59 PM by alwu-Oracle RSS

    Oracle fails for big SPARQL queries

    1012948
      Is there any limit of maximum number of "OPTIONAL" parameters in oracle spatial jena?

      The reason why I am asking is, I have a big query sized around 5000 letters which executes perfect. I am using oracle 11.2.0.3 db with semantic web features.

      But if I add one more OPTIONAL field in the query, it fails.

      Giving this Exception below.


      Exception in thread "main" java.lang.NullPointerException
           at oracle.spatial.rdf.client.jena.OracleRepeatApply.nextStage(OracleRepeatApply.java:794)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:101)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:53)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterProcessBinding.hasNextBinding(QueryIterProcessBinding.java:49)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding(QueryIterConvert.java:54)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding(QueryIterConvert.java:54)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIterDistinctReduced.hasNextBinding(QueryIterDistinctReduced.java:42)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:30)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:30)
           at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:86)
           at com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:57)
           at com.hp.hpl.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:82)
           at com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:133)
           at com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:116)
           at com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:104)
           at com.hp.hpl.jena.sparql.resultset.TextOutput.format(TextOutput.java:51)
           at com.hp.hpl.jena.query.ResultSetFormatter.out(ResultSetFormatter.java:109)

      I am sure the query is correct (this query worked in Stardog Tuple store). any idea why this happens? Is there any restriction/configuration for query length in oracle?


      The query is similar to below


      "PREFIX............"
      +"SELECT........"
      +"WHERE {......"
      +"..............."
      //+"OPTIONAL { ?store have:stored ?milk }"                              
      //+"OPTIONAL { ?store have:balance ?bal }"
      +"}"
      when I uncomment any 'one' of the OPTIONAL line the query works.
      If I uncomment both of the OPTIONAL lines query fails.
        1 2 Previous Next