weaver.provenance ================= .. py:module:: weaver.provenance .. autoapi-nested-parse:: Definitions related to :term:`Provenance` features and the :term:`W3C` ``PROV`` specification. Module Contents --------------- .. py:data:: AnyProvenanceFormat .. py:class:: ProvenancePathType Constants container that provides similar functionalities to :class:`ExtendedEnum` without explicit Enum membership. .. py:attribute:: PROV :value: '/prov' .. py:attribute:: PROV_INFO :value: '/prov/info' .. py:attribute:: PROV_WHO :value: '/prov/who' .. py:attribute:: PROV_INPUTS :value: '/prov/inputs' .. py:attribute:: PROV_OUTPUTS :value: '/prov/outputs' .. py:attribute:: PROV_RUN :value: '/prov/run' .. py:attribute:: PROV_RUNS :value: '/prov/runs' .. py:method:: types() -> List[str] :classmethod: .. py:method:: as_type(prov: Any) -> Optional[str] :classmethod: .. py:method:: get(prov: Union[weaver.typedefs.AnyKey, weaver.base.EnumType, ProvenancePathType], default: Optional[Any] = None, run_id: Optional[str] = None) -> Optional[ProvenancePathType] :classmethod: .. py:class:: ProvenanceFormat Constants container that provides similar functionalities to :class:`ExtendedEnum` without explicit Enum membership. .. py:attribute:: PROV_JSON :value: 'PROV-JSON' .. py:attribute:: PROV_JSONLD :value: 'PROV-JSONLD' .. py:attribute:: PROV_XML :value: 'PROV-XML' .. py:attribute:: PROV_TURTLE :value: 'PROV-TURTLE' .. py:attribute:: PROV_N :value: 'PROV-N' .. py:attribute:: PROV_NT :value: 'PROV-NT' .. py:attribute:: _media_types .. py:attribute:: _rev_path_types .. py:method:: get(prov_format: Optional[AnyProvenanceFormat], default: Optional[Any] = None, allow_media_type: bool = False) -> Optional[ProvenanceFormat] :classmethod: .. py:method:: media_types() -> List[weaver.formats.ContentType] :classmethod: .. py:method:: formats() -> List[ProvenanceFormat] :classmethod: .. py:method:: as_media_type(prov_format: Optional[AnyProvenanceFormat]) -> Optional[weaver.formats.AnyContentType] :classmethod: .. py:method:: resolve_compatible_formats(prov: Optional[Union[ProvenancePathType, str]], prov_format: Optional[Union[ProvenanceFormat, str]], output_format: Optional[Union[weaver.formats.OutputFormat, str]]) -> Tuple[Optional[ProvenanceFormat], Optional[str]] :classmethod: Resolves multiple :class:`OutputFormat` and :class:`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 :term:`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. .. py:class:: WeaverResearchObject(job: weaver.datatype.Job, settings: weaver.typedefs.AnySettingsContainer, fs_access: cwltool.stdfsaccess.StdFsAccess, temp_prefix_ro: str = 'tmp', orcid: str = '', full_name: str = '') Defines extended :term:`Provenance` details with `Weaver` operations and referencing the active server instance. Initialize the ResearchObject. .. py:attribute:: job .. py:attribute:: ro_uuid .. py:attribute:: base_uri :value: 'arcp://uuid,Uninferable/' .. py:attribute:: settings .. py:method:: sha1_uuid(document: prov.model.ProvDocument, identifier: str) -> str :staticmethod: Generate a prefixed SHA1 hash from the identifier value. .. py:method:: initialize_provenance(full_name: str, host_provenance: bool, user_provenance: bool, orcid: str, fsaccess: cwltool.stdfsaccess.StdFsAccess, run_uuid: Optional[uuid.UUID] = None) -> cwltool.cwlprov.provenance_profile.ProvenanceProfile Hook `Weaver` metadata onto user provenance step. .. py:method:: resolve_user() -> Tuple[str, str] Override :mod:`cwltool` default machine user. .. py:method:: resolve_host() -> Tuple[str, str] Override :mod:`cwltool` default machine host.