net.sf.taverna.t2.provenance.lineageservice
Class ProvenanceAnalysis

java.lang.Object
  extended by net.sf.taverna.t2.provenance.lineageservice.ProvenanceAnalysis

public class ProvenanceAnalysis
extends java.lang.Object

Author:
paolo

the main class for querying the lineage DB assumes a provenance DB ready to be queried


Field Summary
static java.lang.String ALL_PATHS_KEYWORD
           
 
Constructor Summary
ProvenanceAnalysis()
           
ProvenanceAnalysis(ProvenanceQuery pq)
           
 
Method Summary
 java.util.List<Dependencies> computeLineageSingleBinding(java.lang.String wfID, java.lang.String wfNameRef, java.lang.String var, java.lang.String proc, java.lang.String path, java.util.List<ProvenanceProcessor> selectedProcessors)
          main lineage query method.
 java.util.Map<java.lang.String,java.util.List<Dependencies>> computeLineageSingleVar(java.lang.String wfInstance, java.lang.String wfNameRef, java.lang.String var, java.lang.String proc, java.lang.String path, java.util.List<ProvenanceProcessor> selectedProcessors)
          facade for computeLineage: if path == ALL then it retrieves all VBs for (proc,var) ignoring path (i.e., all values within the collection bound to var) and invokes computeLineageSingleBinding() on each path
if path is specified, however, this just passes the request to computeLineageSingleBinding.
 Dependencies fetchIntermediateResult(java.lang.String wfInstance, java.lang.String wfNameRef, java.lang.String pname, java.lang.String vname, java.lang.String iteration)
           
 net.sf.taverna.t2.invocation.InvocationContext getInvocationContext()
           
 ProvenanceQuery getPq()
           
 java.util.Map<ProvenanceProcessor,java.util.List<java.util.List<java.lang.String>>> getValidPaths()
           
 java.util.List<WorkflowInstance> getWFInstanceID(java.lang.String wfName)
          returns all available instances for workflow wfName
 java.util.List<WorkflowInstance> getWFInstanceIDs()
          returns all available instances across all workflows
 void initGraph()
          Call to create the opm graph and annotation loader.
 boolean isGenerateOPMGraph()
           
 boolean isIncludeDataValue()
           
 boolean isReady()
           
 boolean isRecordArtifactValues()
           
 boolean isReturnOutputs()
           
 QueryAnswer lineageQuery(java.util.List<QueryVar> qvList, java.lang.String wfInstance, java.util.List<ProvenanceProcessor> selectedProcessors)
           
 java.lang.String OPMRdf2Dot()
          asks the OPM manager to create a dot file representing its current RDF OPMGraph
needs fixing
 java.util.List<LineageSQLQuery> searchDataflowGraph(java.lang.String wfID, java.lang.String wfNameRef, java.lang.String var, java.lang.String proc, java.lang.String path, java.util.List<ProvenanceProcessor> selectedProcessors)
          compute lineage queries using path projections
 void setAnnotationFile(java.lang.String annotationFile)
           
 void setGenerateOPMGraph(boolean generateOPMGraph)
           
 void setIncludeDataValue(boolean includeDataValue)
           
 void setInvocationContext(net.sf.taverna.t2.invocation.InvocationContext context)
           
 void setPq(ProvenanceQuery pq)
           
 void setReady(boolean ready)
           
 void setRecordArtifactValues(boolean recordArtifactValues)
           
 void setReturnOutputs(boolean returnOutputs)
           
 void setValidPaths(java.util.Map<ProvenanceProcessor,java.util.List<java.util.List<java.lang.String>>> validPaths)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_PATHS_KEYWORD

public static final java.lang.String ALL_PATHS_KEYWORD
See Also:
Constant Field Values
Constructor Detail

ProvenanceAnalysis

public ProvenanceAnalysis()

ProvenanceAnalysis

public ProvenanceAnalysis(ProvenanceQuery pq)
                   throws java.lang.InstantiationException,
                          java.lang.IllegalAccessException,
                          java.lang.ClassNotFoundException,
                          java.sql.SQLException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException
Method Detail

initGraph

public void initGraph()
Call to create the opm graph and annotation loader. this may fail due to queries being issued before DB is populated, minimally with wfInstanceID


OPMRdf2Dot

public java.lang.String OPMRdf2Dot()
                            throws org.tupeloproject.kernel.OperatorException,
                                   java.io.IOException
asks the OPM manager to create a dot file representing its current RDF OPMGraph
needs fixing

Returns:
Throws:
java.io.IOException
org.tupeloproject.kernel.OperatorException

setAnnotationFile

public void setAnnotationFile(java.lang.String annotationFile)

getWFInstanceIDs

public java.util.List<WorkflowInstance> getWFInstanceIDs()
                                                  throws java.sql.SQLException
returns all available instances across all workflows

Returns:
Throws:
java.sql.SQLException

getWFInstanceID

public java.util.List<WorkflowInstance> getWFInstanceID(java.lang.String wfName)
                                                 throws java.sql.SQLException
returns all available instances for workflow wfName

Parameters:
wfName -
Returns:
Throws:
java.sql.SQLException

fetchIntermediateResult

