weaver.provenance
Definitions related to Provenance features and the W3C PROV specification.
Module Contents
- class weaver.provenance.ProvenancePathType[source]
Constants container that provides similar functionalities to
ExtendedEnumwithout explicit Enum membership.- classmethod get(prov: weaver.typedefs.AnyKey | weaver.base.EnumType | ProvenancePathType, default: Any | None = None, run_id: str | None = None) ProvenancePathType | None[source]
- class weaver.provenance.ProvenanceFormat[source]
Constants container that provides similar functionalities to
ExtendedEnumwithout explicit Enum membership.- classmethod get(prov_format: AnyProvenanceFormat | None, default: Any | None = None, allow_media_type: bool = False) ProvenanceFormat | None[source]
- classmethod media_types() List[weaver.formats.ContentType][source]
- classmethod formats() List[ProvenanceFormat | str][source]
- classmethod as_media_type(prov_format: AnyProvenanceFormat | None, output_format: weaver.formats.AnyOutputFormat | None = None) weaver.formats.AnyContentType | None[source]
- classmethod as_profile(prov_format: AnyProvenanceFormat | None, output_format: weaver.formats.AnyOutputFormat | None = None) weaver.typedefs.URL | None[source]
- classmethod resolve_compatible_formats(prov: ProvenancePathType | str | None, prov_format: ProvenanceFormat | str | None, output_format: weaver.formats.OutputFormat | str | None) Tuple[ProvenanceFormat | None, str | None][source]
Resolves multiple
OutputFormatandProvenanceFormatcombinations for compatible formats.Compatible formats depend on the PROV endpoint being requested. If output format is not specified, apply the corresponding PROV format that will work transparently. Otherwise, ensure they are aligned against the expected PROV endpoints and supported Media-Types.
- Returns:
Tuple of a resolved PROV format if only the output format was specified, and the relevant error detail if they are incompatible.
- class weaver.provenance.WeaverResearchObject(job: weaver.datatype.Job, settings: weaver.typedefs.AnySettingsContainer, fs_access: cwltool.stdfsaccess.StdFsAccess, temp_prefix_ro: str = 'tmp', orcid: str = '', full_name: str = '')[source]
Defines extended Provenance details with Weaver operations and referencing the active server instance.
Initialize the ResearchObject.
- static sha1_uuid(document: prov.model.ProvDocument, identifier: str) str[source]
Generate a prefixed SHA1 hash from the identifier value.
- initialize_provenance(full_name: str, host_provenance: bool, user_provenance: bool, orcid: str, fsaccess: cwltool.stdfsaccess.StdFsAccess, run_uuid: uuid.UUID | None = None) cwltool.cwlprov.provenance_profile.ProvenanceProfile[source]
Hook Weaver metadata onto user provenance step.
- resolve_user() Tuple[str, str][source]
Override
cwltool.cwlprovdefault machine user.It is expected that the CWL runner will executed by the
weaver-worker(i.e.: viacelery). Define a generic user to avoid exposing implementation-specific “OS” user that will not be informative for the generated Provenance. Using a distinct name than just “_Weaver_” allows preserving the distinction between the API _agent_ and the “user” _agent_ for which Job execution is acted on behalf between these _agent_ endoffs.See also