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

NotImplemented Exception in OpTopN

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Jena 3.0.1
    • Fix Version/s: Jena 3.0.1
    • Component/s: ARQ
    • Labels:
      None

      Description

      A NotImplemented exception is thrown in 3.0.1-SNAPSHOT for queries that contain a subquery with order by/limit (i.e. TopN).

      See unit test testTopN in attachment for example.

      Example query that fails:

      PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX app: <http://example.org/>
      select * 
      where { 
        { 
          select * 
          where { 
            ?id rdfs:label ?label . 
          } 
          order by ASC(?label)  
          limit 5 
        } 
        ?id a app:Entity .  
      }
      
      org.apache.jena.atlas.lib.NotImplemented
      	at org.apache.jena.sparql.engine.main.VarFinder$VarUsageVisitor.no(VarFinder.java:320)
      	at org.apache.jena.sparql.engine.main.VarFinder$VarUsageVisitor.visit(VarFinder.java:333)
      	at org.apache.jena.sparql.algebra.op.OpTopN.visit(OpTopN.java:50)
      	at org.apache.jena.sparql.engine.main.VarFinder$VarUsageVisitor.apply(VarFinder.java:81)
      	at org.apache.jena.sparql.engine.main.VarFinder.<init>(VarFinder.java:68)
      	at org.apache.jena.sparql.engine.main.JoinClassifier.check(JoinClassifier.java:91)
      	at org.apache.jena.sparql.engine.main.JoinClassifier.isLinear(JoinClassifier.java:66)
      	at org.apache.jena.sparql.engine.main.JoinClassifier.isLinear(JoinClassifier.java:38)
      	at org.apache.jena.sparql.algebra.optimize.TransformJoinStrategy.transform(TransformJoinStrategy.java:39)
      	at org.apache.jena.sparql.algebra.TransformWrapper.transform(TransformWrapper.java:71)
      	at org.apache.jena.sparql.algebra.op.OpJoin.apply(OpJoin.java:75)
      	at org.apache.jena.sparql.algebra.Transformer$ApplyTransformVisitor.visit2(Transformer.java:366)
      	at org.apache.jena.sparql.algebra.OpVisitorByType.visit(OpVisitorByType.java:80)
      	at org.apache.jena.sparql.algebra.op.OpJoin.visit(OpJoin.java:78)
      	at org.apache.jena.sparql.algebra.OpWalker$WalkerVisitor.visit2(OpWalker.java:107)
      	at org.apache.jena.sparql.algebra.OpVisitorByType.visit(OpVisitorByType.java:80)
      	at org.apache.jena.sparql.algebra.op.OpJoin.visit(OpJoin.java:78)
      	at org.apache.jena.sparql.algebra.OpWalker.walk(OpWalker.java:43)
      	at org.apache.jena.sparql.algebra.OpWalker.walk(OpWalker.java:38)
      	at org.apache.jena.sparql.algebra.Transformer.applyTransformation(Transformer.java:147)
      	at org.apache.jena.sparql.algebra.Transformer.transformation(Transformer.java:140)
      	at org.apache.jena.sparql.algebra.Transformer.transformation(Transformer.java:129)
      	at org.apache.jena.sparql.algebra.Transformer.transformation(Transformer.java:123)
      	at org.apache.jena.sparql.algebra.Transformer.transform(Transformer.java:56)
      	at org.apache.jena.sparql.algebra.Transformer.transformSkipService(Transformer.java:86)
      	at org.apache.jena.sparql.algebra.Transformer.transformSkipService(Transformer.java:68)
      	at org.apache.jena.sparql.algebra.optimize.Optimize.apply(Optimize.java:277)
      	at org.apache.jena.sparql.algebra.optimize.Optimize.rewrite(Optimize.java:212)
      	at org.apache.jena.sparql.algebra.optimize.Optimize.optimize(Optimize.java:78)
      	at org.apache.jena.sparql.algebra.Algebra.optimize(Algebra.java:65)
      	at org.apache.jena.sparql.engine.main.QueryEngineMain.modifyOp(QueryEngineMain.java:67)
      	at org.apache.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:101)
      	at org.apache.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:87)
      	at org.apache.jena.sparql.engine.main.QueryEngineMain$QueryEngineMainFactory.create(QueryEngineMain.java:91)
      	at org.apache.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:578)
      	at org.apache.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:522)
      	at org.apache.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:563)
      	at org.apache.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:183)
      	at arq.TestSubQueryTopN.testTopN(TestSubQueryTopN.java:135)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      

        Attachments

        1. TestSubQueryTopN.java
          5 kB
          Stephen Allen

          Activity

            People

            • Assignee:
              andy Andy Seaborne
              Reporter:
              sallen Stephen Allen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: