You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by aj...@apache.org on 2016/11/09 15:40:29 UTC

svn commit: r1768990 - /jena/site/trunk/content/documentation/query/http-auth.mdtext

Author: ajs6f
Date: Wed Nov  9 15:40:29 2016
New Revision: 1768990

URL: http://svn.apache.org/viewvc?rev=1768990&view=rev
Log:
Adding note about remote query execution vs. authN

Modified:
    jena/site/trunk/content/documentation/query/http-auth.mdtext

Modified: jena/site/trunk/content/documentation/query/http-auth.mdtext
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/query/http-auth.mdtext?rev=1768990&r1=1768989&r2=1768990&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/query/http-auth.mdtext (original)
+++ jena/site/trunk/content/documentation/query/http-auth.mdtext Wed Nov  9 15:40:29 2016
@@ -77,6 +77,17 @@ For this case we introduce an [HttpClien
 	    .setDefaultCookieStore(cookieStore)
 		.build();
     HttpOp.setDefaultHttpClient(httpclient);
+	
+	// alternatively we could use the context directly
+	Query query = ...
+	QueryEngineHTTP qEngine = QueryExecutionFactory.createServiceRequest("http:example.com/someSPARQL", query);
+	qEngine.setHttpContext(httpContext);
+	ResultSet results = qEngine.execSelect();
+	
+
+### Using authentication functionality in direct query execution
+
+Jena offers support for [directly creating](sparql-remote.html#from-your-application) SPARQL queries against remote services. To use [QueryExecutionFactory][18] in this case, select the methods (`sparqlService`, `createServiceRequest`) that offer an `HttpClient` parameter and use an authenticating client in that slot. In the case of [QueryEngineHTTP][9], it is possible to use constructors that have a parameter slot for an `HttpClient`, but it is also possible post-construction to use `setClient(HttpClient client)` and `setHttpContext(HttpClientContext context)` (as shown above). These techniques allow control over HTTP behavior when requests are made to remote services.
 
 ## HTTP Authentication from Jena 3.0.0 through 3.1.0
 
@@ -229,4 +240,5 @@ ARQ allows the user to configure HTTP be
   [14]: http://hc.apache.org
   [15]: https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/HttpClient.html
   [16]: https://hc.apache.org/httpcomponents-client-ga/examples.html
-  [17]: https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/HttpClientContext.html
\ No newline at end of file
+  [17]: https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/HttpClientContext.html
+  [18]: https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/QueryExecutionFactory.html
\ No newline at end of file