does ParametrizedSparqlString validate input query? I would go with an approach that compiles into something that is fast where only bindings are checked at runtime.
it does so at the textual level, https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ParameterizedSparqlString.html
I’m not sure where the query parsing is actually done, I assume only when you call .asQuery on the ParameterizedSparqlString
YeSQL applies another instaparse BNF to the SQL itself to do substitutions
was thinking of abusing the BNF from Jena itself for a similar purpose, but it will add to the complexity