}
private List<NameValuePair> getQueryParams() {
List<NameValuePair> queryParams = new ArrayList<NameValuePair>(bindings.size() + 10);
queryParams.add(new NameValuePair(Protocol.INCLUDE_INFERRED_PARAM_NAME,
Boolean.toString(includeInferred)));
if (dataset != null) {
for (URI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new NameValuePair(Protocol.DEFAULT_GRAPH_PARAM_NAME, defaultGraphURI.toString()));
}
for (URI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new NameValuePair(Protocol.NAMED_GRAPH_PARAM_NAME, namedGraphURI.toString()));
}
}
if (offset > 0) {
queryParams.add(new NameValuePair(Protocol.OFFSET, String.valueOf(offset)));
}
if (limit >= 0) {
queryParams.add(new NameValuePair(Protocol.LIMIT, String.valueOf(limit)));
}
for (Binding binding : bindings) {
String paramName = Protocol.BINDING_PREFIX + binding.getName();
String paramValue = Protocol.encodeValue(binding.getValue());
queryParams.add(new NameValuePair(paramName, paramValue));
}
return queryParams;
}