Datasets

Model objects representing datasets.

Dataset object

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

Repesent a dataset.

Type:

["prov:Entity", "schema:Dataset", "wfprov:Artifact"]

Context:

{
  "affiliation": "schema:affiliation",
  "alternate_name": "schema:alternateName",
  "email": "schema:email",
  "schema": "http://schema.org/",
  "prov": "http://www.w3.org/ns/prov#",
  "wfprov": "http://purl.org/wf4ever/wfprov#",
  "path": "prov:atLocation",
  "_id": "@id",
  "_label": "rdfs:label",
  "_project": "schema:isPartOf",
  "creator": "schema:creator",
  "date_published": "schema:datePublished",
  "description": "schema:description",
  "identifier": "schema:identifier",
  "in_language": "schema:inLanguage",
  "keywords": "schema:keywords",
  "based_on": "schema:isBasedOn",
  "license": "schema:license",
  "name": "schema:name",
  "url": "schema:url",
  "version": "schema:version",
  "created": "schema:dateCreated",
  "files": "schema:hasPart",
  "tags": "schema:subjectOf",
  "same_as": "schema:sameAs"
}
asjsonld()

Create JSON-LD with the original source data.

creators_csv

Comma-separated list of creators associated with dataset.

default_id()

Configure calculated ID.

default_label()

Generate a default label.

default_reference()

Create a default reference path.

display_name

Get dataset display name.

editable

Subset of attributes which user can edit.

entities

Yield itself.

find_file(filename, return_index=False)[source]

Find a file in files container.

classmethod from_jsonld(data, client=None, commit=None, __reference__=None, __source__=None)

Instantiate a JSON-LD class from data.

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

Return dependency from given path and revision.

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

Return an instance from a YAML file.

parent

Return the parent object.

rename_files(rename)[source]

Rename files using the path mapping function.

short_id

Shorter version of identifier.

submodules

Proxy to client submodules.

to_yaml()

Store an instance to the referenced YAML file.

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=NOTHING, label=NOTHING, project=None, parent=None, creator=NOTHING, added=NOTHING, checksum=None, dataset=None, filename=NOTHING, name=None, filesize=None, filetype=None, url=None, based_on=None)[source]

Represent a file in a dataset.

Type:

["prov:Entity", "schema:DigitalDocument", "wfprov:Artifact"]

Context:

{
  "schema": "http://schema.org/",
  "prov": "http://www.w3.org/ns/prov#",
  "wfprov": "http://purl.org/wf4ever/wfprov#",
  "path": "prov:atLocation",
  "_id": "@id",
  "_label": "rdfs:label",
  "_project": "schema:isPartOf",
  "creator": "schema:creator",
  "added": "schema:dateCreated",
  "dataset": "schema:isPartOf",
  "name": "schema:name",
  "url": "schema:url",
  "based_on": "schema:isBasedOn"
}
asjsonld()

Create JSON-LD with the original source data.

creators_csv

Comma-separated list of creators associated with dataset.

default_filename()[source]

Generate default filename based on path.

default_id()

Configure calculated ID.

default_label()

Generate a default label.

default_reference()

Create a default reference path.

entities

Yield itself.

classmethod from_jsonld(data, client=None, commit=None, __reference__=None, __source__=None)

Instantiate a JSON-LD class from data.

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

Return dependency from given path and revision.

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

Return an instance from a YAML file.

full_path

Return full path in the current reference frame.

parent

Return the parent object.

size_in_mb

Return file size in megabytes.

submodules

Proxy to client submodules.

to_yaml()

Store an instance to the referenced YAML file.

Creator

class renku.core.models.datasets.Creator(*, client=None, affiliation=None, email=None, alternate_name=None, name=None, id=NOTHING)[source]

Represent the creator of a resource.

Type:

"schema:Person"

Context:

{
  "schema": "http://schema.org/",
  "affiliation": "schema:affiliation",
  "email": "schema:email",
  "alternate_name": "schema:alternateName",
  "name": "schema:name",
  "_id": "@id"
}
asjsonld()

Create JSON-LD with the original source data.

check_email(attribute, value)[source]

Check that the email is valid.

default_id()[source]

Set the default id.

default_reference()

Create a default reference path.

classmethod from_commit(commit)[source]

Create an instance from a Git commit.

classmethod from_git(git)[source]

Create an instance from a Git repo.

classmethod from_jsonld(data, client=None, commit=None, __reference__=None, __source__=None)

Instantiate a JSON-LD class from data.

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

Return an instance from a YAML file.

short_name

Gives full name in short form.

to_yaml()

Store an instance to the referenced YAML file.