Class PathTextUtils
java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.PathTextUtils
Depth-aware helpers for property path text handling. Centralizes common logic used by transforms to avoid duplication
and keep precedence/parentheses behavior consistent.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringapplyQuantifier(String inner, char quant) Apply a quantifier to a path, wrapping only when the inner is not atomic.static booleanhasTopLevel(String s, char ch) Return true if the string has the given character at top level (not inside parentheses).static booleanTrue when the path text is atomic for grouping: no top-level '|' or '/', already wrapped, or NPS/inverse form.static booleanTrue if the text is wrapped by a single pair of outer parentheses.splitTopLevel(String in, char sep) Split by a separator at top level, ignoring nested parentheses.static StringRemove outer parens when they enclose the full string, otherwise return input unchanged.static StringwrapForInverse(String inner) Prefix with '^', wrapping if the inner is not atomic.static StringwrapForSequence(String part) When using a part inside a sequence with '/', only wrap it if it contains a top-level alternation '|'.
-
Method Details
-
hasTopLevel
Return true if the string has the given character at top level (not inside parentheses). -
isWrapped
True if the text is wrapped by a single pair of outer parentheses. -
isAtomicPathText
True when the path text is atomic for grouping: no top-level '|' or '/', already wrapped, or NPS/inverse form. -
wrapForSequence
-
wrapForInverse
-
applyQuantifier
-
trimSingleOuterParens
-
splitTopLevel
-