Package org.apache.oodt.cas.catalog.query

Examples of org.apache.oodt.cas.catalog.query.QueryExpression


      if (queryResult.getCatalogReceipts() == null && queryResult.getInterestedCatalogs() != null) {
        for (Catalog catalog : this.getCurrentCatalogList()) {
          try {
            if (queryResult.getInterestedCatalogs().contains(catalog.getId())) {
              LOG.log(Level.INFO, "Restricting query to understood terms for Catalog '" + catalog + "'");
              QueryExpression reducedExpression = this.reduceToUnderstoodExpressions(catalog, queryExpression);
              LOG.log(Level.INFO, "Querying Catalog '" + catalog + "' with query '" + reducedExpression + "'");
              catalogReceipts.addAll(catalog.query(reducedExpression));
            }
          }catch (Exception e) {
            if (this.oneCatalogFailsAllFail)
View Full Code Here


      // check for catalogs interested in wrapper query expression
      restrictToCatalogIds.retainAll(getInterestedCatalogs(queryExpression, restrictToCatalogIds));
     
      // check for catalogs interested in wrapped query expression
      QueryResult wrapperExprQueryResult = null;
      QueryExpression wrapperQE = ((WrapperQueryExpression) queryExpression).getQueryExpression();
      if (wrapperQE instanceof QueryLogicalGroup) {
        wrapperExprQueryResult = this.queryRecur((QueryLogicalGroup) wrapperQE, restrictToCatalogIds);
      }else {
        wrapperExprQueryResult = new QueryResult(wrapperQE);
        wrapperExprQueryResult.interestedCatalogs = getInterestedCatalogs(wrapperQE, restrictToCatalogIds);
View Full Code Here

  protected QueryExpression reduceToUnderstoodExpressions(Catalog catalog, QueryExpression queryExpression) throws CatalogDictionaryException, CatalogException {
    if (queryExpression instanceof QueryLogicalGroup) {
          QueryLogicalGroup queryLogicalGroup = (QueryLogicalGroup) queryExpression;
          List<QueryExpression> restrictedExpressions = new Vector<QueryExpression>();
          for (QueryExpression qe : queryLogicalGroup.getExpressions()) {
            QueryExpression restrictedQE = this.reduceToUnderstoodExpressions(catalog, qe);
            if (restrictedQE == null && queryLogicalGroup.getOperator().equals(QueryLogicalGroup.Operator.AND) && this.disableIntersectingCrossCatalogQueries) {
              restrictedExpressions.clear();
              break;
            }
            if (restrictedQE != null)
              restrictedExpressions.add(restrictedQE);
          }
          if (restrictedExpressions.size() > 0) {
            if (restrictedExpressions.size() == 1) {
              return restrictedExpressions.get(0);
            }else {
              QueryLogicalGroup restrictedQueryLogicalGroup = queryLogicalGroup.clone();
              restrictedQueryLogicalGroup.setExpressions(restrictedExpressions);
              return restrictedQueryLogicalGroup;
            }
          }else {
            return null;
          }
    }else if (queryExpression instanceof WrapperQueryExpression) {
      WrapperQueryExpression wrapperQueryExpresssion = (WrapperQueryExpression) queryExpression;
          if (catalog.isInterested(queryExpression)) {
            QueryExpression qe = this.reduceToUnderstoodExpressions(catalog, wrapperQueryExpresssion.getQueryExpression());
        if (qe != null) {
          WrapperQueryExpression wqe = wrapperQueryExpresssion.clone();
          wqe.setQueryExpression(qe);
          return wqe;
        }else if (wrapperQueryExpresssion.isValidWithNoSubExpression()){
View Full Code Here

  protected String query;
  protected Set<String> catalogIds;
  protected List<String> termNames;
 
  public void performAction(CatalogServiceClient csClient) throws Exception {
    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
    QueryPager queryPager = null;
    if (catalogIds == null)
      queryPager = csClient.query(queryExpression);
    else
      queryPager = csClient.query(queryExpression, catalogIds);
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.catalog.query.QueryExpression

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.