afs commented on code in PR #2152:
URL: https://github.com/apache/jena/pull/2152#discussion_r1442695710
##########
jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/UpdateBuilderTest.java:
##########
@@ -491,6 +495,38 @@ public void testInsertAndDeleteWithVariableNode() {
assertEquals(builder.makeNode("foo"), t.getObject());
assertTrue(Var.isVar(t.getPredicate()));
}
+
+ @Test
+ public void testInsertAndDeleteWithGraphClauses() {
+ // Test based upon GH-2150
+ // Simplified slightly as the actual URIs used were irrelevant to the
issue
+ RDFConnection conn = RDFConnection.connect(DatasetFactory.create());
+
+ UpdateBuilder updateBuilder = new UpdateBuilder();
+ updateBuilder.addInsert(g, s, p, o);
+
+ SelectBuilder where = new SelectBuilder();
+ where.addWhere(s, p, o);
+ updateBuilder.addGraph(g, where);
+
+
+ SelectBuilder notExists = new SelectBuilder();
+ notExists.addWhere(s, p, o);
+ SelectBuilder where2 = new SelectBuilder();
+ where2.addFilter(where2.getExprFactory().notexists(notExists));
+ updateBuilder.addGraph(g, where2);
+
+ UpdateRequest updateRequest = updateBuilder.buildRequest();
+
+ conn.begin(ReadWrite.WRITE);
+ try {
+ conn.update(updateRequest);
+ conn.commit();
+ } finally {
+ conn.end();
+ }
+ }
+
Review Comment:
Updated to an shorter example - `SELECT * WHERE { FILTER(true) }`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]