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 can't deal with a literal before the variable #460

Closed
graue70 opened this issue Sep 3, 2021 · 2 comments
Closed

FILTER can't deal with a literal before the variable #460

graue70 opened this issue Sep 3, 2021 · 2 comments

Comments

@graue70
Copy link
Contributor

graue70 commented Sep 3, 2021

PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?spouse ?date WHERE {
  wd:Q76 p:P26 ?spouse_qualifier .
  ?spouse_qualifier pq:P580 ?date .
  ?spouse_qualifier ps:P26 ?spouse .
  FILTER("2000-01-01"^^xsd:dateTime <= ?date)
}

should filter the one marriage of Obama because it was before 2000. However, the marriage is not filtered out. The query incorrectly gives one result.
The QLever UI shows the following error for the filter line:

Error while collecting suggestions:
ParseException, cause: ?qleverui_entity is not a valid relation for a filter.

If I change the filter to the equivalent FILTER(?date >= "2000-01-01"^^xsd:dateTime), QLever works correctly and filters out the result.
The QLever UI gives the following error for the filter line:

Error while collecting suggestions:

ParseException, cause: Multiple regex filters concatenated via || must currently all be PREFIX filters

The error seems to make no sense because concatenating FILTERs is not supported (see #273).

@joka921
Copy link
Member

joka921 commented Sep 4, 2021

As you already found out, qlever currently only supports relational filters when the left hand side is a variable, and not the (equivalent) commutative reformulation.

The Exception makes no sense in this case, qlever currently supports || if all the filters are prefix filters, but there is no concatenation here.

In general we are currently working on a more general implementation of Expressions, which will also improve the Filter's capabilities.

Please let me know, if you need a specific filter for your work, that is currently not supported (also not by rewriting the query), then I can possibly provide a quick hack.

@hannahbast
Copy link
Member

Moved to #615

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

No branches or pull requests

3 participants