sparqlQueryService/src/main/java/com/ge/research/semtk/services/sparql/SparqlQueryServiceRestController.java
@CrossOrigin
	@RequestMapping(value="/parallelQuery", method= RequestMethod.POST)
	public JSONObject parallelQuery(@RequestBody SparqlParallelQueryRequestBody requestBody, @RequestHeader HttpHeaders headers) {
		HeadersManager.setHeaders(headers);

		LocalLogger.logToStdOut("Sparql Query Service start parallelQuery");

		try{
			SparqlParallelQueries spq = new SparqlParallelQueries (requestBody.subqueriesJson, requestBody.subqueryType, requestBody.isSubqueryOptional, requestBody.columnsToFuseOn, requestBody.columnsToReturn);
			spq.runQueries ();
			JSONObject tableResultSetJSON = spq.returnFusedResults();
			return tableResultSetJSON;			
		} catch (Exception e) {			
			LocalLogger.printStackTrace(e);	
			GeneralResultSet resultSet = new SimpleResultSet();
			resultSet.setSuccess(false);
			resultSet.addRationaleMessage(SERVICE_NAME, "parallelQuery", e);
			return resultSet.toJson();
		} catch (Throwable e) {
			LocalLogger.printStackTrace(e);	
			GeneralResultSet resultSet = new SimpleResultSet();
			resultSet.setSuccess(false);
			resultSet.addRationaleMessage(SERVICE_NAME, "parallelQuery", "Throwable: " + e.getMessage());
			return resultSet.toJson();
		} finally {
			HeadersManager.setHeaders(new HttpHeaders());
		}
	}
/**
	 * Executes multiple subqueries in parallel and fuses the results.  
	 * Returns a table result set in JSON format.
	 * 
	 * subqueriesJson		JSON containing triple store connection and subqueries
	 * subqueryType			"select" supported for now, perhaps others in the future
	 * isSubqueryOptional	true to return records from one subquery result that do not match another subquery result
	 * columnsToFuseOn		columns to merge subquery results, comma-separated
	 * columnsToReturn		columns to return from the overall query, comma-separated
	 */
Executes multiple subqueries in parallel and fuses the results.
Returns a table result set in JSON format.

subqueriesJson               JSON containing triple store connection and subqueries
subqueryType                 "select" supported for now, perhaps others in the future
isSubqueryOptional   true to return records from one subquery result that do not match another subquery result
columnsToFuseOn              columns to merge subquery results, comma-separated
columnsToReturn              columns to return from the overall query, comma-separated
Executes multiple subqueries in parallel and fuses the results . Returns a table result set in JSON format . subqueriesJson JSON containing triple store connection and subqueries subqueryType " select " supported for now perhaps others in the future isSubqueryOptional true to return records from one subquery result that do not match another subquery result columnsToFuseOn columns to merge subquery results comma - separated columnsToReturn columns to return from the overall query comma - separated
@CrossOrigin
	@RequestMapping(value="/parallelQuery", method= RequestMethod.POST)
	public JSONObject parallelQuery(@RequestBody SparqlParallelQueryRequestBody requestBody, @RequestHeader HttpHeaders headers) {
		HeadersManager.setHeaders(headers);
		LocalLogger.logToStdOut("Sparql Query Service start parallelQuery");
		try{
			SparqlParallelQueries spq = new SparqlParallelQueries (requestBody.subqueriesJson, requestBody.subqueryType, requestBody.isSubqueryOptional, requestBody.columnsToFuseOn, requestBody.columnsToReturn);
			spq.runQueries ();
			JSONObject tableResultSetJSON = spq.returnFusedResults();
			return tableResultSetJSON;			
		} catch (Exception e) {			
			LocalLogger.printStackTrace(e);	
			GeneralResultSet resultSet = new SimpleResultSet();
			resultSet.setSuccess(false);
			resultSet.addRationaleMessage(SERVICE_NAME, "parallelQuery", e);
			return resultSet.toJson();
		} catch (Throwable e) {
			LocalLogger.printStackTrace(e);	
			GeneralResultSet resultSet = new SimpleResultSet();
			resultSet.setSuccess(false);
			resultSet.addRationaleMessage(SERVICE_NAME, "parallelQuery", "Throwable: " + e.getMessage());
			return resultSet.toJson();
		} finally {
			HeadersManager.setHeaders(new HttpHeaders());
		}
	}
@ CrossOrigin @ RequestMapping ( value = "/parallelQuery" , method = RequestMethod . POST ) public JSONObject parallelQuery ( @ RequestBody SparqlParallelQueryRequestBody requestBody , @ RequestHeader HttpHeaders headers ) { HeadersManager . setHeaders ( headers ) ; LocalLogger . logToStdOut ( "Sparql Query Service start parallelQuery" ) ; try { SparqlParallelQueries spq = new SparqlParallelQueries ( requestBody . subqueriesJson , requestBody . subqueryType , requestBody . isSubqueryOptional , requestBody . columnsToFuseOn , requestBody . columnsToReturn ) ; spq . runQueries ( ) ; JSONObject tableResultSetJSON = spq . returnFusedResults ( ) ; return tableResultSetJSON ; } catch ( Exception e ) { LocalLogger . printStackTrace ( e ) ; GeneralResultSet resultSet = new SimpleResultSet ( ) ; resultSet . setSuccess ( false ) ; resultSet . addRationaleMessage ( SERVICE_NAME , "parallelQuery" , e ) ; return resultSet . toJson ( ) ; } catch ( Throwable e ) { LocalLogger . printStackTrace ( e ) ; GeneralResultSet resultSet = new SimpleResultSet ( ) ; resultSet . setSuccess ( false ) ; resultSet . addRationaleMessage ( SERVICE_NAME , "parallelQuery" , "Throwable: " + e . getMessage ( ) ) ; return resultSet . toJson ( ) ; } finally { HeadersManager . setHeaders ( new HttpHeaders ( ) ) ; } }
Executes multiple subqueries in parallel and fuses the results.
Executes multiple subqueries in parallel and fuses the results .