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

GH-2102: Parse and accept [], with warning #2118

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

afs
Copy link
Member

@afs afs commented Dec 1, 2023

GitHub issue resolved #2102. This closes #2102.

Pull request Description:
This change causes the parser to accept, with a warning, the charcater [ and ].

This makes it behave the same as RIOT data syntax parsing.


  • Tests are included.
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx, or if in JIRA, JENA-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.

@afs afs added SPARQL improvement Code improvement labels Dec 1, 2023
@afs afs self-assigned this Dec 1, 2023
@afs
Copy link
Member Author

afs commented Dec 1, 2023

Best reviewed in the Github UI with "hide whitepace".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it currently testing that if ( iriStr.contains(" ") ) {? I thought we would need an IRI with space(s), but I didn't find it in this test. The rest looks good.

@afs
Copy link
Member Author

afs commented Dec 1, 2023

Tests added because "why not?"

{, } and space fail for a different reason to [ and ] - the parser grammar does not accept them.

The way the SPARQL grammar is written is to have a token rule that excludes impossible characters, then expect detailed checking.

[ and ] are possible as IPv6 address in the host part. They incorrectly turn up when people put XSLT predicates in the path/query/fragment parts.

@afs afs merged commit 8cc0a5e into apache:main Dec 1, 2023
@afs afs deleted the gh2102-sparql-iri branch December 1, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Code improvement SPARQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why does a query that works in Jena 3.16 but throw an error in Jena 4.10?
2 participants