Examples of CQLNode


Examples of org.z3950.zing.cql.CQLNode

    }

    public QueryResult getQueryResult(String queryStr,
      SearchRetrieveRequestType request) {
        BasicQueryResult result=new BasicQueryResult();
        CQLNode query;
        try {
            query=parser.parse(queryStr);
        }
        catch(Exception e) {
            result.addDiagnostic(SRWDiagnostic.QuerySyntaxError, queryStr);
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

        ert.setMaximumRecords(request.getMaximumRecords());
        String query=request.getQuery();
        if(query!=null && query.length()>0) {
            ert.setQuery(query);
            try {
                CQLNode root=cqlparser.parse(query);
                ert.setXQuery(toOperandType(root));
            }
            catch (CQLParseException e) {
                log.error("parse problem: \""+query+"\"",e);
                RelationType rt=new RelationType("", null);
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

    /**
     * Test of getFirstTerm method, of class ORG.oclc.os.SRW.Utilities.
     */
    public void testGetFirstTerm() throws Exception {
        CQLParser parser = new CQLParser();       
        CQLNode rootNode=parser.parse("dog");
        assertEquals("dog", Utilities.getFirstTerm(rootNode).getTerm());

        rootNode=parser.parse("dog or cat and mouse");
        assertEquals("dog", Utilities.getFirstTerm(rootNode).getTerm());
    }
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

       
          try {
        CQLParser parser = new CQLParser(CQLParser.V1POINT2);
//          String local_full_query_string = query;
//          local_full_query_string = local_full_query_string.replace("-", "%2D");
          CQLNode query_cql = parser.parse(query);
          if (output.equals(OutputTypeXCQL)) {
        String xmlContent = query_cql.toXCQL();
        if (xmlContent.length() == 0) {
      return Sequence.EMPTY_SEQUENCE;
        }
        StringReader reader = new StringReader(xmlContent);
        SAXAdapter adapter = new SAXAdapter(context);
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(true);
        InputSource src = new InputSource(reader);
       
        SAXParser saxParser = factory.newSAXParser();
        XMLReader xr = saxParser.getXMLReader();
       
        xr.setContentHandler(adapter);
        xr.setProperty(Namespaces.SAX_LEXICAL_HANDLER, adapter);
        xr.parse(src);
        ret = (DocumentImpl) adapter.getDocument();

          } else if (output.equals(OutputTypeString)) {
        ret = new StringValue(query_cql.toString());
          } else {
        ret = new StringValue(query_cql.toCQL());
          }
          return ret;
          }
    catch (CQLParseException e) {
        throw new XPathException(this, "An error occurred while parsing the query expression (CQLParseException): " + e.getMessage(), e);         
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

  @Override
  protected ModelAndView handleQueryRequest(HttpServletRequest request,HttpServletResponse response,BindException errors, String query) throws CQLParseException, IOException, InstantiationException {
    //String query = request.getParameter("query");       
    CQLParser parser = new CQLParser();
    CQLNode root = parser.parse(query);
    root = normalizeParseTree(root);
    Set<Matrix> queryResults = doCQLQuery(root, new HashSet<Matrix>(),request, response, errors);
    MatrixSearchResults tsr = new MatrixSearchResults(queryResults);
    saveSearchResults(request, tsr);
    if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) {
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

  protected ModelAndView handleQueryRequest(HttpServletRequest request,
      HttpServletResponse response, BindException errors, String query)
      throws CQLParseException, IOException, InstantiationException {
    //String query = request.getParameter("query");
    CQLParser parser = new CQLParser();
    CQLNode root = parser.parse(query);
    root = normalizeParseTree(root);
    Set<PhyloTree> queryResults = doCQLQuery(root, new HashSet<PhyloTree>(),request, response, errors);
    TreeSearchResults tsr = new TreeSearchResults(queryResults);
    saveSearchResults(request, tsr);
    if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) {     
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

  protected ModelAndView handleQueryRequest(HttpServletRequest request,
      HttpServletResponse response, BindException errors, String query)
      throws CQLParseException, IOException, InstantiationException {
    //
    CQLParser parser = new CQLParser();
    CQLNode root = parser.parse(query);
    root = normalizeParseTree(root);
    HashSet<PhyloTree> queryResults = doCQLQuery(root, new HashSet<PhyloTree>(),request, response, errors);
    TreeSearchResults tsr = new TreeSearchResults(queryResults);
    saveSearchResults(request, tsr);
   
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

        return new CqlQuery(createCQLNode(model.toQueryModel(), null, null, complexSupport));
    }

    public static CQLNode createCQLNode(QueryModelNode node, String sourceNamespace, String targetNamespace, boolean complexSupport)
    {
        CQLNode result = null;

        if (node instanceof QueryModel)
        {
            result = createCQLNode(((QueryModel) node).getRoot(), sourceNamespace, targetNamespace, complexSupport);
        }
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

  protected ModelAndView handleQueryRequest(HttpServletRequest request,
      HttpServletResponse response, BindException errors,String query)
      throws CQLParseException, IOException, InstantiationException, ParseException {
    //String query = request.getParameter("query");           
    CQLParser parser = new CQLParser();
    CQLNode root = parser.parse(query);
    root = normalizeParseTree(root);
    Set<Study> queryResults = doCQLQuery(root, new HashSet<Study>(),request, response, errors);
    StudySearchResults tsr = new StudySearchResults(queryResults);
    if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) {
      saveSearchResults(request, tsr);
View Full Code Here

Examples of org.z3950.zing.cql.CQLNode

  protected ModelAndView handleQueryRequest(HttpServletRequest request,
      HttpServletResponse response, BindException errors, String query)
      throws CQLParseException, IOException, InstantiationException {
    //String query = request.getParameter("query");
    CQLParser parser = new CQLParser();
    CQLNode root = parser.parse(query);
    root = normalizeParseTree(root);
    Set<Taxon> queryResults = doCQLQuery(root, new HashSet<Taxon>(),request);
    TaxonSearchResults tsr = new TaxonSearchResults(queryResults);
    saveSearchResults(request, tsr);
    if ( TreebaseUtil.isEmpty(request.getParameter("format")) ||
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.