Hi, If I run delete/insert query from the sparql endpoint the update operation works. The sparql query is

CODE: SELECT ALL INSERT DATA INTO <persongraph> { < http://onmobile.com/umdb/person/juhi_chawla_268e7a02-8737-464f-97f8-172961d3335b rdf:type http://xmlns.com/foaf/0.1/Person }

Is it possible to do the same operation using Java code (either Jena or VirtuosoExecutionFactory) such that the update operation happens without needing to load the entire graphs into memory. I would like to invoke Sparql endpoint from code to do the update operation. Please correct me if the assumption that the entire triples of a graph will be loaded in memory is wrong. The following jena code works but it loads the entire model to memory which causes the machine to not work when the triple size grows above 50,000.

CODE: SELECT ALL String queryString1 = " PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# " + " INSERT DATA { http://onmobile.com/umdb/person/juhi_chawla_268e7a02-8737-464f-97f8-172961d3335b rdf:type http://xmlns.com/foaf/0.1/Person } ";

UpdateRequest request1 = UpdateFactory.create(queryString1); UpdateAction.execute(request1, personModel);

I would like to do the same by invoking sparqlService or using createServiceRequest so that it avoids loading the entire graph into memory similar to the way it works for sparql endpoint.

The following code is not updating the Virtuoso store.

CODE: SELECT ALL String queryString1 = " PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# " + " INSERT DATA { http://onmobile.com/umdb/person/juhi_chawla_268e7a02-8737-464f-97f8-172961d3335b rdf:type http://xmlns.com/foaf/0.1/Person } ";

com.hp.hpl.jenafix.query.Query query1 = com.hp.hpl.jenafix.query.QueryFactory.create(queryString1); com.hp.hpl.jenafix.query.QueryExecution qexec1 = com.hp.hpl.jenafix.query.QueryExecutionFactory.sparqlService("http://IP:8890/sparql", query1);

I have tried using VirtuosoQueryExecutionFactory.sparqlService, QueryExecutionFactory.createServiceRequest and QueryExecutionFactory.sparqlService. These work for select but not for update. Please let me know how to do update by invoking the sparql endpoint from Java code.

Thanks and regards, Venkatesh Channal

asked 21 Sep '12, 10:24

VenkateshChannal's gravatar image

VenkateshCha...
112
accept rate: 0%


The same question was asked (and answered) by you on the public Virtuoso discussion forums. You said --

I am using jena. The workaround was to use JDBC endpoint (virtuoso:1111 - with login having update rights) to perform insert/delete and to use sparql endpoint to do the get. This way entire model being loaded into the system has been avoided.

permanent link

answered 31 Oct '12, 16:30

TallTed's gravatar image

TallTed
2.1k19
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×602
×197
×137

question asked: 21 Sep '12, 10:24

question was seen: 1,188 times

last updated: 31 Oct '12, 16:30