/** Create an UpdateProcessor that sends the update request to a remote SPARQL Update service. * @param updateRequest Updates * @param remoteEndpoint Endpoint URL * @return Remote Update processor */ public static UpdateProcessor createRemote(UpdateRequest updateRequest, String remoteEndpoint) { return createRemote(updateRequest, remoteEndpoint, null, null, null) ; }
/** Create an UpdateProcessor that sends the update request to a remote SPARQL Update service. * @param updateRequest Updates * @param remoteEndpoint Endpoint URL * @param client HTTP client * @return Remote Update processor */ public static UpdateProcessor createRemote(UpdateRequest updateRequest, String remoteEndpoint, HttpClient client) { return createRemote(updateRequest, remoteEndpoint, null, client) ; }
/** Create an UpdateProcessor that sends the update request to a remote SPARQL Update service. * @param updateRequest Updates * @param remoteEndpoint Endpoint URL * @param client HTTP client * @param httpContext HTTP Context * @return Remote Update processor */ public static UpdateProcessor createRemote(UpdateRequest updateRequest, String remoteEndpoint, HttpClient client, HttpContext httpContext) { return createRemote(updateRequest, remoteEndpoint, null, client, httpContext) ; }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @param context Context * @param client HTTP client * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint, Context context, HttpClient client) { return createRemote(update, remoteEndpoint, context, client, null); }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @param client HTTP client * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint, HttpClient client) { return createRemote(update, remoteEndpoint, client, null); }
/** Create an UpdateProcessor that sends the update request to a remote SPARQL Update service. * @param updateRequest Updates * @param remoteEndpoint Endpoint URL * @param context Context * @return Remote Update processor */ public static UpdateProcessor createRemote(UpdateRequest updateRequest, String remoteEndpoint, Context context) { return createRemote(updateRequest, remoteEndpoint, context, null) ; }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @param context Context * @param client HTTP client * @param httpContext HTTP Context * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint, Context context, HttpClient client, HttpContext httpContext) { return createRemote(new UpdateRequest(update), remoteEndpoint, context, client) ; }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint) { return createRemote(new UpdateRequest(update), remoteEndpoint, null, null, null) ; }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @param client HTTP client * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint, HttpClient client, HttpContext httpContext) { return createRemote(new UpdateRequest(update), remoteEndpoint, null, client, httpContext) ; }
private void exec(String endpoint, UpdateRequest req) { UpdateProcessor proc = UpdateExecutionFactory.createRemote(req, endpoint) ; proc.execute() ; }
/** Create an UpdateProcessor that sends the update to a remote SPARQL Update service. * @param update Updates * @param remoteEndpoint Endpoint URL * @param context Context * @return Remote Update processor */ public static UpdateProcessor createRemote(Update update, String remoteEndpoint, Context context) { return createRemote(new UpdateRequest(update), remoteEndpoint, context, null) ; }
private void exec(String endpoint, UpdateRequest req) { UpdateProcessor proc = UpdateExecutionFactory.createRemote(req, endpoint) ; proc.execute() ; }
/** * Execute a SPARQL Update query. * * @param updateQuery */ public void executeUpdateQuery(String updateQuery) { log.debug("Update SPARQL Endpoint: {}", sparqlEndpoint); log.debug("Execute query: {}", updateQuery); UpdateRequest query = UpdateFactory.create(updateQuery); UpdateProcessRemote riStore = (UpdateProcessRemote) UpdateExecutionFactory.createRemote(query, sparqlEndpoint); riStore.execute(); }
/** * executes a SPARQL INSERT into the triplestore * * TODO: needs to be extracted * * @return map */ public static void loadTripleStore(final String sparqlQuery, final URI loadEndpoint) { final UpdateRequest request = UpdateFactory.create(sparqlQuery); final UpdateProcessor proc = UpdateExecutionFactory.createRemote(request, loadEndpoint.toString()); proc.execute(); }
/*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;} } }
/*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;} } }
/*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;} } }
/** * Clean up after each test by resetting the Fuseki instance */ @After public void cleanupTest() { Update clearRequest = new UpdateDrop(Target.ALL) ; UpdateProcessor proc = UpdateExecutionFactory.createRemote(clearRequest, FusekiTestAuth.serviceUpdate(), client) ; proc.execute() ; }
@Override protected UpdateProcessor createUpdateProcessor(UpdateRequest u) { UpdateProcessRemoteBase proc = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(u, this.remoteConn.getUpdateEndpoint()); // Apply HTTP settings if (this.client != null) { proc.setClient(this.client); } // Apply default and named graphs if appropriate if (this.remoteConn.getUsingGraphURIs() != null) { proc.setDefaultGraphs(this.remoteConn.getUsingGraphURIs()); } if (this.remoteConn.getNamedGraphURIs() != null) { proc.setNamedGraphs(this.remoteConn.getUsingNamedGraphURIs()); } return proc; }
@Test public void update_service_context_application_01() { // This test requires no service context to be set @SuppressWarnings("unchecked") Map<String, Context> serviceContextMap = (Map<String, Context>) ARQ.getContext().get(Service.serviceContext); if (serviceContextMap != null) { serviceContextMap.remove(SERVICE); } UpdateRequest updates = UpdateFactory.create("CREATE GRAPH <http://example>"); UpdateProcessRemoteBase engine = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, SERVICE); Assert.assertNotNull(engine); // Check that no settings were changed Assert.assertNull(engine.getClient()); }