use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.
the class FusekiTestServer method resetServer.
/*package*/
static void resetServer() {
if (countServer.get() == 0)
throw new RuntimeException("No server started!");
if (CLEAR_DSG_DIRECTLY) {
Txn.executeWrite(dsgTesting, () -> dsgTesting.clear());
} else {
Update clearRequest = new UpdateDrop(Target.ALL);
UpdateProcessor proc = UpdateExecutionFactory.createRemote(clearRequest, serviceUpdate());
try {
proc.execute();
} catch (Throwable e) {
e.printStackTrace();
throw e;
}
}
}
use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.
the class AbstractTestUpdateGraphMgt method testCreateDrop2.
@Test
public void testCreateDrop2() {
DatasetGraph gStore = getEmptyDatasetGraph();
Update u = new UpdateCreate(graphIRI);
UpdateAction.execute(u, gStore);
u = new UpdateCreate(graphIRI, true);
UpdateAction.execute(u, gStore);
// JENA-1068
// assertTrue(gStore.containsGraph(graphIRI)) ;
assertTrue(graphEmpty(gStore.getGraph(graphIRI)));
u = new UpdateDrop(graphIRI);
UpdateAction.execute(u, gStore);
assertFalse(gStore.containsGraph(graphIRI));
u = new UpdateDrop(graphIRI, true);
UpdateAction.execute(u, gStore);
}
use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.
the class UpdateProgrammatic method main.
public static void main(String[] args) {
Dataset dataset = DatasetFactory.createTxnMem();
UpdateRequest request = UpdateFactory.create();
request.add(new UpdateDrop(Target.ALL));
request.add(new UpdateCreate("http://example/g2"));
request.add(new UpdateLoad("file:etc/update-data.ttl", "http://example/g2"));
UpdateAction.execute(request, dataset);
System.out.println("# Debug format");
SSE.write(dataset);
System.out.println();
System.out.println("# N-Quads: S P O G");
RDFDataMgr.write(System.out, dataset, Lang.NQUADS);
}
use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.
the class FusekiJdbcTestServer method resetServer.
/*package*/
static void resetServer() {
if (countServer.get() == 0)
throw new RuntimeException("No server started!");
if (CLEAR_DSG_DIRECTLY) {
Txn.executeWrite(dsgTesting, () -> dsgTesting.clear());
} else {
Update clearRequest = new UpdateDrop(Target.ALL);
UpdateProcessor proc = UpdateExecutionFactory.createRemote(clearRequest, serviceUpdate());
try {
proc.execute();
} catch (Throwable e) {
e.printStackTrace();
throw e;
}
}
}
use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.
the class TestRemoteEndpointResultsWithAuth method cleanupTest.
/**
* Clean up after each test by resetting the Fuseki instance
*/
@After
public void cleanupTest() {
Update clearRequest = new UpdateDrop(Target.ALL);
UpdateExecution.service(FusekiTestAuth.serviceUpdate()).update(clearRequest).httpClient(client).execute();
}
Aggregations