Search in sources :

Example 1 with QuerySendMode

use of org.apache.jena.sparql.exec.http.QuerySendMode in project jena by apache.

the class rsparql method exec.

@Override
protected void exec() {
    Query query = modQuery.getQuery();
    try {
        String serviceURL = modRemote.getServiceURL();
        QuerySendMode sendMode = modRemote.usePost() ? QuerySendMode.asPost : QuerySendMode.systemDefault;
        QueryExecutionHTTP qe = QueryExecutionHTTPBuilder.create().endpoint(serviceURL).query(query).sendMode(sendMode).build();
        QueryExecUtils.executeQuery(query, qe, modResults.getResultsFormat());
    } catch (QueryExceptionHTTP ex) {
        throw new CmdException("HTTP Exception", ex);
    } catch (Exception ex) {
        System.out.flush();
        ex.printStackTrace(System.err);
    }
}
Also used : Query(org.apache.jena.query.Query) CmdException(org.apache.jena.cmd.CmdException) QueryExecutionHTTP(org.apache.jena.sparql.exec.http.QueryExecutionHTTP) QueryExceptionHTTP(org.apache.jena.sparql.engine.http.QueryExceptionHTTP) QuerySendMode(org.apache.jena.sparql.exec.http.QuerySendMode) CmdException(org.apache.jena.cmd.CmdException)

Aggregations

CmdException (org.apache.jena.cmd.CmdException)1 Query (org.apache.jena.query.Query)1 QueryExceptionHTTP (org.apache.jena.sparql.engine.http.QueryExceptionHTTP)1 QueryExecutionHTTP (org.apache.jena.sparql.exec.http.QueryExecutionHTTP)1 QuerySendMode (org.apache.jena.sparql.exec.http.QuerySendMode)1