queryStrBuf.append("ASK { ?").append(variable).append(" <")
.append(predicate).append("> \"").append(object).append("\" }");
Query q = QueryParser.getInstance().parse(queryStrBuf.toString());
Assert.assertTrue(AskQuery.class.isAssignableFrom(q.getClass()));
AskQuery askQuery = (AskQuery) q;
GraphPattern gp = (GraphPattern) askQuery.getQueryPattern()
.getGraphPatterns().toArray()[0];
Assert.assertTrue(BasicGraphPattern.class.isAssignableFrom(gp.getClass()));
BasicGraphPattern bgp = (BasicGraphPattern) gp;
Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();