Examples of CQLTermNode


Examples of org.z3950.zing.cql.CQLTermNode

        resultsLeft = resultsUnion;
      }
      results = resultsLeft;
    }   
    else if ( node instanceof CQLTermNode ) {
      CQLTermNode term = (CQLTermNode)node;
      boolean exactMatch = term.getRelation().getBase().equals("==");
      CQLRelation relation = term.getRelation();
      String index = term.getIndex();
      if ( index.startsWith("tb.title") ) {
        results.addAll(doSearch(request, response, SearchType.byTitle, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.equals("tb.identifier.study") ) {
        results.addAll(doSearch(request, response, SearchType.byID, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("dcterms.contributor") ) {
        results.addAll(doSearch(request, response, SearchType.byAuthorName, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("dcterms.abstract") ) {
        results.addAll(doSearch(request, response, SearchType.inAbstract, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("dcterms.subject") ) {
        results.addAll(doSearch(request, response, SearchType.byKeyword, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("dcterms.bibliographicCitation") ) {
        results.addAll(doSearch(request, response, SearchType.inCitation, errors, term.getTerm(),exactMatch,relation));       
      } else if ( index.equals("tb.identifier.study.tb1") ) {
        results.addAll(doSearch(request, response, SearchType.byLegacyID, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("prism.publicationName") ) {
        results.addAll(doSearch(request, response, SearchType.byJournal, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("dc.date") ) {
        results.addAll(doSearch(request,response, SearchType.byLastModifiedDate, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("prism.creationDate") ) {
        results.addAll(doSearch(request,response, SearchType.byCreationDate, errors, term.getTerm(),exactMatch,relation));
      } else if ( index.startsWith("prism.publicationDate") ) {
        results.addAll(doSearch(request,response, SearchType.byPublicationDate, errors, term.getTerm(),exactMatch,relation))
      } else if ( index.startsWith("prism.modificationDate") ) {
        results.addAll(doSearch(request,response, SearchType.byLastModifiedDate, errors, term.getTerm(),exactMatch,relation));               
      } else if ( index.startsWith("prism.doi") ) {
        results.addAll(doSearch(request,response,SearchType.byDOI, errors, term.getTerm(), exactMatch,relation));
      }
      else {
        // issue warnings
        addMessage(request, "Unsupported index: " + index);
      }   
View Full Code Here

Examples of org.z3950.zing.cql.CQLTermNode

        resultsLeft = resultsUnion;
      }
      results = resultsLeft;
    }
    else if ( node instanceof CQLTermNode ) {
      CQLTermNode term = (CQLTermNode)node;
      String index = term.getIndex();
     
      // CQL predicate is a title, will do a text search
      if ( index.startsWith("tb.title") ) {
        boolean exactMatch = term.getRelation().getBase().equals("==");
        SearchTable searchTable = null;
        if ( index.endsWith("taxonLabel") ) {
          searchTable = SearchTable.TAXONLABEL;
        }
        else if ( index.endsWith("taxonVariant") ) {
          searchTable = SearchTable.TAXONVARIANT;
        }
        else if ( index.endsWith("taxon") ) {
          searchTable = SearchTable.TAXON;
        }
        boolean caseSensitive = true;
        if ( ! term.getRelation().getModifiers().isEmpty() ) {
          caseSensitive = ! term.getRelation().getModifiers().firstElement().getType().equalsIgnoreCase("ignoreCase");
        }
        results.addAll(doTextSearch(term.getTerm(), caseSensitive, exactMatch, searchTable));
      }
     
      // CQL predicate is an identifier, will do id search
      else if ( index.startsWith("tb.identifier") ) {
        NamingAuthority namingAuthority = null;
        if ( index.endsWith("ncbi") ) {
          namingAuthority = NamingAuthority.NCBI;
        }
        else if ( index.endsWith("ubio") ) {
          namingAuthority = NamingAuthority.UBIO;
        }
        else {
          namingAuthority = NamingAuthority.TREEBASE;
        }
        results.addAll(doIdentifierSearch(request, term.getTerm(), namingAuthority, index));
      } else {
        // issue warnings
        addMessage(request, "Unsupported index: " + index);
      }
     
View Full Code Here

Examples of org.z3950.zing.cql.CQLTermNode

      CQLRelation relation = ((CQLTermNode)node).getRelation();
      Map<String,String> mapping = getPredicateMapping();
      for ( String key : mapping.keySet() ) {
        index = index.replaceAll(key, mapping.get(key));
      }
      return new CQLTermNode(index,relation,term);
    }
    logger.debug(node);
    return node;
 
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.