Package org.z3950.zing.cql

Examples of org.z3950.zing.cql.CQLParser


        String output = "XCQL";
        if (!args[1].isEmpty())
            output = args[1].getStringValue();
       
          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;
        }
View Full Code Here


  }

  @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

  @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<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

  @Override
  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

    public CqlQuery(String cqlQuery)
    {
        try
        {
            logger.debug("Parsing CQL query: " + cqlQuery);
            this.rootNode = new CQLParser().parse(cqlQuery);
        }
        catch (CQLParseException e)
        {
            logger.error("CQL parsing error", e);
        }
View Full Code Here

  @Override
  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

  @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<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

      request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlBase());
      request.getSession().setAttribute("phyloWSPath", phyloWSPath);
      if ( null != request.getParameter("query") ) {     
        String query = request.getParameter("query");           
        if ( ! TreebaseUtil.isEmpty(query) ) {
          CQLParser parser = new CQLParser();
          CQLNode root = parser.parse(query);     
          request.getSession().setAttribute("normalizedCQLQuery", URLEncoder.encode(root.toCQL(),"UTF-8"));
        }
      }
    }
    return new ModelAndView("searchResultsAsRDF");
View Full Code Here

            result = attributePlusTermNode;
        }
        else if (node instanceof CQLPrefixNode)
        {
            CQLPrefixNode prefixNode = (CQLPrefixNode) node;
            result = new QueryModelNamespaceNode(prefixNode.prefix.name, translate(((CQLPrefixNode) node).subtree));
        }

        return result;
    }
View Full Code Here

        {
            QueryModelNamespaceNode namespaceNode = (QueryModelNamespaceNode) node;

            if (complexSupport)
            {
                result = new CQLPrefixNode(namespaceNode.getAttributeSet(), namespaceNode.getAttributeSet(), createCQLNode(namespaceNode.getRoot(), namespaceNode.getAttributeSet(), targetNamespace, complexSupport));
            }
            else
            {
                result = createCQLNode(namespaceNode.getRoot(), namespaceNode.getAttributeSet(), targetNamespace, complexSupport);
            }
View Full Code Here

TOP

Related Classes of org.z3950.zing.cql.CQLParser

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.