* If DatasetClause does not contain a valid URI.
*/
public static Dataset process(ASTQueryContainer qc)
throws MalformedQueryException
{
DatasetImpl dataset = null;
List<ASTDatasetClause> datasetClauses = qc.getQuery().getDatasetClauseList();
if (!datasetClauses.isEmpty()) {
dataset = new DatasetImpl();
for (ASTDatasetClause dc : datasetClauses) {
ASTIRI astIri = dc.jjtGetChild(ASTIRI.class);
try {
URI uri = new URIImpl(astIri.getValue());
if (dc.isNamed()) {
dataset.addNamedGraph(uri);
}
else {
dataset.addDefaultGraph(uri);
}
}
catch (IllegalArgumentException e) {
throw new MalformedQueryException(e.getMessage(), e);
}