Examples of QueryParseException


Examples of com.hp.hpl.jena.query.QueryParseException

        // Check for SELECT * GROUP BY
        // Legal in ARQ, not in SPARQL 1.1
        if ( ! Syntax.syntaxARQ.equals(query.getSyntax()) )
        {
            if ( query.isQueryResultStar() && query.hasGroupBy() )
                throw new QueryParseException("SELECT * not legal with GROUP BY", -1 , -1) ;
        }
       
        // Check any variable in an expression is in scope (if GROUP BY)
        checkExprVarUse(query) ;
       
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

                Var v = iter.next();
                Expr e = exprList.getExpr(v) ;
                if ( e == null )
                {
                    if ( ! groupVars.contains(v) )
                        throw new QueryParseException("Non-group key variable in SELECT: "+v, -1 , -1) ;
                }
                else
                {
                    Set<Var> eVars = e.getVarsMentioned() ;
                    for ( Var v2 : eVars )
                    {
                        if ( ! groupVars.contains(v2) )
                            throw new QueryParseException("Non-group key variable in SELECT: "+v2+" in expression "+e , -1 , -1) ;
                    }
                }
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

        if ( expr == null )
            return ;
       
        // expr not null
        if ( scope.contains(var) )
            throw new QueryParseException("Variable used when already in-scope: "+var+" in "+fmtAssignment(expr, var), -1 , -1) ;

        // test for impossible variables - bound() is a bit odd.
        if ( false )
        {
            Set<Var> vars = expr.getVarsMentioned() ;
            for ( Var v : vars )
            {
                if ( !scope.contains(v) )
                    throw new QueryParseException("Variable used in expression is not in-scope: "+v+" in "+expr, -1 , -1) ;
            }
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

       
        private static void check(Collection<Var> scope, ElementBind el)
        {
            Var var = el.getVar() ;
            if ( scope.contains(var) )
                throw new QueryParseException("BIND: Variable used when already in-scope: "+var+" in "+el, -1 , -1) ;
            checkAssignment(scope, el.getExpr(), var) ;
        }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

        {
            if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() )
            {
                Var var = Var.alloc(el.getServiceNode()) ;
                if ( ! scope.contains(var) )
                    throw new QueryParseException("SERVICE: Variable not already in-scope: "+var+" in "+el, -1 , -1) ;
            }
        }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

       
        if ( currentColumn+1 != variables.size() )
        {
            String msg = String.format("Mismatch: %d variables but %d values",variables.size(), currentColumn+1) ;
            msg = QueryParseException.formatMessage(msg, line, col) ;
            throw new QueryParseException(msg, line , col) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryParseException

            try {
                // Possible too large for a long.
                BigInteger integer = new BigInteger(s) ;
                throwParseException("Number '"+s+"' is a valid number but can't not be stored in a long") ;
            } catch (NumberFormatException ex2) {}
            throw new QueryParseException(ex, -1, -1) ;
        }
    }
View Full Code Here

Examples of org.fcrepo.server.errors.QueryParseException

    public Condition(String property, Operator operator, String value)
            throws QueryParseException {
        m_property = property;
        m_operator = operator;
        if (value.indexOf("'") != -1) {
            throw new QueryParseException("Query cannot contain the ' character.");
        }
        m_value = value;
    }
View Full Code Here

Examples of org.saiku.olap.util.exception.QueryParseException

    if (queryElement != null && queryElement.getName().equals(QUERY)) {

      String cubeName = queryElement.getAttributeValue(CUBE);

      if (!StringUtils.isNotBlank(cubeName)) {
        throw new QueryParseException("Cube for query not defined");
      }
      String connectionName = queryElement.getAttributeValue(CONNECTION);
      String catalogName = queryElement.getAttributeValue(CATALOG);
      String schemaName = queryElement.getAttributeValue(SCHEMA);
      Query tmpQuery = createEmptyQuery("tmp-1234", catalogName, schemaName, cubeName);
View Full Code Here

Examples of org.saiku.olap.util.exception.QueryParseException

      String queryName = queryElement.getAttributeValue("name");
      String cubeName = queryElement.getAttributeValue(CUBE);

      if (!StringUtils.isNotBlank(cubeName)) {
        throw new QueryParseException("Cube for query not defined");
      }
      String connectionName = queryElement.getAttributeValue(CONNECTION);
      String catalogName = queryElement.getAttributeValue(CATALOG);
      String schemaName = queryElement.getAttributeValue(SCHEMA);

      try {
        Element qmElement = queryElement.getChild("QueryModel");
        if (qmElement != null) {
          qm = createEmptyQuery(queryName, catalogName, schemaName, cubeName);
          manipulateQuery(qmElement);
          SaikuCube cube =
              new SaikuCube(connectionName, cubeName, qm.getCube().getName(), qm.getCube().getCaption(), catalogName,
                  schemaName);
          IQuery q = new OlapQuery(qm, connection, cube, false);
          setTotals(q, queryElement);
          Properties p = getProperties(queryElement);
          q.setProperties(p);
          return q;
        } else {
          throw new OlapException("Can't find child <QueryModel>");
        }

      } catch (OlapException e) {
        throw new QueryParseException(e.getMessage(), e);
      }


    } else {
      throw new QueryParseException(
          "Cannot parse Query Model: Query node not found and/or more than 1 Query node found");
    }
  }
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.