# Datasets

Model objects representing datasets.

## Dataset object

class `renku.core.models.datasets.``Dataset`(*, commit=None, client=None, path=None, project=None, parent=None, checksum=None, creators, id=None, label=None, date_published=None, description=None, identifier=NOTHING, in_language=None, images=None, keywords=None, license=None, title=None, url=None, version=None, date_created=NOTHING, files=NOTHING, tags=NOTHING, same_as=None, name=None, derived_from=None, immutable=False)

  Represent a dataset.

  Method generated by attrs for class Dataset.

  `as_jsonld`()

    Create JSON-LD.

  `contains_any`(files)

    Check if files are already within a dataset.

  property `creators_csv`

    Comma-separated list of creators associated with dataset.

  property `creators_full_csv`

    Comma-separated list of creators with full identity.

  property `data_dir`

    Directory where dataset files are stored.

  `default_id`()

    Configure calculated ID.

  `default_label`()

    Generate a default label.

  property `editable`

    Subset of attributes which user can edit.

  property `entities`

    Yield itself.

  `find_file`(path, return_index=False)

    Find a file in files container using its relative path.

  `find_files`(paths)

    Return all paths that are in files container.

  classmethod `from_jsonld`(data, client=None, commit=None, schema_class=None)

    Create an instance from JSON-LD data.

  classmethod `from_revision`(client, path, revision='HEAD', parent=None, find_previous=True, **kwargs)

    Return dependency from given path and revision.

  classmethod `from_yaml`(path, client=None, commit=None)

    Return an instance from a YAML file.

  property `keywords_csv`

    Comma-separated list of keywords associated with dataset.

  `mutate`()

    Update mutation history and assign a new identifier.

    Do not mutate more than once before committing the metadata or otherwise there would be missing links in the chain of changes.

  `name_validator`(attribute, value)

    Validate name.

  property `original_identifier`

    Return the first identifier of the dataset.

  property `parent`

    Return the parent object.

  `set_client`(client)

    Sets the clients on this entity.

  property `short_id`

    Shorter version of identifier.

  property `submodules`

    Proxy to client submodules.

  property `tags_csv`

    Comma-separated list of tags associated with dataset.

  `to_yaml`(path=None, immutable=False)

    Write an instance to the referenced YAML file.

  `unlink_file`(path, missing_ok=False)

    Unlink a file from dataset.

    Parameters

      path – Relative path used as key inside files container.

  `update_files`(files)

    Update files with collection of DatasetFile objects.

  `update_metadata`(**kwargs)

    Updates instance attributes.

  `update_metadata_from`(other_dataset)

    Updates instance attributes with other dataset attributes.

    Parameters

      other_dataset – Dataset

    Returns

      self

## Dataset file

Manage files in the dataset.

class `renku.core.models.datasets.``DatasetFile`(*, commit=None, client=None, path=None, id=None, label=NOTHING, project=None, parent=None, added=NOTHING, checksum=None, filename=NOTHING, name=None, filesize=None, filetype=None, url=None, based_on=None, external=False, source=None)

  Represent a file in a dataset.

  Method generated by attrs for class DatasetFile.

  `as_jsonld`()

    Create JSON-LD.

  property `commit_sha`

    Return commit hash.

  `default_filename`()

    Generate default filename based on path.

  `default_id`()

    Configure calculated ID.

  `default_label`()

    Generate a default label.

  `default_url`()

    Generate default url based on project’s ID.

  property `entities`

    Yield itself.

  classmethod `from_jsonld`(data)

    Create an instance from JSON-LD data.

  classmethod `from_revision`(client, path, revision='HEAD', parent=None, find_previous=True, **kwargs)

    Return dependency from given path and revision.

  property `full_path`

    Return full path in the current reference frame.

  property `parent`

    Return the parent object.

  `set_client`(client)

    Sets the clients on this entity.

  property `size_in_mb`

    Return file size in megabytes.

  property `submodules`

    Proxy to client submodules.

  `update_commit`(commit)

    Set commit and update associated fields.

  `update_metadata`(path, commit)

    Update files metadata.