Collections
Collection
A collection is an unordered set of datasets based on common factors belonging to the datasets.
These could be certain subproject within a research scope, a certain publication, or a conference for example.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope_uid
|
UID
|
UID of the scope in which to create the collection. |
required |
name
|
NonEmptyString256
|
Name of the collection. |
required |
uid
|
Optional[UID]
|
Optionally, UID of the collection. Defaults to the collection name. |
None
|
create
Create the local collection in QDL.
Raises:
| Type | Description |
|---|---|
QdlSdkException
|
HTTP error code with description. |
description
property
writable
Description of the collection.
exists
classmethod
Check if the collection with the given scope UID and UID exists in QDL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope_uid
|
UID
|
Scope UID of the collection. |
required |
uid
|
UID
|
UID of the collection. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True when the collection exists, otherwise False. |
Raises:
| Type | Description |
|---|---|
QdlSdkException
|
HTTP error code with description. |
get
classmethod
Get the collection with the given scope UID and UID from QDL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope_uid
|
UID
|
Scope UID of the collection. |
required |
uid
|
UID
|
UID of the collection. |
required |
Returns:
| Type | Description |
|---|---|
Collection
|
Collection instance from QDL. |
Raises:
| Type | Description |
|---|---|
QdlSdkException
|
HTTP error code with description. |
list
classmethod
Get the collection(s) with the given scope UID from QDL.
Optionally, add additional filters as keyword arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope_uid
|
UID
|
Scope UID of the collection(s). |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
uid |
str
|
UID of the collection. |
name |
str
|
Name of the collection(s). |
uuid |
str
|
UUID of the collection. |
dataset_uid |
str
|
UID of a dataset which is part of the collection(s). |
Returns:
| Type | Description |
|---|---|
List[Collection]
|
List with the (filtered) collection instance(s) from QDL. Returns an empty list when no matches are found. |
Raises:
| Type | Description |
|---|---|
QdlSdkException
|
HTTP error code with description. |
name
property
writable
Name of the collection.
scope
property
writable
Scope UID of the collection.
uid
property
writable
UID of the collection.
update
Update the collection in QDL with the changes from the local collection.
Raises:
| Type | Description |
|---|---|
QdlSdkException
|
HTTP error code with description. |
Notes
- An error is raised when the collection does not yet exist in QDL.
- The scope UID, UID, and UUID of the collection cannot be updated.
uuid
property
writable
UUID of the collection.