Hi Andy (and others),
we are currently in the process of replacing Blazegraph as the backend for
the Wikidata query service with Qlever. The current version of WDQS
supports a bunch of non-standard SPARQL features and syntax via
Blazegraph-plugins. For WDQSv2 we are mostly targetting SPARQL 1.1.
However, a few additional features will make it into the new version, to
make the transition easier for users of WDQSv1. One of these features is
named sub-queries. Qlever recently added support for them (see
https://docs.qlever.dev/named-subqueries/), which is nice. However, we
parse each query via Jena for some validation, prefix injection, and custom
service resolving.
This works fine for most cases, but when it comes to named sub-queries,
Jena will fail to parse additional syntax like "WITH %something AS { ...
}". This is expected of course, since it is not valid SPARQL.
AFAICT Jena does not provide a way to extend the SPARQL parser. Is there
any way this could be added? Or can you think of another way to do this
without the need to fork Jena itself?
Have a nice day.
Cheers,
Sebastian