Thnx Andy. I have observed that sometimes when I try for several times with the same timeout manually using the DBpedia sparql endpoint, it works. A better strategy would be to increase the timeout from the client side for some iterations before stop querying. But if there is not way to set the timeout for the client side then anyways this would not work.
I think I can't set server timeout (DBpedia sparql endpoint) when I am using a java program to query the endpoint. Is there a way that I can set the DBpedia sparql endpoint timeout using a program? Thank you. Kalpa Gunaratna ----- Original Message ----- From: Andy Seaborne <[email protected]> Date: Tuesday, June 21, 2011 3:38 am Subject: Re: Jena ARQ API - how to set timeout in Java To: [email protected] > > > On 20/06/11 17:32, Dalkandura Arachchige Gunaratna wrote: > > Hi, I am using Jena ARQ API to query DBpedia dataset using a sparql > endpoint. I want to set the timeout limit for querying using a java > program so that the program will not crash if sufficient timeout > is set. > My intention is to have a simple loop to handle so that if an > exceptionhappens, the query will be re-done. > > > > I have come across a code sample to set timeout in the > internet and > > I > am not sure whether this works correctly. Is this correct or > there is > any other way of doing this? > > > > QueryEngineHTTP qexec = (QueryEngineHTTP) > QueryExecutionFactory.sparqlService(> strSparqlEndpoint, > qExecuteQuery); > > > qexec.addParam("timeout","10000");> > > Kalpa Gunaratna > > > > > > > > QueryEngineHTTP itself does not support timeouts: > > https://issues.apache.org/jira/browse/JENA-56 > > This would be timeout at the local end anyway - in the > dbpedia.org (if > that is what you are querying) then the timeout can be set so > the server > times the query out. See the documentation for dbpedia and > Virtuoso. > In either case, retrying a query is unlikely to be a good > strategy - if > the query timeouted once, why won't it timeout the next time as well? > > Andy
