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

Query with additional whitespace between 'NOT' and 'IN' or 'NOT' and 'EXISTS' fails with parse error #3957

Closed
abrokenjester opened this issue Jun 5, 2022 · 1 comment · Fixed by #3958
Assignees
Labels
🐞 bug issue is a bug 📦 sparql affects the SPARQL parser / engine
Milestone

Comments

@abrokenjester
Copy link
Contributor

Current Behavior

When parsing:

SELECT * WHERE { ?s ?p ?o. FILTER(?o NOT  IN (1, 2, 3)) }

or

SELECT * WHERE { ?s ?p ?o. FILTER NOT  EXISTS { ?s ?p ?o } }

parsing fails with a lexical error, caused by the additional whitespace between NOT and IN/EXISTS.

Expected Behavior

Parser should ignore additional whitespace between tokens, as per https://www.w3.org/TR/sparql11-query/#whitespace

Steps To Reproduce

No response

Version

4.0.1

Are you interested in contributing a solution yourself?

Yes

Anything else?

Split out from GH-3947

@abrokenjester abrokenjester added 🐞 bug issue is a bug 📦 sparql affects the SPARQL parser / engine labels Jun 5, 2022
@abrokenjester
Copy link
Contributor Author

Cause is that in our parser grammar, we treat NOT IN and NOT EXISTS as a single token.

abrokenjester added a commit that referenced this issue Jun 5, 2022
- regenerate parser from javacc using 7.0.4.
@abrokenjester abrokenjester added this to the 4.0.2 milestone Jun 5, 2022
@abrokenjester abrokenjester self-assigned this Jun 5, 2022
abrokenjester added a commit that referenced this issue Jun 5, 2022
- regenerate parser from javacc using 7.0.4.
hmottestad added a commit that referenced this issue Jun 6, 2022
…led properly by the JVM C2 compiler as evident in SPARQLParseBenchmark
hmottestad added a commit that referenced this issue Jun 6, 2022
hmottestad added a commit that referenced this issue Jun 6, 2022
GH-3957 split NOT IN and NOT EXISTS into separate tokens
patrickwyler pushed a commit to patrickwyler/rdf4j that referenced this issue Jun 20, 2022
patrickwyler pushed a commit to patrickwyler/rdf4j that referenced this issue Jun 20, 2022
… not be compiled properly by the JVM C2 compiler as evident in SPARQLParseBenchmark
patrickwyler pushed a commit to patrickwyler/rdf4j that referenced this issue Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug 📦 sparql affects the SPARQL parser / engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant