connectionUtils/src/main/java/com/ge/research/semtk/sparqlX/SparqlEndpointInterface.java
public JSONObject executeQueryPost(String query, SparqlResultTypes resultType) throws Exception{
		AuthorizationManager.authorizeQuery(this, query);
		
        // get client, adding userName/password credentials if any exist
		HttpHost targetHost = this.buildHttpHost();
        HttpClient httpclient = this.buildHttpClient(targetHost.getSchemeName());
		// get context with digest auth if there is a userName, else null context
		BasicHttpContext localcontext = this.buildHttpContext(targetHost);
     
		// create the HttpPost
		HttpPost httppost = new HttpPost(this.getPostURL(resultType));
		
		this.addParams(httppost, query, resultType);
		this.addHeaders(httppost, resultType);
		
		
		// parse the response
		HttpEntity entity = null;
		try {
			// execute
			long startTime=0;
			if (this.logPerformance) { 
				startTime = System.nanoTime();
			}
				
			HttpResponse response_http = httpclient.execute(targetHost, httppost, localcontext);
			
			if (this.logPerformance) { 
				LocalLogger.logToStdOut(query);
				LocalLogger.logElapsedToStdOut("query timer", startTime);
			}
			
				
			entity = response_http.getEntity();
			String responseTxt = EntityUtils.toString(entity, "UTF-8");
		
			// parse response
			return this.parseResponse(resultType, responseTxt);
		} finally {
			if (entity != null) {
				EntityUtils.consume(entity);
			}
		}
	}
/**
	 * Execute a query using POST
	 * Adds Auth elements ONLY IF this.userName != null
	 * See "internal use" note
	 * @return a JSONObject wrapping the results. in the event the results were tabular, they can be obtained in the JsonArray "@Table". if the results were a graph, use "@Graph" for json-ld
	 * @throws Exception
	 */
Execute a query using POST
Adds Auth elements ONLY IF this.userName != null
See "internal use" note
@return a JSONObject wrapping the results. in the event the results were tabular, they can be obtained in the JsonArray "@Table". if the results were a graph, use "@Graph" for json-ld
@throws Exception
Execute a query using POST Adds Auth elements ONLY IF this . userName ! = null See " internal use " note @return a JSONObject wrapping the results . in the event the results were tabular they can be obtained in the JsonArray " @Table " . if the results were a graph use " @Graph " for json - ld @throws Exception
public JSONObject executeQueryPost(String query, SparqlResultTypes resultType) throws Exception{
		AuthorizationManager.authorizeQuery(this, query);
		HttpHost targetHost = this.buildHttpHost();
        HttpClient httpclient = this.buildHttpClient(targetHost.getSchemeName());
		BasicHttpContext localcontext = this.buildHttpContext(targetHost);
		HttpPost httppost = new HttpPost(this.getPostURL(resultType));
		this.addParams(httppost, query, resultType);
		this.addHeaders(httppost, resultType);
		HttpEntity entity = null;
		try {
			long startTime=0;
			if (this.logPerformance) { 
				startTime = System.nanoTime();
			}
			HttpResponse response_http = httpclient.execute(targetHost, httppost, localcontext);
			if (this.logPerformance) { 
				LocalLogger.logToStdOut(query);
				LocalLogger.logElapsedToStdOut("query timer", startTime);
			}
			entity = response_http.getEntity();
			String responseTxt = EntityUtils.toString(entity, "UTF-8");
			return this.parseResponse(resultType, responseTxt);
		} finally {
			if (entity != null) {
				EntityUtils.consume(entity);
			}
		}
	}
public JSONObject executeQueryPost ( String query , SparqlResultTypes resultType ) throws Exception { AuthorizationManager . authorizeQuery ( this , query ) ; HttpHost targetHost = this . buildHttpHost ( ) ; HttpClient httpclient = this . buildHttpClient ( targetHost . getSchemeName ( ) ) ; BasicHttpContext localcontext = this . buildHttpContext ( targetHost ) ; HttpPost httppost = new HttpPost ( this . getPostURL ( resultType ) ) ; this . addParams ( httppost , query , resultType ) ; this . addHeaders ( httppost , resultType ) ; HttpEntity entity = null ; try { long startTime = 0 ; if ( this . logPerformance ) { startTime = System . nanoTime ( ) ; } HttpResponse response_http = httpclient . execute ( targetHost , httppost , localcontext ) ; if ( this . logPerformance ) { LocalLogger . logToStdOut ( query ) ; LocalLogger . logElapsedToStdOut ( "query timer" , startTime ) ; } entity = response_http . getEntity ( ) ; String responseTxt = EntityUtils . toString ( entity , "UTF-8" ) ; return this . parseResponse ( resultType , responseTxt ) ; } finally { if ( entity != null ) { EntityUtils . consume ( entity ) ; } } }
Execute a query using POST
 Adds Auth elements ONLY IF this.userName != null
 See "internal use" note
 @return a JSONObject wrapping the results.
Execute a query using POST Adds Auth elements ONLY IF this . userName ! = null See " internal use " note @return a JSONObject wrapping the results .
// get client, adding userName/password credentials if any exist // get context with digest auth if there is a userName, else null context // create the HttpPost // parse the response // execute // parse response