// and com.hp.hpl.jena.query.QueryFactory could throw exceptions on
// vendor-specific sections of the query, we use the lower-level
// com.hp.hpl.jena.sparql.engine.http.HttpQuery to execute the query and
// read the results into model.
HttpQuery httpQuery = new HttpQuery(endpointURL);
httpQuery.addParam("query", query);
if (defaultGraphURI != null) {
httpQuery.addParam("default-graph-uri", defaultGraphURI);
}
for (String[] param: queryParamsGraph) {
httpQuery.addParam(param[0], param[1]);
}
// The rest is more or less a copy of QueryEngineHTTP.execModel()
httpQuery.setAccept(contentType);
InputStream in = httpQuery.exec();
// Don't assume the endpoint actually gives back the content type we
// asked for
String actualContentType = httpQuery.getContentType();
// If the server fails to return a Content-Type then we will assume
// the server returned the type we asked for
if (actualContentType == null || actualContentType.equals("")) {
actualContentType = contentType;