From 7c9f5163e78a367aa351823096626e5ec2836b93 Mon Sep 17 00:00:00 2001 From: Arto Bendiken Date: Tue, 5 Mar 2013 17:18:09 +0100 Subject: [PATCH] Imported doc/examples/sdk-jena/update.java as a trivial example of how to execute SPARQL 1.1 Update operations on a Dydra repository using the SDK's convenience wrappers for Jena 2.10. --- doc/examples/sdk-jena/update.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/examples/sdk-jena/update.java diff --git a/doc/examples/sdk-jena/update.java b/doc/examples/sdk-jena/update.java new file mode 100644 index 0000000..64977bc --- /dev/null +++ b/doc/examples/sdk-jena/update.java @@ -0,0 +1,17 @@ +import com.dydra.Repository; +import com.dydra.Session; +import com.hp.hpl.jena.sparql.modify.request.UpdateClear; +import com.hp.hpl.jena.update.UpdateProcessor; + +public class update { + public static final String REPOSITORY = "jhacker/foaf"; // TODO: change this to your own repository + + public static void main(String[] args) { + Session session = new Session("username", "password"); // TODO: change these to your own credentials + + UpdateProcessor update = new Repository(REPOSITORY, session) + .prepareUpdate(new UpdateClear("http://example.org/")); // CLEAR GRAPH + + update.execute(); + } +}