Package org.apache.marmotta.platform.core.exception

Examples of org.apache.marmotta.platform.core.exception.InvalidArgumentException


            log.error("error while getting repository connection");
            throw new MarmottaException("error while getting repository connection",ex);
        } catch (QueryEvaluationException e) {
            throw new MarmottaException("error while evaluating SPARQL query "+query,e);
        } catch (MalformedQueryException e) {
            throw new InvalidArgumentException("malformed SPARQL query ("+query+") for language "+queryLanguage,e);
        }

        log.debug("SPARQL execution took {}ms",System.currentTimeMillis()-start);
        return result;
    }
View Full Code Here


        if(format == null) {
            resultFormat = TupleQueryResultFormat.SPARQL;
        } else {
            resultFormat = QueryResultIO.getWriterFormatForMIMEType(format);
            if(resultFormat == null) {
                throw new InvalidArgumentException("could not produce format "+format);
            }
        }
        TupleQueryResultWriter writer = QueryResultIO.createWriter(resultFormat, os);
        if(writer.getSupportedSettings().contains(SPARQLHTMLSettings.TEMPLATING_SERVICE)) {
            writer.getWriterConfig().set(SPARQLHTMLSettings.TEMPLATING_SERVICE, templatingService);
View Full Code Here

        if(format == null) {
            resultFormat = BooleanQueryResultFormat.SPARQL;
        } else {
            resultFormat = QueryResultIO.getBooleanWriterFormatForMIMEType(format);
            if(resultFormat == null) {
                throw new InvalidArgumentException("could not produce format "+format);
            }
        }
        return QueryResultIO.createWriter(resultFormat, os);
    }
View Full Code Here

            out = new SPARQLResultsJSONWriter(os);
        } else if(parseSubType(format).equals("xml")) {
            out = new SPARQLResultsXMLWriter(os);
        } else if(parseSubType(format).equals("csv")) {
            out = new SPARQLResultsCSVWriter(os);
        } else throw new InvalidArgumentException("could not produce format "+format);
        return out;
    }
View Full Code Here

            out = new SPARQLBooleanJSONWriter(os);
        } else if(parseSubType(format).equals("xml")) {
            out = new SPARQLBooleanXMLWriter(os);
        } else if(parseSubType(format).equals("csv")) {
            out = new BooleanTextWriter(os);
        } else throw new InvalidArgumentException("could not produce format "+format);
        return out;
    }
View Full Code Here

                    query((BooleanQuery) sparqlQuery, booleanWriter);
                } else if (sparqlQuery instanceof GraphQuery) {
                    query((GraphQuery) sparqlQuery, graphWriter);
                } else {
                    connection.rollback();
                    throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                }

                connection.commit();
            } finally {
                connection.close();
View Full Code Here

                } else if (sparqlQuery instanceof BooleanQuery) {
                  query((BooleanQuery)sparqlQuery, output, format);
                } else if (sparqlQuery instanceof GraphQuery) {
                  query((GraphQuery)sparqlQuery, output, format);
                } else {
                    throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                }

                connection.commit();
      } finally {
                connection.close();
View Full Code Here

            log.error("error while getting repository connection");
            throw new MarmottaException("error while getting repository connection",ex);
        } catch (QueryEvaluationException e) {
            throw new MarmottaException("error while evaluating SPARQL query "+query,e);
        } catch (MalformedQueryException e) {
            throw new InvalidArgumentException("malformed SPARQL query ("+query+") for language "+queryLanguage,e);
        }

        log.debug("SPARQL execution took {}ms",System.currentTimeMillis()-start);
        return result;
    }
View Full Code Here

            out = new SPARQLResultsJSONWriter(os);
        } else if(SparqlWritersHelper.parseSubType(format).equals("xml")) {
            out = new SPARQLResultsXMLWriter(os);
        } else if(SparqlWritersHelper.parseSubType(format).equals("csv")) {
            out = new SPARQLResultsCSVWriter(os);
        } else throw new InvalidArgumentException("could not produce format "+format);
        return out;
    }
View Full Code Here

            out = new SPARQLBooleanJSONWriter(os);
        } else if(SparqlWritersHelper.parseSubType(format).equals("xml")) {
            out = new SPARQLBooleanXMLWriter(os);
        } else if(SparqlWritersHelper.parseSubType(format).equals("csv")) {
            out = new BooleanTextWriter(os);
        } else throw new InvalidArgumentException("could not produce format "+format);
        return out;
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.platform.core.exception.InvalidArgumentException

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.