Bonjour,

SVP j'ai eu cette erreur en exécutant ma requête sparql : ça veut dire quoi??

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
java.io.IOException: Server returned HTTP response code: 500 for URL: http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?QueryString=affiliation&MaxHits=500
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
        at java.net.URL.openStream(URL.java:1010)
        at sparql_test.Main.lookupURI_DBpedia(Main.java:516)
        at sparql_test.Main.main(Main.java:603)
sinon voici le code de ma méthode LookupURI
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
public static String lookupURI_DBpedia(String title){
		String uri="";
    	Parser parser = null;
    	NodeList root;
		URL url;
		File file;
		Document document;
		Element racine;
		SAXBuilder sxb;
		PrintWriter outc;
		int inputLine;
		String text="";
		BufferedReader br;
		String str = title.replace(" ", "%20");
		try{
		url = new URL("http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?QueryString="+str.replace("(", "").replace(")", "")+"&MaxHits=500");
		InputStream in = url.openStream();
	//	while ((inputLine = in.read()) != -1){
	//		System.out.print((char)inputLine);
	//	}
 
		sxb = new SAXBuilder();
		sxb.setValidation(false);
		document = sxb.build(in);
		racine = document.getRootElement();
		List children = racine.getChildren();
		if(children.size()!=0){
			for(Object child:children){
				Element el = (Element)child;
				Element elm = (Element)el.getChildren().get(1);
				uri = elm.getTextTrim();
				if(uri.substring(uri.lastIndexOf("/")+1).toLowerCase().equals(title.replace(" ", "_").replace("(", "%28").replace(")", "%29"))){
					break;
				}
			}
		}
		System.out.println("text : " + uri);
 
		}catch(Exception e){
			e.printStackTrace();
		}
 
		return uri;
	}
et merci