Datasets

Models representing datasets.

Dataset object

class renku.core.models.dataset.Dataset(*args, **kwargs)[source]

Represent a dataset.

add_or_update_files(files)[source]

Add new files or update existing files.

clear_files()[source]

Remove all files.

copy()[source]

Return a clone of this dataset.

property creators_csv

Comma-separated list of creators associated with dataset.

property creators_full_csv

Comma-separated list of creators with full identity.

derive_from(dataset, creator, identifier=None)[source]

Make self a derivative of dataset and update related fields.

property files

Return list of existing files.

find_file(path)[source]

Find a file in the dataset using its relative path.

freeze()

Set immutable property.

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

Create an instance from JSON-LD data.

static generate_id(identifier)[source]

Generate an identifier for Dataset.

property immutable

Return if object is immutable.

is_removed()[source]

Return true if dataset is removed.

property keywords_csv

Comma-separated list of keywords associated with dataset.

reassign_oid()

Reassign oid (after assigning a new identifier for example).

remove(date=None)[source]

Mark the dataset as removed.

replace_identifier(identifier=None)[source]

Replace dataset’s identifier and update relevant fields.

NOTE: Call this only for newly-created/-imported datasets that don’t have a mutability chain because it sets initial_identifier.

to_jsonld()[source]

Create JSON-LD.

Mark a file as removed using its relative path.

update_files_from(current_dataset, date=None)[source]

Check current_files to reuse existing entries and mark removed files.

update_metadata(**kwargs)[source]

Updates metadata.

update_metadata_from(other, exclude=None)[source]

Update metadata from another dataset.

Dataset file

Manage files in the dataset.

class renku.core.models.dataset.DatasetFile(*, based_on=None, date_added=None, date_removed=None, entity=None, id=None, is_external=False, source=None)[source]

A file in a dataset.

copy()[source]

Return a clone of this object.

classmethod from_dataset_file(other)[source]

Return a copy with a different id.

classmethod from_path(client, path, source=None, based_on=None)[source]

Return an instance from a path.

static generate_id()[source]

Generate an identifier for DatasetFile.

NOTE: ID should not rely on Entity properties because the same Entity can be added and removed multiple times. So, it should be marked by different DatasetFiles.

is_equal_to(other)[source]

Compare content.

NOTE: id is generated randomly and should not be included in this comparison.

is_removed()[source]

Return true if dataset is removed and should not be accessed.

classmethod make_instance(**kwargs)

Instantiate from the given parameters.

remove(date=None)[source]

Create a new instance and mark it as removed.

to_jsonld()[source]

Create JSON-LD.