cwltool.provenance_profile

Module Contents

Classes

ProvenanceProfile

Provenance profile.

Functions

copy_job_order(job, job_order_object)

Create copy of job object for provenance.

cwltool.provenance_profile.copy_job_order(job, job_order_object)

Create copy of job object for provenance.

Parameters
  • job (Union[cwltool.process.Process, cwltool.utils.JobsType]) –

  • job_order_object (cwltool.utils.CWLObjectType) –

Return type

cwltool.utils.CWLObjectType

class cwltool.provenance_profile.ProvenanceProfile(research_object, full_name, host_provenance, user_provenance, orcid, fsaccess, run_uuid=None)

Provenance profile.

Populated as the workflow runs.

Parameters
__str__(self)

Represent this Provenvance profile as a string.

Return type

str

generate_prov_doc(self)

Add basic namespaces.

Return type

Tuple[str, prov.model.ProvDocument]

evaluate(self, process, job, job_order_object, research_obj)

Evaluate the nature of job.

Parameters
Return type

None

record_process_start(self, process, job, process_run_id=None)
Parameters
Return type

Optional[str]

start_process(self, process_name, when, process_run_id=None)

Record the start of each Process.

Parameters
  • process_name (str) –

  • when (datetime.datetime) –

  • process_run_id (Optional[str]) –

Return type

str

record_process_end(self, process_name, process_run_id, outputs, when)
Parameters
  • process_name (str) –

  • process_run_id (str) –

  • outputs (Union[cwltool.utils.CWLObjectType, MutableSequence[cwltool.utils.CWLObjectType], None]) –

  • when (datetime.datetime) –

Return type

None

declare_file(self, value)
Parameters

value (cwltool.utils.CWLObjectType) –

Return type

Tuple[prov.model.ProvEntity, prov.model.ProvEntity, str]

declare_directory(self, value)

Register any nested files/directories.

Parameters

value (cwltool.utils.CWLObjectType) –

Return type

prov.model.ProvEntity

declare_string(self, value)

Save as string in UTF-8.

Parameters

value (str) –

Return type

Tuple[prov.model.ProvEntity, str]

declare_artefact(self, value)

Create data artefact entities for all file objects.

Parameters

value (Any) –

Return type

prov.model.ProvEntity

used_artefacts(self, job_order, process_run_id, name=None)

Add used() for each data artefact.

Parameters
  • job_order (Union[cwltool.utils.CWLObjectType, List[cwltool.utils.CWLObjectType]]) –

  • process_run_id (str) –

  • name (Optional[str]) –

Return type

None

generate_output_prov(self, final_output, process_run_id, name)

Call wasGeneratedBy() for each output,copy the files into the RO.

Parameters
  • final_output (Union[cwltool.utils.CWLObjectType, MutableSequence[cwltool.utils.CWLObjectType], None]) –

  • process_run_id (Optional[str]) –

  • name (Optional[str]) –

Return type

None

prospective_prov(self, job)

Create prospective prov recording as wfdesc prov:Plan.

Parameters

job (cwltool.utils.JobsType) –

Return type

None

activity_has_provenance(self, activity, prov_ids)

Add http://www.w3.org/TR/prov-aq/ relations to nested PROV files.

Parameters
  • self (str) –

  • activity (List[prov.identifier.Identifier]) –

Return type

None

finalize_prov_profile(self, name)

Transfer the provenance related files to the RO.

Parameters

self (Optional[str]) –

Return type

List[prov.identifier.Identifier]