Search in sources :

Example 6 with UpdateDrop

use of org.apache.jena.sparql.modify.request.UpdateDrop in project jena by apache.

the class ServerCtl 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;
        }
    }
}
Also used : UpdateProcessor(org.apache.jena.update.UpdateProcessor) Update(org.apache.jena.update.Update) UpdateDrop(org.apache.jena.sparql.modify.request.UpdateDrop)

Aggregations

UpdateDrop (org.apache.jena.sparql.modify.request.UpdateDrop)6 Update (org.apache.jena.update.Update)5 UpdateCreate (org.apache.jena.sparql.modify.request.UpdateCreate)3 UpdateProcessor (org.apache.jena.update.UpdateProcessor)3 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)2 Test (org.junit.Test)2 Dataset (org.apache.jena.query.Dataset)1 UpdateLoad (org.apache.jena.sparql.modify.request.UpdateLoad)1 UpdateException (org.apache.jena.update.UpdateException)1 After (org.junit.After)1