Package org.s3b.search.query.impl

Examples of org.s3b.search.query.impl.RdfResultObject


   * @param bookMap map of ranked resources
   * @return new RDF Result object
   */
  @SuppressWarnings("unchecked")
  public RdfResultObject getRdfResultObject(ResultObject oldResultObject, boolean isConjunction) {
    RdfResultObject result = new RdfResultObject();

    if (oldResultObject != null) {
      if (!result.isFresh() && isConjunction) {
        result.intersectResults(oldResultObject);
      } else {
        result.addResults(oldResultObject);
      }
      
       result.addHistoryInfo(oldResultObject.getHistoryInfo());
      }

    return result;
  }
View Full Code Here


   * Loads given resources(URIS) from DB and sets their initial rank
   * @param queries
   * @return
   */
  public RdfResultObject getRdfResultObject(Map<String, Double> queries) {
    RdfResultObject result = new RdfResultObject();
   
    Model md = Repository.JOINED.getModel();
    md.open();
   
    result.addResults(getResourcesFromCache(queries));
       
    IndexResourceLoader<Person, TaxonomyEntry, KOSEntry, String, String> rl = new IndexBookResourceLoader();
    List<IndexResource<Person, TaxonomyEntry, KOSEntry, String, String>> list = rl.loadResources(queries, md);
    for(IndexResource<Person, TaxonomyEntry, KOSEntry, String, String> res : list){
      if(!resourceCache.containsKey(res.getURIAsString())){
        resourceCache.put(res.getURIAsString(),(IndexRdfResource) res);
      }
    }
    md.close();
    result.addResults(list);
    return result;
  }
View Full Code Here

    String[] queries = queryObject.getLuceneQuery2(ifuri, queryList);
    try{
      Map<String,Double> positiveQueries = new HashMap<String, Double>();
      positiveQueries = search(queries[0]);
     
      RdfResultObject positiveResults = ObjectFactory.getInstance().getRdfResultObject(positiveQueries);
//      //logger.info("positive queries: " + positiveQueries);
      if(queries[1] != null){ //if there exists a negative result set not to be included in final results
        Map<String,Double> negativeQueries = search(queries[0]);
        RdfResultObject negativeResults = ObjectFactory.getInstance().getRdfResultObject(negativeQueries);
//        //logger.info("negative queries: " + negativeQueries);
        positiveResults.removeResults(negativeResults);
      }
     
      if ((!result.isFresh() && queryObject.isConjunction())||(precise))
View Full Code Here

TOP

Related Classes of org.s3b.search.query.impl.RdfResultObject

Copyright © 2018 www.massapicom. 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.