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

Key: SES-681
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Arjohn Kampman
Reporter: Johann Petrak
Votes: 0
Watchers: 2
Operations

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

TupleQuery.setBinding does not work as expected

Created: 30/Sep/09 12:40 PM   Updated: 03/Nov/10 10:09 AM
Component/s: Query Engine
Affects Version/s: 2.3-pr1
Fix Version/s: None


 Description   
If I do a setBinding for variable yyy1 in this prepared SERQL query:

SELECT * FROM {yyy1} rdf:type {Y} rdf:type {<someURI>}

everything works fine, but if I try to do a setBinding for variable yyy1
in this query:

SELECT X FROM {X} rdf:type {} rdf:type {<someURI>} WHERE X = yyy1

the query produes no result even if the same query where I substitute yyy1 in the query string before I prepare the query produces a result.

In general, queries where I try to substitute a variable in where condition using setBinding seem to fail/produce no result but they do work as expected if I execute the same query with the variable replaced in the query string.

I have not investigated yet if the same problem also affects SPARQL queries (since I need to be able to search for blank node IDs too and that does not work with SPARQL)

 All   Comments   Change History      Sort Order:
Comment by Johann Petrak [30/Sep/09 04:02 PM]
As it turns out this only occurs with a OWLIM3 (beta7 and beta11 tested) SAIL.

Comment by Ivan Peikov [12/Oct/09 05:03 PM]
The issue appears to be inside org.openrdf.query.algebra.evaluation.iterator.FilterIterator.accept(BindingSet bindings) method where only the scopeBindingNames are retained for the condition check. In our case the scope binding names are the variable names from the triple pattern (X,Y,Z) and yyy1 is thus ignored.
IMO this is a bug, because scope variable bindings might come not only from triple pattern search but externally as well (e.g. setBindings()).

Comment by Arjohn Kampman [19/Oct/09 11:25 AM]
I have just verified this issue. The memory and native store are not affected by this bug because they 'inline' the externally supplied bindings as part of their query optimization process. They actually supply and empty binding set to the query evaluation after that.

This inlining optimization, however, looks like the only solution to properly evaluation a query model in a depth-first fashion. After fixing this issue I have tried to verify the fix by disabling the inlining optimization and supplying the bindings directly to the evaluation engine. The query produced the correct number of results after applying the fix, but it also included the external bindings as part of the query solution.

I don't see an easy solution for this in the query engine. It's probably a lot easier to apply the inlining optimizer in Owlim as well(?).

Comment by Johann Petrak [03/Nov/10 10:09 AM]
This appears to be fixed in SwiftOWLIM 3.3 SAIL (I have not tested it with BigOWLIM)