+ " ?film2 p:starring ?actor2 . }";
RDFActivity rdfActivity = new RDFActivity(SPARQLquery);
// rdfActivity.setResourceID("jorge");
TupleToWebRowSetCharArrays tupleToWebRowSet = new TupleToWebRowSetCharArrays();
tupleToWebRowSet.connectDataInput(rdfActivity.getDataOutput());
WriteToDataSource writeToDataSource = new WriteToDataSource();
writeToDataSource.setResourceID(dataSourceID);
writeToDataSource.connectInput(tupleToWebRowSet.getResultOutput());
// Connect the output of RDFResource to DeliverToRequestStatus
PipelineWorkflow pipeline = new PipelineWorkflow();
pipeline.add(rdfActivity);
pipeline.add(tupleToWebRowSet);
pipeline.add(writeToDataSource);
RequestResource requestResource = drer.execute(pipeline,
RequestExecutionType.ASYNCHRONOUS);
requestResource.pollUntilRequestStarted(1000);
// Get the data
TupleToWebRowSetCharArrays tupleToWebRowSet2 = new TupleToWebRowSetCharArrays();
tupleToWebRowSet2.getResultOutput().setDataSourceResource(dataSource);
System.out.println("Data Source Status... "
+ dataSource.getStatus().toString());
System.out.println(requestResource.getRequestExecutionStatus()
.toString());
RequestStatus requestStatus = requestResource.getRequestStatus();
while ("uk.org.ogsadai.resource.request.status.PROCESSING"
.equals(requestResource.getRequestExecutionStatus().toString()))
{
System.out.println("waiting the workflow to finish...");
Iterator<DataValue> it = requestStatus.getDataValueIterator(
rdfActivity.getInstanceName(), "rdfdata");
if (it.hasNext())
{
it.next().toString();
System.out.println("probando el indirecto...");
}
}
System.out.println(requestResource.getRequestExecutionStatus()
.toString());
Thread.sleep(10000);
if (tupleToWebRowSet2.hasNextResult())
{
System.out.println("Data Source Status... "
+ dataSource.getStatus().toString());
// Get ResultSet.
ResultSet resultSet = tupleToWebRowSet2.nextResultAsResultSet();
// Get ResultSet metadata.
ResultSetMetaData metaData = resultSet.getMetaData();
// Print column names.
int numColumns = metaData.getColumnCount();
String columns = "";