You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by "rvesse (via GitHub)" <gi...@apache.org> on 2026/09/25 11:11:22 UTC
[PR] Limit path flatten max length [jena]
rvesse opened a new pull request, #4258:
URL: https://github.com/apache/jena/pull/4258
When `TransformPathFlattern`/`TransformPathFlattenAlgebra` run they expand some paths of the form `:x :p{N,M} ?y` into multiple triple patterns within a BGP e.g. `:x :p ?q0 . ?q0 :p ?y` etc. This is safe for short values of `M` but can result in extremely large expansions if `M` is a large value. The large expansion is unlikely to make the query run any faster and a sufficiently large value can cause the query optimiser to fail with memory/stack issues. This commit introduces a new static control for the maximum expansion length capped at `10` and does not apply full expansion to anything longer than that.
----
- [x] Tests are included.
- [ ] Documentation change and updates are provided for the [Apache Jena website](https://github.com/apache/jena-site/)
- [x] Commits have been squashed to remove intermediate development commit messages.
- [x] Key commit messages start with the issue number (GH-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](https://www.apache.org/licenses/contributor-agreements.html).
----
See the [Apache Jena "Contributing" guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org
Re: [PR] Limit path flatten max length [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs merged PR #4258:
URL: https://github.com/apache/jena/pull/4258
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org
Re: [PR] Limit path flatten max length [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on PR #4258:
URL: https://github.com/apache/jena/pull/4258#issuecomment-5846207214
I agree with the intent.
just checking here but I think you mean `N`, not `M`.
`:p{N,M}`, it splits into `:p{N} / :p{0,M-N}` (`(pathN N :p)` and `(mod 0, M-N :p)`).
and the first part `pathN` is written triple patterns.
Unless there is evidence to the contrary, maybe the limit (`<10`) should be lower - e.g. 5.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org
Re: [PR] Limit path flatten max length [jena]
Posted by "rvesse (via GitHub)" <gi...@apache.org>.
rvesse commented on PR #4258:
URL: https://github.com/apache/jena/pull/4258#issuecomment-5869700354
> I agree with the intent.
>
> just checking here but I think you mean `N`, not `M`. `:p{N,M}`, it splits into `:p{N} / :p{0,M-N}` (`(pathN N :p)` and `(mod 0 M-N :p)`). and the first part `pathN` is written triple patterns.
Yes sorry, got the terminology confused
>
> Unless there is evidence to the contrary, maybe the limit (`<10`) should be lower - e.g. 5.
Yeah I think that's probably sensible, can adjust the PR accordingly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org
Re: [PR] Limit path flatten max length [jena]
Posted by "rvesse (via GitHub)" <gi...@apache.org>.
rvesse commented on PR #4258:
URL: https://github.com/apache/jena/pull/4258#issuecomment-5908387616
> Looks good - just needs the limit changing to 5.
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org