Bug #150
OPTIONAL not returning expected results
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
fixed
Description
Unexpected results on an OPTIONAL clause. The toString on a query that demonstrates the problem is:
SELECT $o1 $o2 FROM http://mulgara.org/local/server1# WHERE ( optional ( optional ( and [$s urn:test:pred1 $o1 $-anon-ctx1] [$-anon-ctx1 rdf:type http://mulgara.org/mulgara#sailModel http://mulgara.org/mulgara#sailModel] ) ( and [$s urn:test:pred2 $o2 $-anon-ctx4] [$-anon-ctx4 rdf:type http://mulgara.org/mulgara#sailModel http://mulgara.org/mulgara#sailModel] ) ) ( and [$s urn:test:pred2 $o2 $-anon-ctx7] [$-anon-ctx7 rdf:type http://mulgara.org/mulgara#sailModel http://mulgara.org/mulgara#sailModel] [$s urn:test:pred3 $o1 $-anon-ctx10] [$-anon-ctx10 rdf:type http://mulgara.org/mulgara#sailModel http://mulgara.org/mulgara#sailModel] ) ) GIVEN 0 columns: (1 rows )
The data is generated with:
con.add(subj1, pred1, obj1); con.add(subj1, pred2, obj2); con.add(subj1, pred3, obj3);
The results we get are:
var: $o2 tuples: {$o2 $-anon-ctx10 $o1 $s $-anon-ctx7 (1 rows) [000037 000032 000039 000033 000032 ] }