History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-589
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Enrico Minack
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

LuceneSail fails to evaluate GraphQuery due to bug in Native and Memory Store

Created: 20/Aug/08 02:50 PM   Updated: 20/Aug/08 03:11 PM
Component/s: Memory Sail, Native Sail
Affects Version/s: 2.1, 2.1.1, 2.1.2, 2.1.3
Fix Version/s: None


 Description   
The LuceneSail test for GraphQuery's (org.openrdf.sail.lucene.LuceneSailTest.testGraphQuery()) succeeds with Sesame 2.0, but fails with the Sesame 2.1 branch due to the following problem:

The LuceneSail evaluates this query using the underlying sail:

Distinct
   MultiProjection
      ProjectionElemList
         ProjectionElem "r" AS "subject"
         ProjectionElem "-const-6" AS "predicate"
         ProjectionElem "r2" AS "object"
      ProjectionElemList
         ProjectionElem "r" AS "subject"
         ProjectionElem "-const-7" AS "predicate"
         ProjectionElem "s" AS "object"
      Extension
         ExtensionElem (-const-6)
            ValueConstant (value=urn:predicate3)
         ExtensionElem (-const-7)
            ValueConstant (value=http://www.openrdf.org/contrib/lucenesail#score)
         Distinct
            Projection
               ProjectionElemList
                  ProjectionElem "r"
                  ProjectionElem "r2"
                  ProjectionElem "s"
               Join
                  Join
                     Join
                        SingletonSet
                        SingletonSet
                     SingletonSet
                  StatementPattern
                     Var (name=r)
                     Var (name=-const-5, value=urn:predicate3, anonymous)
                     Var (name=r2)

The Statement pattern provides bindings for r2, whereas the values for r and s comes via the given binding set. In the end, the MultiProjection should generate statements out of the r2 and the given r and s. The bindings are
 r=urn:subject3
 s="0.8784157"^^http://www.w3.org/2001/XMLSchema#float

during
 optimizerList.optimize(tupleExpr, dataset, bindings);
in the underlying sail (Memory or Native), the variable
 Var (name=r)
is optimized to
 Var (name=r, value=urn:subject3)

but since s is not in the tree, it is not injected into the tree. Then,
 iter = strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
is called, so that the given bindings are not further used for evaluation. This
is the reason why the s in
      ProjectionElemList
         ProjectionElem "r" AS "subject"
         ProjectionElem "-const-7" AS "predicate"
         ProjectionElem "s" AS "object"

gets not filled with the value given via the bindings.


changing
 iter = strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
to
 iter = strategy.evaluate(tupleExpr, bindings);
lets the test pass and all sesame tests still succeed.

With this fix, LuceneSail can be set to use Sesame 2.1.

 All   Comments   Change History      Sort Order:
Comment by Enrico Minack [20/Aug/08 03:02 PM]
I added a test to the LuceneSail project:
  src/test/java/org/openrdf/sail/lucene/GraphQueryTest.java
This is independent of the LuceneSail, suceeds with Sesame 2.0 but fails with Sesame2.1. Simply set the sesame version to 2.1 in the LuceneSail pom.file and run the tests.

Comment by James Leigh [20/Aug/08 03:03 PM]
This was introduced as part of a fix to SES-541: Externally set bindings are erroneously included in query result; extended RDFStoreTest to verify SES-541.

http://www.openrdf.org/issues/browse/SES-541
http://repo.aduna-software.org/viewvc?view=rev&revision=6474

Comment by Enrico Minack [20/Aug/08 03:11 PM]
So this behaviour is desired?