Repository navigation
Conversation
afs
reviewed
Oct 10, 2026
afs
reviewed
Oct 10, 2026
When given a poorly formed regular expression depending on data the regular expression matching can take a long time to compute. This commit modifies the expression engine so that regular expression based functions time bound evaluation to avoid runaway expressions.
Ensures that the ARQ property function strSplit time bounds regular expression splitting time
REPLACE uses regular expressions to perform replacements so also impose regular expression limits on its evaluation
Shex regular expression constraints could run too long depending on the regular expression and data combinations. This commit uses the shared RegexEngine.timeBounded() mechanism to limit evaluation time. Also disables a test scenario where optimisation effects means that the test does not reliably fail so is not a useful stable test.
Adds new SparqlLimits, which replaces previously introduced MathLimits, as a central location for configuring relevant limit controls and generic enforcement functions. Also simplifies some test case names as requested
Member
Author
|
@afs I've consolidated the various limit controls from this and related PRs into a new |
rvesse
marked this pull request as ready for review
November 10, 2026 09:17
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.
Various SPARQL functions and Jena provided extension functions provide access to regular expressions. Depending on the expression and data combination some regular expressions can take too long to run leading to slow queries. This PR bounds regular expression evaluation time via statically controlled limits so regular expressions that take too long to run are aborted with an
ExprEvalException.As ShEx also uses the same Jena subsystem it was also upgraded to apply limits.
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.