0

I am trying to implement "dry run" functionality in my application for users who want to see what the result of a SPARQL Update query would be. Does RDF4J provide an easy way to convert an Update query to a Construct query so that I can display the potential results to the user. Ideally I would be able to convert the insert/delete portions of the query into two separate construct queries utilizing the where clause of their query.

B. Smith
  • 1,063
  • 4
  • 14
  • 23
  • use the [parser](https://rdf4j.org/javadoc/3.2.0/org/eclipse/rdf4j/query/parser/QueryParserUtil.html#parseUpdate-org.eclipse.rdf4j.query.QueryLanguage-java.lang.String-java.lang.String-) and extract the `INSERT` or `DELETE` part from the [`UpdateExpr`](https://rdf4j.org/javadoc/3.2.0/org/eclipse/rdf4j/query/algebra/UpdateExpr.html), then create the CONSTRUCT query – UninformedUser Jul 10 '21 at 03:17
  • @UninformedUser from my understanding, `parsedUpdate.getUpdateExprs` just gives you the query algebra, not the actual query string for the update portion. Once I have that query algebra, how do I convert it to a construct query? – B. Smith Jul 12 '21 at 21:44

0 Answers0