Yes. I am using the sparql end opoint of DBpedia. Now the code and the endpoint 
both works. What was the problem by the way?

One other thing, how can I catch the exception for querying and issue the query 
again and again? I have a simple loop for that but when an exception is caught, 
it seems like the query is never attempted again and just keep throwing the 
exception. this is regarding Jena ARQ API. If anybody knows how to increase the 
timeout or keep the loop going for the purpose please help. Following is the 
simple loop I have (in java). Thank you.

        while (cond) {
            try {
                SparqlQuerying.selectQueryExecution(query);
                cond = false;
            } catch (Exception e) {
                System.out.println("Exception occurred 1 .. " + 
e.getStackTrace());
                e.printStackTrace();
                Thread.sleep(1000);
            }
        }

selectQueryExecution(query) - just executes the query with the sparql endpoint 
of DBpedia.
When "HttpException: 500 SPARQL Request Failed." is caught, it didn't seem like 
querying again but just throwing the same exception in quick succession. 




Kalpa Gunaratna



----- Original Message -----
From: Patrick van Kleef <[email protected]>
Date: Wednesday, June 15, 2011 6:37 pm
Subject: Re: [Dbpedia-discussion] query timeout error.
To: Dalkandura Arachchige Gunaratna <[email protected]>
Cc: [email protected]

> HI,
> 
> > I am trying to run a query through a java program using Jena 
> ARQ  
> > API. Following is the query that I run through a java program.
> >
> > select distinct ?s  ?o where { ?s 
> <http://dbpedia.org/ontology/ 
> > team> ?o1 . ?o1 <http://dbpedia.org/ontology/team> ?o . ?s 
> <http://dbpedia.org/ontology/team 
> > > ?o .}
> >
> > sometimes this works and sometimes doesn't. I do not know 
> the  
> > problem. Even in the sparql endpoint, sometimes it doesn't 
> work. The  
> > exception I get from java program is HttpException: 500 
> SPARQL  
> > Request Failed. In sparql endpoint it says timeout. I 
> increased the  
> > timeout in the web interface but it doesn't help.
> >
> > I want to run this query for a list of properties and the 
> code  
> > breaks when it executes the above query since it returns 
> an  
> > exception. Do you have any clue what is going on?
> 
> Assuming you are running your query against the 
> http://dbpedia.org/sparql 
>   endpoint, could you retry your query and let me know if 
> it now works.
> 
> Patrick
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to