// Create the activities
RDFActivity rdfActivity = new RDFActivity(SPARQLquery);
DeliverToRequestStatus deliverToRequestStatus =
new DeliverToRequestStatus();
TupleToWebRowSetCharArrays tupleToWebRowSet =
new TupleToWebRowSetCharArrays();
tupleToWebRowSet.connectDataInput(rdfActivity.getDataOutput());
// Connect the output of RDFResource to DeliverToRequestStatus
deliverToRequestStatus.connectInput(tupleToWebRowSet.getResultOutput());
// Create the workflow
PipelineWorkflow pipeline = new PipelineWorkflow();
pipeline.add(rdfActivity);
pipeline.add(tupleToWebRowSet);
pipeline.add(deliverToRequestStatus);
// Excecute the workflow
RequestResource req = null;
try
{
req = mDRER.execute(pipeline, RequestExecutionType.SYNCHRONOUS);
}
catch( RequestExecutionException e)
{
LOG.debug("There was an error executing the workflow");
LOG.debug(e.getRequestResource().getRequestStatus());
throw e;
}
List<List<String>> results = new ArrayList<List<String>>();
if (tupleToWebRowSet.hasNextResult())
{
// Get ResultSet.
ResultSet resultSet = tupleToWebRowSet.nextResultAsResultSet();
// Get ResultSet metadata.
ResultSetMetaData metaData = resultSet.getMetaData();
// Print column names.
int numColumns = metaData.getColumnCount();
StringBuilder columns = new StringBuilder();