[Mulgara-dev] No such variable

James Leigh james-nospam at leighnet.ca
Wed Apr 30 23:28:40 UTC 2008


Hi Andrae,

I sometimes get an exception on a query depending on the contents of the
rdf store. If the rdf store contains 100000 lubm triples I get an
exception, but if it contains 200000 I don't. Paul says this is an
intentional decision made by Simon. However, Paul and I feel that this
query's validity should not be determined by the contents of the rdf
store.

What do you think?

See below for more details on the query (start from the bottom).

Cheers,
James

On Wed, 2008-04-30 at 17:09 -0500, Paul Gearon wrote:
> Ah yes.
> 
> This was actually an intentional decision made by Simon Raboczi. I
> disagreed with it. I think Andrae agreed. Perhaps you should ask
> Andrae?
> 
> I'd *like* to see empty Tuples still contain the original variable
> names. Not having it creates problems just like this. If Andrae agrees
> with me, then I'll go and see what I can do about it.
> 
> Paul
> 
> On Wed, Apr 30, 2008 at 4:52 PM, James Leigh <james at leighnet.ca> wrote:
> > Here is the problem: one side has no results.
> >
> >  The arg to append is:
> >         [
> >         {(0 rows)
> >         },
> >         {$U      $-const-2  $-anon-ctx16  $-anon-value18  $-anon-value17  $X      (unevaluated, 4 rows max)
> >         [002692  000199  000008  000007  000002  002689  ]
> >         [002692  000199  000008  000007  000002  005194  ]
> >         [002692  000199  000008  000007  000002  019960  ]
> >         [002692  000199  000008  000007  000002  021706  ]
> >         }]
> >
> >  This would explain, why I didn't see it with a larger dataset.
> >
> >  This looks like a bug to me, what do you think Paul? Can you try and
> >  reproduce it?
> >
> >  James
> >
> >
> >
> >  On Wed, 2008-04-30 at 16:07 -0500, Paul Gearon wrote:
> >  > I know the condition that is causing the exception, but I can't say I
> >  > know why that condition is happening.
> >  >
> >  > It looks like it's evaluated the whole query, and is projecting the
> >  > results to the SELECT list. However, the variables in the Tuples don't
> >  > match the subset the projection is looking for.
> >  >
> >  > It would SEEM that the OR is dropping the variables (which it
> >  > shouldn't do), but I can't tell for sure.
> >  >
> >  > The way I track these things down is with a debugger. I'd put a
> >  > breakpoint in org.mulgara.resolvers.DefaultConstraintHandlers, line
> >  > 162 (that's the line in "trunk". It's in the handler for
> >  > ConstraintDisjunction.class). When it's coming in, the constraints
> >  > appearing in the list should be a pair of ConstraintConjunctions,
> >  > which should contain all your variables. After returning from the
> >  > TuplesOperations.append(List), the tuples is supposed to have all of
> >  > the variables from all of its operands.
> >  >
> >  > This isn't code that I changed, so I don't know what's going on for you here.
> >  >
> >  > Paul
> >  >
> >  > On Wed, Apr 30, 2008 at 1:08 PM, James Leigh <james at leighnet.ca> wrote:
> >  > > Spoke to soon. I am getting an error with the patch. I believe this
> >  > >  query worked before.
> >  > >
> >  > >  Any ideas?
> >  > >  James
> >  > >  ---
> >  > >  SELECT
> >  > >  $X
> >  > >  $-const-1=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#doctoralDegreeFrom
> >  > >  $U=http://www.University1.edu
> >  > >  $-anon-ctx13
> >  > >  $-const-2=http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#undergraduateDegreeFrom
> >  > >  $-anon-ctx16
> >  > >  FROM http://mulgara.org/local/server1#
> >  > >  WHERE
> >  > >  ( or
> >  > >  ( and
> >  > >  [$X $-const-1 $U $-anon-ctx13]
> >  > >  [$-const-1 <mulgara:is> http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#doctoralDegreeFrom $_from]
> >  > >  [$U <mulgara:is> http://www.University1.edu $_from]
> >  > >
> >  > >  [$-anon-ctx13 $-anon-value14 $-anon-value15 $-anon-value15]
> >  > >  [$-anon-value14 <mulgara:is> http://www.w3.org/1999/02/22-rdf-syntax-ns#type $_from]
> >  > >  [$-anon-value15 <mulgara:is> http://mulgara.org/mulgara#sailModel $_from]
> >  > >  [$-anon-value15 <mulgara:is> http://mulgara.org/mulgara#sailModel $_from]
> >  > >  )
> >  > >  ( and
> >  > >  [$X $-const-2 $U $-anon-ctx16]
> >  > >  [$-const-2 <mulgara:is> http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#undergraduateDegreeFrom $_from]
> >  > >  [$U <mulgara:is> http://www.University1.edu $_from]
> >  > >
> >  > >  [$-anon-ctx16 $-anon-value17 $-anon-value18 $-anon-value18]
> >  > >  [$-anon-value17 <mulgara:is> http://www.w3.org/1999/02/22-rdf-syntax-ns#type $_from]
> >  > >  [$-anon-value18 <mulgara:is> http://mulgara.org/mulgara#sailModel $_from]
> >  > >  [$-anon-value18 <mulgara:is> http://mulgara.org/mulgara#sailModel $_from]
> >  > >  )
> >  > >  ) GIVEN 0 columns:
> >  > >  (1 rows
> >  > >  )
> >  > >
> >  > >
> >  > >  org.mulgara.query.TuplesException: No such variable $-anon-ctx13 in tuples [$-anon-ctx16, $X] (class org.mulgara.resolver.AppendAggregateTuples)
> >  > >         at org.mulgara.store.tuples.AbstractTuples.getColumnIndex(AbstractTuples.java:346)
> >  > >         at org.mulgara.resolver.SubqueryAnswer.assignVariables(SubqueryAnswer.java:154)
> >  > >         at org.mulgara.resolver.SubqueryAnswer.<init>(SubqueryAnswer.java:125)
> >  > >         at org.mulgara.resolver.DatabaseOperationContext.doQuery(DatabaseOperationContext.java:810)
> >  > >         at org.mulgara.resolver.QueryOperation.execute(QueryOperation.java:138)
> >  > >         at org.mulgara.resolver.MulgaraInternalTransaction.execute(MulgaraInternalTransaction.java:569)
> >  > >         at org.mulgara.resolver.DatabaseSession.execute(DatabaseSession.java:639)
> >  > >         at org.mulgara.resolver.DatabaseSession.query(DatabaseSession.java:402)
> >  > >         at org.mulgara.sail.MulgaraTripleSource.evaluate(MulgaraTripleSource.java:87)
> >  > >         at org.mulgara.sail.MulgaraEvaluationStrategy.evaluate(MulgaraEvaluationStrategy.java:40)
> >  > >         at org.mulgara.sail.MulgaraEvaluationStrategy.evaluate(MulgaraEvaluationStrategy.java:32)
> >  > >         at org.openrdf.query.algebra.evaluation.iterator.LeftJoinIterator.<init>(LeftJoinIterator.java:56)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:495)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:454)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:161)
> >  > >         at org.mulgara.sail.MulgaraEvaluationStrategy.evaluate(MulgaraEvaluationStrategy.java:33)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:393)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:341)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:158)
> >  > >         at org.mulgara.sail.MulgaraEvaluationStrategy.evaluate(MulgaraEvaluationStrategy.java:33)
> >  > >         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl$5.createIteration(EvaluationStrategyImpl.java:532)
> >  > >         at info.aduna.iteration.DelayedIteration.hasNext(DelayedIteration.java:61)
> >  > >         at info.aduna.iteration.UnionIteration.getNextElement(UnionIteration.java:60)
> >  > >         at info.aduna.iteration.UnionIteration.getNextElement(UnionIteration.java:71)
> >  > >         at info.aduna.iteration.LookAheadIteration.lookAhead(LookAheadIteration.java:79)
> >  > >         at info.aduna.iteration.LookAheadIteration.hasNext(LookAheadIteration.java:49)
> >  > >         at info.aduna.iteration.IterationWrapper.hasNext(IterationWrapper.java:57)
> >  > >         at info.aduna.iteration.FilterIteration.findNextElement(FilterIteration.java:67)
> >  > >         at info.aduna.iteration.FilterIteration.hasNext(FilterIteration.java:43)
> >  > >         at info.aduna.iteration.ConvertingIteration.hasNext(ConvertingIteration.java:62)
> >  > >         at info.aduna.iteration.IterationWrapper.hasNext(IterationWrapper.java:57)
> >  > >         at info.aduna.iteration.FilterIteration.findNextElement(FilterIteration.java:67)
> >  > >         at info.aduna.iteration.FilterIteration.hasNext(FilterIteration.java:43)
> >  > >         at info.aduna.iteration.IterationWrapper.hasNext(IterationWrapper.java:57)
> >  > >         at org.openrdf.sail.helpers.SailBaseIteration.hasNext(SailBaseIteration.java:47)
> >  > >         at org.openrdf.query.impl.TupleQueryResultImpl.hasNext(TupleQueryResultImpl.java:90)
> >  > >         at org.openrdf.benchmark.adaptors.QueryResultAdaptor.next(QueryResultAdaptor.java:17)
> >  > >         at edu.lehigh.swat.bench.ubt.Test.testQueryOneKb(Test.java:288)
> >  > >         at edu.lehigh.swat.bench.ubt.Test.doTestQuery(Test.java:237)
> >  > >         at org.openrdf.benchmark.tests.LubmTest.runTest(LubmTest.java:141)
> >  > >         at junit.framework.TestCase.runBare(TestCase.java:127)
> >  > >         at junit.framework.TestResult$1.protect(TestResult.java:106)
> >  > >         at junit.framework.TestResult.runProtected(TestResult.java:124)
> >  > >         at junit.framework.TestResult.run(TestResult.java:109)
> >  > >         at junit.framework.TestCase.run(TestCase.java:118)
> >  > >         at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> >  > >         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> >  > >         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> >  > >         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> >  > >         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> >  > >         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> >  > >
> >  > >
> >  > >
> >  >
> >
> >
> 




More information about the Mulgara-dev mailing list