Could you please try the same code with this SPARQL query instead:
select * WHERE {<http://dbpedia.org/resource/Beijing> ?p ?o.} limit 100On Fri, Apr 11, 2014 at 11:36 AM, Wang Dongsheng <[email protected]>wrote: > Hi all, > I want to query data from dbpedia, but meet the exception as following. I > think it a common effort that we use often. > I hope anyone can help me. > > --------------------------------main code ------------------ > String queryStr = "select * {<http://dbpedia.org/resource/Beijing> ?p ?o.} > limit 100"; > QueryExecution qexec = QueryExecutionFactory.sparqlService(" > http://dbpedia.org/sparql", queryStr); > ResultSet results = qexec.execSelect(); > > ------------------------------------------------------------------- > > > --------------------------------------Exception------------------------- > > log4j:WARN No appenders could be found for logger > (com.hp.hpl.jena.util.FileManager). > log4j:WARN Please initialize the log4j system properly. > log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for > more info. > Exception in thread "main" HttpException: java.net.SocketException: > Software caused connection abort: recv failed: java.net.SocketException: > Software caused connection abort: recv failed > at > com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:529) > at > com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:289) > at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:240) > at > > com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:302) > at com.wds.ttl.OnlineQuery.demo(OnlineQuery.java:59) > at com.wds.ttl.OnlineQuery.main(OnlineQuery.java:39) > Caused by: java.net.SocketException: Software caused connection abort: recv > failed > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:173) > at java.net.SocketInputStream.read(SocketInputStream.java:122) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) > at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) > at java.io.BufferedInputStream.read(BufferedInputStream.java:334) > at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658) > at > > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323) > at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468) > at > com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:412) > ... 5 more > > ---------------------------------------- > > If there is any links related to the similar problem, please send to me? > Thanks in advance! >
