Variable x = new Variable("x");
q.addTriplePattern(new TriplePattern(x, new AbbrevRdfType(), new Variable("type")));
q.addFilter("str(" + x.toString() +") = \"" + uri + "\"");
QueryCodeGenerator qg = new QueryCodeGenerator();
qg.visit(q);
QueryExecutor qe = this.session.getQueryExecutor();
ResultSet rs = qe.execSelect(qg.toString());
RDFMetaResource metaResource = new RDFMetaResource(Object.class);
while (rs.hasNext()) {
QuerySolution qs = rs.nextSolution();
RDFNode node = qs.get("type");
if (node.isURIResource()) {