Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPTIONAL and FILTER in a single query seem to create a conflict #89

Closed
niklas88 opened this issue Aug 8, 2018 · 2 comments
Closed

OPTIONAL and FILTER in a single query seem to create a conflict #89

niklas88 opened this issue Aug 8, 2018 · 2 comments
Assignees
Labels

Comments

@niklas88
Copy link
Member

niklas88 commented Aug 8, 2018

Trying to execute the following query (generated by Aqqu when running with the QLever backend)

PREFIX fb: <http://rdf.freebase.com/ns/>

SELECT DISTINCT ?0 ?0name WHERE {
 fb:m.06w2sn5 fb:imdb.topic.name_id ?0 .
 OPTIONAL {?0 fb:type.object.name ?0name} .
 FILTER (?0 != fb:m.06w2sn5)
} LIMIT 300

QLever can't find an execution plan. Removing either the OPTIONAL or the FILTER part results in a viable plan. @floriankramer any ideas?

Also we are missing a query with OPTIONAL in the end-to-end tests (also #68)!

@niklas88
Copy link
Member Author

This is a reproducer query on Scientists:

SELECT ?x ?y WHERE {
    ?x <is-a> <Scientist> .
    OPTIONAL { ?x <Spouse_(or_domestic_partner)> ?y } .
    FILTER (?x < <Ada_Lovelace>)
} ORDER BY ASC(?x)

removing either the OPTIONAL or FILTER results in a working query.

@niklas88
Copy link
Member Author

Ok, so it seems this is a problem during query optimization as running with the -u flag for not optimizing OPTIONAL works around the problem.

niklas88 added a commit that referenced this issue Aug 15, 2018
Fixes #89. Changes filers to copy the _isOptional flag from their input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants