SPARQL Update is a W3C standard for an RDF update language with SPARQL syntax. It is described in "SPARQL 1.1 Update".
A SPARQL Update request is composed of a number of update operations, so in a single request graphs can be created, loaded with RDF data and modified.
Some examples of ARQ's SPARQL Update support are to be found in the download in src-examples/arq/examples/update.
The main important classes are:
To execute a SPARQL Update request as a script from a file:
Dataset ds = ... GraphStore graphStore = GraphStoreFactory.create(ds) ; UpdateAction.readExecute("update.ru", graphStore) ;
To execute a SPARQL Update request as a string:
Dataset ds = ... GraphStore graphStore = GraphStoreFactory.create(ds) ; UpdateAction.parseExecute(("DROP ALL", graphStore) ;
The application writer can create and execute operations:
UpdateRequest request = UpdateFactory.create() ; request.add("DROP ALL") .add("CREATE GRAPH <http://example/g2>") .add("LOAD <file:etc/update-data.ttl> INTO <http://example/g2>") ; // And perform the operations. UpdateAction.execute(request, graphStore) ;
but be aware that each operation added needs to be a complete SPARQL Update operation, including prefixes if needed.