Search in sources :

Example 1 with Entity

use of org.aksw.simba.autoindex.es.model.Entity in project autoindex by dice-group.

the class SparqlHandler method getResults.

public ArrayList<Entity> getResults(int instances_limit) {
    ResultSet results = this.getallinstances(instances_limit);
    ArrayList<Entity> entity_list = new ArrayList<Entity>();
    while (results.hasNext()) {
        QuerySolution qs = results.next();
        entity_list.add(new Entity(qs.getResource("type").getURI(), qs.getLiteral("label").getString(), Double.parseDouble(qs.getLiteral("v").getString())));
    }
    return entity_list;
}
Also used : Entity(org.aksw.simba.autoindex.es.model.Entity) QuerySolution(org.apache.jena.query.QuerySolution) ResultSet(org.apache.jena.query.ResultSet) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Entity (org.aksw.simba.autoindex.es.model.Entity)1 QuerySolution (org.apache.jena.query.QuerySolution)1 ResultSet (org.apache.jena.query.ResultSet)1