use of org.apache.stanbol.entityhub.query.sparql.SparqlFieldQuery in project stanbol by apache.
the class LarqSearcher method findEntities.
@Override
public final QueryResultList<String> findEntities(FieldQuery parsedQuery) throws IOException {
final SparqlFieldQuery query = SparqlFieldQueryFactory.getSparqlFieldQuery(parsedQuery);
query.setSparqlEndpointType(SparqlEndpointTypeEnum.LARQ);
String sparqlQuery = query.toSparqlSelect(false);
InputStream in = sendSparqlRequest(getQueryUri(), sparqlQuery, SparqlSearcher.DEFAULT_SPARQL_RESULT_CONTENT_TYPE);
//Move to util class!
final List<String> entities = extractEntitiesFromJsonResult(in, query.getRootVariableName());
return new QueryResultListImpl<String>(query, entities.iterator(), String.class);
}
Aggregations