ResourceOrVariable o = new ResourceOrVariable(
LiteralFactory.getInstance().createTypedLiteral("Alice"));
Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
triplePatterns.add(new SimpleTriplePattern(s, p, o));
SimpleAskQuery askQuery = new SimpleAskQuery();
SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
queryPattern.addGraphPattern(bgp);
askQuery.setQueryPattern(queryPattern);
Assert.assertTrue(askQuery.toString()
.replaceAll("( |\n)+", " ").trim().equals(queryString));
}