use of fr.lirmm.graphik.graal.io.sparql.SparqlConjunctiveQueryWriter in project graal by graphik-team.
the class RDF4jStore method match.
@Override
public CloseableIterator<Atom> match(Atom atom) throws AtomSetException {
ConjunctiveQuery query = DefaultConjunctiveQueryFactory.instance().create(atom);
StringWriter s = new StringWriter();
SparqlConjunctiveQueryWriter w = new SparqlConjunctiveQueryWriter(s, this.utils.getURIzer());
try {
w.write(query);
w.close();
} catch (IOException e1) {
throw new AtomSetException("Error while converting to SPARQL " + atom, e1);
}
TupleQuery sparqlQuery = this.connection.prepareTupleQuery(s.toString());
TupleQueryResult result = sparqlQuery.evaluate();
return new TupleQueryResultAtomIterator(result, atom, utils);
}
Aggregations