Hi Andy, I tried to configure log4j but failed, and I want to leave it at the moment ...
I debugged the codes, and I found that in QueryEngineHTTP.execSelect method, the HTTPQuery actually is "http://wifo5-04.informatik.uni-mannheim.de/drugbank/sparql?query=PREFIX++drugbank%3A+%3Chttp%3A%2F%2Fwifo5-04.informatik.uni-mannheim.de%2Fdrugbank%2Fresource%2Fdrugbank%2F%3E%0APREFIX++sider%3A+%3Chttp%3A%2F%2Fwifo5-04.informatik.uni-mannheim.de%2Fsider%2Fresource%2Fsider%2F%3E%0APREFIX++owl%3A++%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX++rdf%3A++%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0A%0ASELECT++%3Fdrug+%3Fenzyme+%3FsideEffect%0AWHERE%0A++%7B+%3Fdrug+rdf%3Atype+drugbank%3Adrugs+.%0A++++%3Fdrug+drugbank%3Aenzyme+%3Fenzyme+.%0A++++%3Fenzyme+rdf%3Atype+drugbank%3Aenzymes%0A++++SERVICE+%3Chttp%3A%2F%2Fwifo5-04.informatik.uni-mannheim.de%2Fsider%2Fsparql%3E%0A++++++%7B+%3FdrugInSider+owl%3AsameAs+%3Fdrug+.%0A++++++++%3FdrugInSider+rdf%3Atype+sider%3Adrugs+.%0A++++++++%3FdrugInSider+sider%3AsideEffect+%3FsideEffect+.%0A++++++++%3FsideEffect+rdf%3Atype+sider%3Aside_effects%0A++++++%7D%0A++%7D%0ALIMIT+++10%0A&timeout=10000" which is simply transformed from the SPARQL query I wrote. If I open it in a web browser, "HTTP ERROR 500" appears. It seems that the query is sent to one single endpoint which doesn't support this SERVICE extension, instead of sending subqueries to different SPARQL endpoints (which I guess is the way this SERVICE extension works). So I guess maybe the codes I wrote are incorrect, but I didn't find the correct way to do it. Could you please give me some helps? Many thanks for that! Best wishes, June On 12/03/2013 02:09 AM, Andy Seaborne wrote: > On 02/12/13 16:37, zhuman.private wrote: >> Hi Andy, >> >> Sorry for the confusions. >> http://wifo5-04.informatik.uni-mannheim.de/drugbank/sparql is a SPARQL >> endpoint, so is http://wifo5-04.informatik.uni-mannheim.de/sider/sparql. >> I tried queries separately on the two end points, and both of them are >> working well. But not when querying on both of them. >> >> best regards >> June > June, > > What are the messages (and stacktrace) from the server log files? > > Andy > >>> 在 2013年12月2日,23:26,Andy Seaborne <[email protected]> 写道: >>> >>>> On 02/12/13 14:33, June wrote: >>>> Dear list, >>>> >>>> I am trying to perform a federated SPARQL query by Jena arq for the >>>> first time, and I am using the latest version of Jena. >>>> >>>> But I encountered a HTTPException:500 exception for executing the >>>> following query. It will be very helpful if you can give me some tips >>>> about this problem. >>> What is http://wifo5-04.informatik.uni-mannheim.de/drugbank/sparql running? >>> Is it Jena or another system? >>> >>> If it's Fuseki, what are the messages (and stacktrace) from the server log >>> file? >>> >>> Andy >>> >>>> PREFIX drugbank: >>>> <http://wifo5-04.informatik.uni-mannheim.de/drugbank/resource/drugbank/> >>>> PREFIX sider: >>>> <http://wifo5-04.informatik.uni-mannheim.de/sider/resource/sider/> >>>> PREFIX owl: <http://www.w3.org/2002/07/owl#> >>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> >>>> >>>> SELECT ?drug ?enzyme >>>> WHERE >>>> { ?drug rdf:type drugbank:drugs . >>>> ?drug drugbank:enzyme ?enzyme . >>>> ?enzyme rdf:type drugbank:enzymes >>>> SERVICE <http://wifo5-04.informatik.uni-mannheim.de/sider/sparql> >>>> { ?drugInSider owl:sameAs ?drug . >>>> ?drugInSider rdf:type sider:drugs . >>>> ?drugInSider sider:sideEffect ?sideEffect . >>>> ?sideEffect rdf:type sider:side_effects >>>> } >>>> } >>>> LIMIT 10 >>>> >>>> The codes I am using are: >>>> >>>> val query = QueryFactory.create(qStr) >>>> val qexec = >>>> QueryExecutionFactory.sparqlService("http://wifo5-04.informatik.uni-mannheim.de/drugbank/sparql", >>>> query) >>>> try { >>>> val results = qexec.execSelect() >>>> while (results.hasNext()) { >>>> val result = results.next >>>> println(result.get("drug") + "\t" + result.get("enzyme"))// + >>>> "\t" + result.get("sideEffect")) >>>> } >>>> } finally { >>>> qexec.close(); >>>> } >>>> >>>> Many thanks! >>>> >>>> Best wishes, >>>> >>>> June -- ---------------- Zhu Man, (+86)13851764837 School of Computer Science & Engineering Southeast University, Nanjing
