Examples of ReconciliationCandidate


Examples of com.google.refine.org.deri.reconcile.model.ReconciliationCandidate

  public void reconcileTestWithEnoughResults()throws Exception{
    ImmutableList<String> empty = ImmutableList.of();
    List<ReconciliationCandidate> results = new ArrayList<ReconciliationCandidate>();
    //prepare enough results
    for(int i=0;i<limit;i++){
      results.add(new ReconciliationCandidate(String.valueOf(i), "", null, 0, false));
    }
   
    when(mockEndpoint.reconcileEntities(request, empty, 0.9)).thenReturn(results);
    /*
     * testing
 
View Full Code Here

Examples of org.deri.grefine.reconcile.model.ReconciliationCandidate

          moreThanOneMatch = true;
        }else{
          match = true;
        }
      }
      ReconciliationCandidate candidate = new ReconciliationCandidate(entity.getURI(), scoredLabel.label, new String[] {}, scoredLabel.score,match);
     
      candidates.add(candidate);
    }
    if(moreThanOneMatch){
      //set all candidates as match =false
      for(ReconciliationCandidate candidate:candidates){
        candidate.setMatch(false);
      }
    }
    //sort according to score
    Collections.sort(candidates, new Comparator<ReconciliationCandidate>() {
View Full Code Here

Examples of org.deri.grefine.reconcile.model.ReconciliationCandidate

  public List<ReconciliationCandidate> wrapResultset(ResultSet resultSet,String queryString, double matchThreshold){
    List<ReconciliationCandidate> candidates = new ArrayList<ReconciliationCandidate>();
    while(resultSet.hasNext()){
      QuerySolution solution = resultSet.nextSolution();
      Resource entity = solution.getResource("entity");
      ReconciliationCandidate candidate = new ReconciliationCandidate(entity.getURI(), queryString, new String[] {}, 1.0d,true);
     
      candidates.add(candidate);
    }
    if(candidates.size() > 1 || matchThreshold > 1 ){
      //set all match =false
      for(ReconciliationCandidate candidate : candidates){
        candidate.setMatch(false);
      }
    }
    return candidates;
  }
View Full Code Here

Examples of org.deri.grefine.reconcile.model.ReconciliationCandidate

          moreThanOneMatchFound = true;
        }else{
          match = true;
        }
      }
      candidates.add(new ReconciliationCandidate(entityUri, label, new String[] {}, score, match));
     
      if(candidates.size()==limit){
        //we got enough
        break;
      }
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.