String parametrizedQueryString = query.getParametrizedQueryString();
String encodedParamString = query.getEncodedParamString();
int queryNr = query.getNr();
String[] rowNames = query.getRowNames();
boolean sorted = queryString.toLowerCase().contains("order by");
QueryResult queryResult = null;
NetQuery qe;
if (query.isParametrized)
qe = new NetQuery(serverURL, parametrizedQueryString, encodedParamString, queryType, defaultGraph, 0);
else
qe = new NetQuery(serverURL, queryString, "", queryType, defaultGraph, 0);
InputStream is = qe.exec();
Document doc = getXMLDocument(is);
XMLOutputter outputter = new XMLOutputter();
logResultInfo(query, outputter.outputString(doc));
if(queryType==Query.SELECT_TYPE)
queryResult = gatherResultInfoForSelectQuery(queryString, queryNr, sorted, doc, rowNames);
if(queryResult!=null)
queryResult.setRun(query.getQueryMix().getRun());
return queryResult;
}