Package org.corrib.s3b.mbb.beans

Examples of org.corrib.s3b.mbb.beans.ValueStats


    if(cache != null && cache.get() != null) {
      result = new TreeMap<String, ValueStats>();
      Map<String, Integer> v = cache.get();
     
      for(String key : v.keySet()) {
        ValueStats vs = new ValueStats(key);
        vs.setCountWithResources(v.get(key));
        result.put(key, vs);
      }
    }
   
    return result;
View Full Code Here


    if(interm.size() > MAX_RESULTS) { // --- check if the number of results returned does not exceed given threshold
      this.getCallBean().getRequest().setAttribute("toomany", true);
    }else {
      for(String label : interm.keySet())
        result.put(label, new ValueStats(label, interm.get(label)));
    }   
    return result;
  }
View Full Code Here

      if((props.length + props2.length) > MAX_RESULTS) { // --- check if the number of results returned does not exceed given threshold
        this.getCallBean().getRequest().setAttribute("toomany", true);
        Repository.logger.info("Too many results: "+(props.length + props2.length));
      }else {
        for(Value prop : props)
          filterProps.put(PredefinedSingleConcepts.shortenURI((URI)prop)[3], new ValueStats((URI)prop));
 
        ValueStats inv;
        for(Value prop : props2) {
          inv = new ValueStats((URI)prop);
          inv.setInverted(true);
          filterProps.put("-"+PredefinedSingleConcepts.shortenURI(inv.getProperty())[3], inv);
        }
       
        putPropsToCache(_uri, filterProps);
        Repository.logger.info("Put stats to cache: "+_uri);
      }
View Full Code Here

      String[] asparams = new String[7];
      BrowseSimilarService similarService = new BrowseSimilarService();
      ServiceChain newchain = null;
      LocalRepository simrepo;
      GraphStatistics graphstats;
      ValueStats aisize;
     
      try {
         newchain = (ServiceChain)this.callBean.getChain().clone();
         newchain.getServices().add(similarService);
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
     
      similarService.setCallBean(this.getCallBean());
      similarService.setRequestParams(null);
      similarService.setUser(this.user);
 
      asparams[1] = "";//"!");
      asparams[2]= "";//"-");
      asparams[6]= "*";
     
     
      if(newchain != null)
        for(String property : results.keySet()) {
          String prop = property;
          String ns = null;
          String name = property;
         
          if(property.startsWith("-")) {
            asparams[2] =  MBBService.INVERSE;
            prop = property.substring(1);
            name = prop;
          }
         
          if(prop.indexOf(':')>0) {
            ns = prop.substring(0, prop.indexOf(':'));
            name = prop.substring(prop.indexOf(':')+1);
          }
         
          asparams[0]= this.params.get(0)+"/browse/"+property+"/*";
          asparams[3]= prop;
          asparams[4]= ns;
          asparams[5]= name;
         
          similarService.setUri(asparams[0]);
          similarService.setParams(Arrays.asList(asparams));
 
          simrepo = similarService.execute(repo);
          graphstats = GraphStatistics.get(simrepo.getGraph());
          graphstats.process(asparams[0], true, true, true);
         
          aisize = results.get(property);
          aisize.setCountWithResults(graphstats.getResults().size());
          aisize.setCountWithResources(graphstats.getResources().size());
          aisize.setCountWithBnodes(graphstats.getBnodes().size());
        }

      String _uri = this.getCallBean().getCall();
      _uri = _uri.substring(0, _uri.indexOf("/stats"));
      Repository.logger.info("Put stats to cache: "+_uri);
View Full Code Here

      String[] asprops = new String[6];
      BrowseRelatedService browseService = new BrowseRelatedService();
      ServiceChain newchain = null;
      LocalRepository simrepo;
      GraphStatistics graphstats;
      ValueStats aisize;
     
      try {
         newchain = (ServiceChain)this.callBean.getChain().clone();
         newchain.getServices().add(browseService);
      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
     
      browseService.setCallBean(this.getCallBean());
      browseService.setRequestParams(null);
      browseService.setUser(this.user);
 
      asprops[1]="";//"!");
      asprops[2]="";//"-");
     
     
      if(newchain != null)
        for(String property : results.keySet()) {
          String prop = property;
          String ns = null;
          String name = property;
         
          if(property.startsWith("-")) {
            asprops[2]=MBBService.INVERSE;
            prop = property.substring(1);
            name = prop;
          }
         
          if(prop.indexOf(':')>0) {
            ns = prop.substring(0, prop.indexOf(':'));
            name = prop.substring(prop.indexOf(':')+1);
          }
         
          asprops[0]=this.params.get(0)+"/browse/"+property+"$";
          asprops[3]=prop;
          asprops[4]=ns;
          asprops[5]=name;
 
          browseService.setParams(Arrays.asList(asprops));
          browseService.setUri(asprops[0]);
 
          simrepo = browseService.execute(repo);
          graphstats = GraphStatistics.get(simrepo.getGraph());
          graphstats.process(asprops[0], true, true, true);
         
          aisize = results.get(property);
          aisize.setCountWithResults(graphstats.getResults().size());
          aisize.setCountWithResources(graphstats.getResources().size());
          aisize.setCountWithBnodes(graphstats.getBnodes().size());
        }

      String _uri = this.getCallBean().getCall();
      _uri = _uri.substring(0, _uri.indexOf("/stats"));
      Repository.logger.info("Put stats to cache: "+_uri);
View Full Code Here

    if(values.length > MAX_RESULTS) // --- check if the number of results returned does not exceed given threshold
      this.getCallBean().getRequest().setAttribute("toomany", true);
    else
      for(Value value : values) {
        Literal l = (Literal)value;
        result.put(l.getLabel(), new ValueStats(l));
       
        if(!calltokens && l.getLabel().length() > MIN_TOKENIZE_LEN) {
          String[] tokens = l.getLabel().split("\\s+");
          calltokens |= tokens.length > MIN_TOKENS;
        }
View Full Code Here

TOP

Related Classes of org.corrib.s3b.mbb.beans.ValueStats

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.