Hello all,

I was hoping that you could help me with this issue related to Virtuoso. I
have problem with the update query using HTTP call from Jena.

Running the same query from the SPARQL interface in the conductor –logged
in as DBA- works fine, but calling the SPARQL endpoint from Java program
with the same credentials does not work. I know that SPARQL conductor runs
using the “SPARQL” user, So I tried both “SPARQL” and “DBA” but still not
working.

There is no error or exception, but the update is not occurring.

Do you have any idea about what is the right way to run an update query
from Jena against a Virtuoso endpoint?

Here is how I call the endpoint from Java using Jena:

Context ctx = ARQ.getContext();
Map<String, Context> serviceContext = new HashMap<String, Context>();
Context authContext = new Context();
authContext.put(Service.queryAuthUser, "dba");
authContext.put(Service.queryAuthPwd, "pass");
serviceContext.put(this.dataSetUpdateURL, authContext);
ctx.put(Service.serviceContext, serviceContext);

UpdateRequest update = new UpdateRequest();
update.add(queryString);

UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase)
UpdateExecutionFactory.createRemote(update,
this.dataSetUpdateURL,ctx);
ue.execute();

The query is something like:

With <http:/graph>
Delete {
?s ?p ?o.
}
Insert {
?s ?p ?o2.
}
Where {
?s ?p ?o.
}

I tried both http://<ip>:<port>/sparql and http://<ip>:<port>/sparql-auth
for the dataSetUpdateURL and changed the user to have the right group
"SPARQL_UPDATE"

Here are the logs

2014-05-22 17:19:52,724 DEBUG
[com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase]: Endpoint URI
http://localhost/sparql-auth has SERVICE Context: symbol:
http://jena.hpl.hp.com/Service#queryAuthPwd = pass_dba symbol:
http://jena.hpl.hp.com/Service#queryAuthUser = dba

2014-05-22 17:19:52,724 DEBUG
[com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase]: Setting basic HTTP
authentication for endpoint URI http://localhost/sparql-auth with username:
dba
Thanks,
Gofran
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to