|
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 |
|
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. |

