GH 1868 zero-length paths must not match absent nodes#4032
Open
ThomasThelen wants to merge 2 commits into
Open
GH 1868 zero-length paths must not match absent nodes#4032ThomasThelen wants to merge 2 commits into
ThomasThelen wants to merge 2 commits into
Conversation
rvesse
approved these changes
Jul 2, 2026
rvesse
left a comment
Member
There was a problem hiding this comment.
Fix looks quite straightforward and elegant to me, it's been a while since I've been delving in the SPARQL engine internals so I will leave this open for now to give others with fresher eyes chance to review before merging
Member
|
I'd like time to explore all the possibilities with complex paths to convince myself that pulling the test up to the evaluation is always correct. (Finding clear "think" time is hard.) |
afs
reviewed
Jul 2, 2026
| protected static final int hashShortest = 0x205 ; | ||
|
|
||
|
|
||
| // Return true if this path can match in zero steps |
Member
There was a problem hiding this comment.
This isn't necessary because it is a default method in the interface.
(and it generates a warning because there is no @Override.)
Co-authored-by: Andy Seaborne <andy@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub issue resolved #1868
Pull request Description:
This is a bit of an experimental path taken. Initially I had done this with a longer walking of the AST and realized that the performance hit would be too big because
evalGroundedPathgets called on each binding.Instead, the approach that I took here is to hardcode the zero length component state as part of the various path classes, culminating in the dispatch to evalGroundedPath. This should get called once rather than the n times for each row in my previous AST implementation.
Happy to provide performance tests, address feedback, or close this if it's a bit far fetched.
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.
See the Apache Jena "Contributing" guide.