Reputation: 2766
According to a couple answers here and here, it seems that it might be possible to use the AST produced by RDF4J's SyntaxTreeBuilder to modify a parsed SPARQL query in memory and then serialize it back to a SPARQL string. However, I have not found any implementations that handle this serialization given the AST. The closest thing of course is the SparqlQueryRenderer but my use case demands working with the AST, not the SPARQL algebra model.
Naturally, I could imagine implementing a class that rebuilds the SPARQL query string as an AST visitor, but I would rather use a different library if it is not already supported or implemented for RDF4J.
Upvotes: 1
Views: 102