weaver.provenance

Definitions related to Provenance features and the W3C PROV specification.

Module Contents

weaver.provenance.AnyProvenanceFormat[source]
class weaver.provenance.ProvenancePathType[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

PROV = '/prov'[source]
PROV_INFO = '/prov/info'[source]
PROV_WHO = '/prov/who'[source]
PROV_INPUTS = '/prov/inputs'[source]
PROV_OUTPUTS = '/prov/outputs'[source]
PROV_RUN = '/prov/run'[source]
PROV_RUNS = '/prov/runs'[source]
classmethod types() List[str][source]
classmethod as_type(prov: Any) str | None[source]
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 ExtendedEnum without explicit Enum membership.

PROV_JSON = 'PROV-JSON'[source]
PROV_JSONLD = 'PROV-JSONLD'[source]
PROV_XML = 'PROV-XML'[source]
PROV_TURTLE = 'PROV-TURTLE'[source]
PROV_N = 'PROV-N'[source]
PROV_NT = 'PROV-NT'[source]
_media_types[source]
_rev_path_types[source]
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][source]
classmethod as_media_type(prov_format: AnyProvenanceFormat | None) weaver.formats.AnyContentType | 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 OutputFormat and ProvenanceFormat combinations 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.

job[source]
ro_uuid[source]
base_uri = 'arcp://uuid,Uninferable/'[source]
settings[source]
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 default machine user.

resolve_host() Tuple[str, str][source]

Override cwltool default machine host.