Examples of DumpQueryExecutor


Examples of org.deri.grefine.reconcile.rdf.executors.DumpQueryExecutor

  }
 
  public LinkedHashMultimap<String, String> guessType(Model model, String queryString, ImmutableList<String> searchPropertyUris, int limit) {
    //reconcile then get types for each element in the reconciliation result assure that order is preserved
    ReconciliationRequest request = new ReconciliationRequest(queryString, limit);
    QueryExecutor queryExecutor = new DumpQueryExecutor(model);
    List<ReconciliationCandidate> candidates = reconcileEntities(queryExecutor, request, searchPropertyUris, 2.0);
    List<String> entities = new ArrayList<String>();
    for(ReconciliationCandidate candidate:candidates){
      entities.add(candidate.getId());
    }
    if(entities.isEmpty()){
      //return empty result
      return LinkedHashMultimap.create();
    }
    String sparql = this.queryFactory.getTypesOfEntitiesQuery(ImmutableList.copyOf(entities));
    ResultSet resultSet = queryExecutor.sparql(sparql);
    Multimap<String, String> typesMap = this.queryFactory.wrapTypesOfEntities(resultSet);
    //order
    LinkedHashMultimap<String, String> result = LinkedHashMultimap.create();
    for(String uri:entities){
      result.putAll(uri, typesMap.get(uri));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.