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 EQ returns no results sometimes #42

Closed
dewtoujii opened this issue Mar 5, 2018 · 0 comments
Closed

FILTER EQ returns no results sometimes #42

dewtoujii opened this issue Mar 5, 2018 · 0 comments
Assignees
Projects

Comments

@dewtoujii
Copy link

The following query works as expected and returns two cities named "Berlin":

PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?cityname ?countryname WHERE {
?city fb:type.object.type fb:location.citytown .
?city fb:type.object.name ?cityname .
?country fb:type.object.type fb:location.country .
?country fb:type.object.name ?countryname .
?city fb:location.location.containedby ?country .
FILTER(?cityname == "Berlin"@en) .
}

But filtering by country "Germany" does not work and return 0 results:

PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?cityname ?countryname WHERE {
?city fb:type.object.type fb:location.citytown .
?city fb:type.object.name ?cityname .
?country fb:type.object.type fb:location.country .
?country fb:type.object.name ?countryname .
?city fb:location.location.containedby ?country .
FILTER(?countryname == "Germany"@en) .
}

Changing the filter to NEQ (!=) seems to work because the result size reduces from 180549 (without any filter) to 174112:

PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?cityname ?countryname WHERE {
?city fb:type.object.type fb:location.citytown .
?city fb:type.object.name ?cityname .
?country fb:type.object.type fb:location.country .
?country fb:type.object.name ?countryname .
?city fb:location.location.containedby ?country .
FILTER(?countryname != "Germany"@en) .
}

Also the result sizes of the filters (<=) and (>=) add up to 180549

@niklas88 niklas88 added this to To do in QLever Aug 31, 2018
@niklas88 niklas88 moved this from To do to In progress in QLever Sep 3, 2018
@niklas88 niklas88 self-assigned this Sep 3, 2018
niklas88 added a commit that referenced this issue Sep 6, 2018
Actually use Operation::knownEmptyResult fixes #42
QLever automation moved this from In progress to Done Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
QLever
  
Done
Development

No branches or pull requests

2 participants