}
}
}
private Request createSPARQLQueryRequest(String theQuery) {
HttpResource aRes = new HttpResourceImpl(mURL);
Request aQueryRequest;
// auto prefix queries w/ rdf and rdfs namespaces
ParameterList aParams = new ParameterList()
.add(PARAM_QUERY, theQuery);
if (mUseGetForQueries) {
aQueryRequest = aRes.initGet()
.addHeader(HttpHeaders.Accept.getName(), TupleQueryResultFormat.SPARQL.getDefaultMIMEType())
.setParameters(aParams);
}
else {
aQueryRequest = aRes.initPost()
.addHeader(HttpHeaders.ContentType.getName(), MimeTypes.FormUrlEncoded.getMimeType())
.addHeader(HttpHeaders.Accept.getName(), TupleQueryResultFormat.SPARQL.getDefaultMIMEType())
.setBody(aParams.getURLEncoded());
}