Package com.hp.hpl.jena.sparql.engine.http

Examples of com.hp.hpl.jena.sparql.engine.http.HttpQuery


    // and com.hp.hpl.jena.query.QueryFactory could throw exceptions on
    // vendor-specific sections of the query, we use the lower-level
    // com.hp.hpl.jena.sparql.engine.http.HttpQuery to execute the query and
    // read the results into model.
   
    HttpQuery httpQuery = new HttpQuery(endpointURL);
    httpQuery.addParam("query", query);
    if (defaultGraphURI != null) {
      httpQuery.addParam("default-graph-uri", defaultGraphURI);
    }
    for (String[] param: queryParamsGraph) {
      httpQuery.addParam(param[0], param[1]);
    }
   
    // The rest is more or less a copy of QueryEngineHTTP.execModel()
    httpQuery.setAccept(contentType);
    InputStream in = httpQuery.exec();

    // Don't assume the endpoint actually gives back the content type we
    // asked for
    String actualContentType = httpQuery.getContentType();

    // If the server fails to return a Content-Type then we will assume
    // the server returned the type we asked for
    if (actualContentType == null || actualContentType.equals("")) {
      actualContentType = contentType;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.engine.http.HttpQuery

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.