# cwltool.cwlprov.ro

Stores class definition of ResearchObject and WritableBagFile.

## Classes

`ResearchObject` | CWLProv Research Object.

## Module Contents

class cwltool.cwlprov.ro.ResearchObject(fsaccess, temp_prefix_ro='tmp', orcid='', full_name='')

  CWLProv Research Object.

  Parameters:

    - fsaccess (cwltool.stdfsaccess.StdFsAccess)

    - temp_prefix_ro (str)

    - orcid (str)

    - full_name (str)

  temp_prefix = 'tmp'
  orcid = ''
  full_name = ''
  folder = b'.'
  closed = False
  bagged_size: dict[str, int]
  tagfiles: set[str]
  annotations: list[cwltool.cwlprov.Annotation] = []
  fsaccess
  engine_uuid = 'urn:uuid:Instance of uuid.UUID'
  ro_uuid
  base_uri = 'arcp://uuid,Instance of uuid.UUID/'
  cwltool_version
  has_manifest = False
  relativised_input_object: cwl_utils.types.CWLObjectType
  initialize_provenance(full_name, host_provenance, user_provenance, orcid, fsaccess, run_uuid=None)

    Provide a provenance profile initialization hook function.

    Allows overriding the default strategy to define the provenance profile concepts and associations to extend details as needed.

    Parameters:

      - full_name (str)

      - host_provenance (bool)

      - user_provenance (bool)

      - orcid (str)

      - fsaccess (cwltool.stdfsaccess.StdFsAccess)

      - run_uuid (uuid.UUID | None)

    Return type:

      cwltool.cwlprov.provenance_profile.ProvenanceProfile

  self_check()

    Raise ValueError if this RO is closed.

    Return type:

      None

  __str__()

    Represent this RO as a string.

    Return type:

      str

  resolve_user()

    Provide a user provenance hook function.

    Allows overriding the default strategy to retrieve user provenance in case the calling code can provide a better resolution. The function must return a tuple of the (username, fullname) that identifies the user. This user will be applied on top to any provided ORCID or fullname by agent association.

    Return type:

      tuple[str, str]

  user_provenance(document)

    Add the user provenance.

    Parameters:

      document (prov.model.ProvDocument)

    Return type:

      None

  resolve_host()

    Provide a host provenance hook function.

    Allows overriding the default strategy to retrieve host provenance in case the calling code can provide a better resolution. The function must return a tuple of the (fqdn, uri) that identifies the host.

    Return type:

      tuple[str, str]

  host_provenance(document)

    Record host provenance.

    Parameters:

      document (prov.model.ProvDocument)

    Return type:

      None

  add_tagfile(path, timestamp=None)

    Add tag files to our research object.

    Parameters:

      - path (str)

      - timestamp (datetime.datetime | None)

    Return type:

      None

  add_uri(uri, timestamp=None)

    Add the given URI to this RO.

    Parameters:

      - uri (str)

      - timestamp (datetime.datetime | None)

    Return type:

      cwltool.cwlprov.Aggregate

  add_annotation(about, content, motivated_by='oa:describing')

    Cheap URI relativize for current directory and /.

    Parameters:

      - about (str)

      - content (list[str])

      - motivated_by (str)

    Return type:

      str

  generate_snapshot(prov_dep)

    Copy all of the CWL files to the snapshot/ directory.

    Parameters:

      prov_dep (cwl_utils.types.CWLFileType | cwl_utils.types.CWLDirectoryType)

    Return type:

      None

  has_data_file(sha1hash)

    Confirm the presence of the given file in the RO.

    Parameters:

      sha1hash (str)

    Return type:

      bool

  add_data_file(from_fp, timestamp=None, content_type=None)

    Copy inputs to data/ folder.

    Parameters:

      - from_fp (IO[Any])

      - timestamp (datetime.datetime | None)

      - content_type (str | None)

    Return type:

      str

  add_to_manifest(rel_path, checksums)

    Add files to the research object manifest.

    Parameters:

      - rel_path (str)

      - checksums (dict[str, str])

    Return type:

      None