use of org.apache.jena.arq.querybuilder.DescribeBuilder in project jena by apache.
the class WhereHandlerTest method testMakeSubQueryFromDescribe.
@Test
public void testMakeSubQueryFromDescribe() {
AbstractQueryBuilder<?> sb = new DescribeBuilder().addWhere("?x", RDF.type, RDF.Alt);
ElementSubQuery esq = handler.makeSubQuery(sb);
Triple t1 = new Triple(NodeFactory.createVariable("x"), RDF.type.asNode(), RDF.Alt.asNode());
TriplePath tp = new TriplePath(t1);
ElementPathBlock epb = new ElementPathBlock();
epb.addTriple(tp);
Query q = new Query();
q.setQuerySelectType();
q.setQueryResultStar(true);
q.setQueryPattern(epb);
ElementSubQuery esq2 = new ElementSubQuery(q);
WhereValidator wv = new WhereValidator(esq2);
esq.visit(wv);
assertTrue(wv.matching);
}
Aggregations