Datasets

Model objects representing datasets.

Dataset object

class renku.core.models.datasets.Dataset(*, commit=None, client=None, path=None, project: renku.core.models.projects.Project = None, parent=None, creators, id=None, label=None, date_published=None, description=None, identifier=NOTHING, in_language=None, keywords=None, license=None, title: str = None, url=None, version=None, date_created=NOTHING, files=NOTHING, tags=NOTHING, same_as=None, name=None)[source]

Represent a dataset.

Method generated by attrs for class Dataset.

as_jsonld()[source]

Create JSON-LD.

contains_any(files)[source]

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.

default_reference()

Create a default reference path.

property editable

Subset of attributes which user can edit.

property entities

Yield itself.

find_file(filename, return_index=False)[source]

Find a file in files container.

find_files(paths)[source]

Return all paths that are in files container.

classmethod from_jsonld(data, client=None, commit=None, schema_class=None)[source]

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)[source]

Return an instance from a YAML file.

property keywords_csv

Comma-separated list of keywords associated with dataset.

name_validator(attribute, value)[source]

Validate name.

property parent

Return the parent object.

rename_files(rename)[source]

Rename files using the path mapping function.

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()[source]

Write an instance to the referenced YAML file.

property uid

UUID part of identifier.

Unlink a file from dataset.

Parameters

file_path – Relative path used as key inside files container.

update_files(files)[source]

Update files with collection of DatasetFile objects.

update_metadata(other_dataset)[source]

Updates instance attributes with other dataset attributes.

Parameters

other_datasetDataset

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: renku.core.models.projects.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)[source]

Represent a file in a dataset.

Method generated by attrs for class DatasetFile.

as_jsonld()[source]

Create JSON-LD.

default_filename()[source]

Generate default filename based on path.

default_id()

Configure calculated ID.

default_label()

Generate a default label.

default_url()[source]

Generate default url based on project’s ID.

property entities

Yield itself.

classmethod from_jsonld(data)[source]

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.