Package org.openrdf.query

Examples of org.openrdf.query.MalformedQueryException


  {
    try {
      request.execute();
    }
    catch (MalformedQuery e) {
      throw new MalformedQueryException(e);
    }
    catch (UnsupportedQueryLanguage e) {
      throw new UnsupportedQueryLanguageException(e);
    }
    catch (UnsupportedFileFormat e) {
View Full Code Here


      ByteArrayInputStream buf = new ByteArrayInputStream(decode(query));
      ObjectInputStream stream = new ObjectInputStream(buf);
      return (QueryModel)stream.readObject();
    }
    catch (IOException e) {
      throw new MalformedQueryException(e);
    }
    catch (ClassNotFoundException e) {
      throw new MalformedQueryException(e);
    }
  }
View Full Code Here

    for (ASTPrefixDecl prefixDecl : prefixDeclList) {
      String prefix = prefixDecl.getPrefix();
      String iri = prefixDecl.getIRI().getValue();

      if (prefixMap.containsKey(prefix)) {
        throw new MalformedQueryException("Multiple prefix declarations for prefix '" + prefix + "'");
      }

      prefixMap.put(prefix, iri);
    }

    QNameProcessor visitor = new QNameProcessor(prefixMap);
    try {
      qc.jjtAccept(visitor, null);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e);
    }

    return prefixMap;
  }
View Full Code Here

      }

      return query;
    }
    catch (ParseException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
    catch (TokenMgrError e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
  }
View Full Code Here

  {
    try {
      qc.jjtAccept(new ProjectionProcessor(), null);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      QueryModelBuilder qmBuilder = new QueryModelBuilder(valueFactory);
      return (TupleExpr)node.jjtAccept(qmBuilder, null);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
  }
View Full Code Here

    ASTBaseDecl baseDecl = qc.getBaseDecl();
    if (baseDecl != null) {
      parsedBaseURI = new ParsedURI(baseDecl.getIRI());

      if (!parsedBaseURI.isAbsolute()) {
        throw new MalformedQueryException("BASE IRI is not an absolute IRI: " + externalBaseURI);
      }
    }
    else if (externalBaseURI != null) {
      // Use external base URI if the query doesn't contain one itself
      parsedBaseURI = new ParsedURI(externalBaseURI);

      if (!parsedBaseURI.isAbsolute()) {
        throw new IllegalArgumentException("Supplied base URI is not an absolute IRI: " + externalBaseURI);
      }
    }
    else {
      // FIXME: use the "Default Base URI"?
    }

    if (parsedBaseURI != null) {
      RelativeIRIResolver visitor = new RelativeIRIResolver(parsedBaseURI);
      try {
        qc.jjtAccept(visitor, null);
      }
      catch (VisitorException e) {
        throw new MalformedQueryException(e);
      }
    }
  }
View Full Code Here

      }

      return query;
    }
    catch (ParseException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
    catch (TokenMgrError e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
  }
View Full Code Here

    TupleExprBuilder tupleExprBuilder = new TupleExprBuilder(new ValueFactoryImpl());
    try {
      return (TupleExpr)qc.jjtAccept(tupleExprBuilder, null);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e.getMessage(), e);
    }
  }
View Full Code Here

  {
    try {
      qc.jjtAccept(new BlankNodeToVarConverter(), null);
    }
    catch (VisitorException e) {
      throw new MalformedQueryException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.query.MalformedQueryException

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.