public Dependencies fetchIntermediateResult(java.lang.String wfInstance,
                                            java.lang.String wfNameRef,
                                            java.lang.String pname,
                                            java.lang.String vname,
                                            java.lang.String iteration)
                                     throws java.sql.SQLException
Parameters:
wfInstance - lineage scope -- a specific instance
pname - for a specific processor [required]
a - specific (input or output) variable [optional]
iteration - and a specific iteration [optional]
wfNameRef -
Returns:
a lineage query ready to be executed, or null if we cannot return an answer because we are not ready (for instance the DB is not yet populated)
Throws:
java.sql.SQLException

lineageQuery

public QueryAnswer lineageQuery(java.util.List<QueryVar> qvList,
                                java.lang.String wfInstance,
                                java.util.List<ProvenanceProcessor> selectedProcessors)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

computeLineageSingleVar

public java.util.Map<java.lang.String,java.util.List<Dependencies>> computeLineageSingleVar(java.lang.String wfInstance,
                                                                                            java.lang.String wfNameRef,
                                                                                            java.lang.String var,
                                                                                            java.lang.String proc,
                                                                                            java.lang.String path,
                                                                                            java.util.List<ProvenanceProcessor> selectedProcessors)
                                                                                     throws java.sql.SQLException
facade for computeLineage: if path == ALL then it retrieves all VBs for (proc,var) ignoring path (i.e., all values within the collection bound to var) and invokes computeLineageSingleBinding() on each path
if path is specified, however, this just passes the request to computeLineageSingleBinding. in this case the result map only contains one entry

Parameters:
wfInstance -
var -
proc -
path -
string -
selectedProcessors -
Returns:
a map
{ path -> List }
, one entry for each path
Throws:
java.sql.SQLException

computeLineageSingleBinding

public java.util.List<Dependencies> computeLineageSingleBinding(java.lang.String wfID,
                                                                java.lang.String wfNameRef,
                                                                java.lang.String var,
                                                                java.lang.String proc,
                                                                java.lang.String path,
                                                                java.util.List<ProvenanceProcessor> selectedProcessors)
                                                         throws java.sql.SQLException
main lineage query method. queries the provenance DB with a single originating proc/var/path and a set of selected Processors

Parameters:
wfID -
var -
proc -
path -
path2 -
selectedProcessors -
Returns:
a list of bindings. each binding involves an input var for one of the selectedProcessors. Note each var can contribute multiple bindings, i.e., when all elements in a collection bound to the var are retrieved. Note also that bindings for input vars are returned as well, when the query is configured with returnOutputs = true isReturnOutputs()
Throws:
java.sql.SQLException

searchDataflowGraph

public java.util.List<LineageSQLQuery> searchDataflowGraph(java.lang.String wfID,
                                                           java.lang.String wfNameRef,
                                                           java.lang.String var,
                                                           java.lang.String proc,
                                                           java.lang.String path,
                                                           java.util.List<ProvenanceProcessor> selectedProcessors)
                                                    throws java.sql.SQLException
compute lineage queries using path projections

Parameters:
wfID - the (single) instance defines the scope of a query
added 2/9: collect a list of paths in the process to be used by the naive query. In practice we use this as the graph search phase that is needed by the naive query anyway
var -
proc -
path - within var (can be empty but not null)
selectedProcessors - pairs (wfID, proceName), encoded as a Map. only report lineage when you reach any of these processors
Throws:
java.sql.SQLException

getValidPaths

public java.util.Map<ProvenanceProcessor,java.util.List<java.util.List<java.lang.String>>> getValidPaths()
Returns:
the validPaths

setValidPaths

public void setValidPaths(java.util.Map<ProvenanceProcessor,java.util.List<java.util.List<java.lang.String>>> validPaths)
Parameters:
validPaths - the validPaths to set

setPq

public void setPq(ProvenanceQuery pq)

getPq

public ProvenanceQuery getPq()

isReady

public boolean isReady()
Returns:
the ready

setReady

public void setReady(boolean ready)
Parameters:
ready - the ready to set

isReturnOutputs

public boolean isReturnOutputs()
Returns:
the returnOutputs

setReturnOutputs

public void setReturnOutputs(boolean returnOutputs)
Parameters:
returnOutputs - the returnOutputs to set

isRecordArtifactValues

public boolean isRecordArtifactValues()
Returns:
the recordArtifactValues

setRecordArtifactValues

public void setRecordArtifactValues(boolean recordArtifactValues)
Parameters:
recordArtifactValues - the recordArtifactValues to set

isIncludeDataValue

public boolean isIncludeDataValue()
Returns:
the includeDataValue

setIncludeDataValue

public void setIncludeDataValue(boolean includeDataValue)
Parameters:
includeDataValue - the includeDataValue to set

isGenerateOPMGraph

public boolean isGenerateOPMGraph()
Returns:
the generateOPMGraph

setGenerateOPMGraph

public void setGenerateOPMGraph(boolean generateOPMGraph)
Parameters:
generateOPMGraph - the generateOPMGraph to set

setInvocationContext

public void setInvocationContext(net.sf.taverna.t2.invocation.InvocationContext context)

getInvocationContext

public net.sf.taverna.t2.invocation.InvocationContext getInvocationContext()