You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Put the two attached files (tolog-test.ltm and tolog-test.tl) in the
topicmaps directory of Omnigator.
2. Load the attached topic map (tolog-test.ltm) into Omnigator
3. Go to the Query page in Omnigator and type the following:
import "tolog-test.tl" as tt
tt:bn1($B,$B)?
4. You will (erroneously) get a result set consisting of two rows: one for
"dog" and one for "tree"
5. Now type in the equivalent expanded form of the query:
tt:bn($B,$I), tt:bn($I,$B)?
6. You will (correctly) get the empty result set.
What is the expected output? What do you see instead?
I expected the first query to have the same results as the second query but it
didn't.
Please use labels and text to provide additional information.
Original issue reported on code.google.com by dan.sp...@gmail.com on 16 Jul 2010 at 1:16
The problem here is that inside bn1() there is no indication that the user set
both parameters to the same variable. Therefore bn1() is evaluated as though
they were distinct, and, emerging on the other side, nothing is done to ensure
that they are indeed the same.
Ideally, we should bring the implicit $B = $N constraint with us from the
moment we start evaluating bn1. This could perhaps be done by not running bn1
as declared, but instead running
bn($B,$I), bn($I,$N), $B = $N
which the optimizer would automatically turn into
bn($B,$I), $B = $N, bn($I,$N)
which would again mean that the last bn would run with both columns bound, and
so the final broader-narrower predicate would filter instead of producing more
temporary results to be handled later.
Actually doing this in practice seems a bit tricky, though.
A simpler and more straightforward solution would be to fix the code that
translates the result of bn1 into the variables used in the calling context
(that is, the top-level query) to take into account the restriction that both
result rows that map to $B have to agree for a row to be acceptable. This
should have been there all along, of course.
Original comment by lar...@gmail.com on 19 Jul 2010 at 9:09
Original issue reported on code.google.com by
dan.sp...@gmail.com
on 16 Jul 2010 at 1:16Attachments:
The text was updated successfully, but these errors were encountered: