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

FILTER with '&&' and '||' not supported #273

Closed
niklas88 opened this issue Aug 12, 2019 · 3 comments
Closed

FILTER with '&&' and '||' not supported #273

niklas88 opened this issue Aug 12, 2019 · 3 comments
Assignees

Comments

@niklas88
Copy link
Member

niklas88 commented Aug 12, 2019

Trying to use the current QLever version with the new parser in conjunction with Aqqu results in an error e.g. for the following query.

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

SELECT (COUNT(?1) AS ?count) WHERE {
 fb:m.01jrbb fb:film.film.starring ?0 .
 ?0 fb:film.performance.character fb:m.02_29cg .
 ?0 fb:film.performance.actor ?1 .
 FILTER (?1 != fb:m.02_29cg && ?1 != fb:m.01jrbb)
}
LIMIT 30000

This is because it doesn't support &&. It also doesn't seem to support ||. It looks like this was actually not supported in the older parser either but that was so lax that the query was still accepted and whatever it did was good enough for Aqqu.

I'll change Aqqu to use separate FILTER but we should still support && and || in the future.

@niklas88 niklas88 added the bug label Aug 12, 2019
@niklas88 niklas88 added enhancement and removed bug labels Aug 12, 2019
@niklas88 niklas88 changed the title FILTER with '&&' and '||' not supported but needed by Aqqu FILTER with '&&' and '||' not supported Aug 12, 2019
@graue70
Copy link
Contributor

graue70 commented Sep 3, 2021

Workaround for && is using two separate FILTER statements (as Niklas mentioned).
I don't know an easy workaround for ||.

@ikabadzhov
Copy link

Shouldn't || come from DeMorgan's law ((A || B) == !(!A && !B)) or am I missing something? That is then, two FILTER statements checking the opposite condition, followed by some MINUS equivalent operator for QLever.

@hannahbast
Copy link
Member

The expression code has been completely rewritten last year and this now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants