import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class SparqlGETmondial {
  public static void main(String[] args) { try {
    BufferedReader br = null;
    URL inputURL = new URL("http://www.semwebtech.org/mondial/10/sparql?query=select%20distinct%20?C%20where%20%7B%5B%5D%20a%20?C%7D%20LIMIT%20100");
    HttpURLConnection con = (HttpURLConnection) inputURL.openConnection();
    con.setRequestMethod("GET");
    con.setRequestProperty("Accept", "application/sparql-results+xml");
    con.connect();
    String s = "";   StringBuffer res= new StringBuffer();
    br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
    while ((s = br.readLine()) != null) { res.append(s+ "\n");	}
    br.close();
    System.out.println(res);  // or fill XML from Reader
  } catch (Exception e) { e.printStackTrace(); } }}
