Skip to main content

datasets

Creates, updates, deletes, gets or lists a datasets resource.

Overview

Namedatasets
TypeResource
Idgoogle.datalabeling.datasets

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Dataset resource name, format is: projects/{project_id}/datasets/{dataset_id}
blockingResourcesarrayOutput only. The names of any related resources that are blocking changes to the dataset.
createTimestring (google-datetime)Output only. Time the dataset is created.
dataItemCountstring (int64)Output only. The number of data items in the dataset.
descriptionstringOptional. User-provided description of the annotation specification set. The description can be up to 10000 characters long.
displayNamestringRequired. The display name of the dataset. Maximum of 64 characters.
inputConfigsarrayOutput only. This is populated with the original input configs where ImportData is called. It is available only after the clients import data to this dataset.
lastMigrateTimestring (google-datetime)Last time that the Dataset is migrated to AI Platform V2. If any of the AnnotatedDataset is migrated, the last_migration_time in Dataset is also updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_datasets_getselectprojectsId, datasetsIdGets dataset by resource name.
projects_datasets_listselectprojectsIdfilter, pageSize, pageTokenLists datasets under a project. Pagination is supported.
projects_datasets_createinsertprojectsId Creates dataset. If success return a Dataset resource.
projects_datasets_deletedeleteprojectsId, datasetsIdDeletes a dataset by resource name.
projects_datasets_import_dataexecprojectsId, datasetsIdImports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.
projects_datasets_export_dataexecprojectsId, datasetsIdExports data and annotations from dataset.
projects_datasets_image_labelexecprojectsId, datasetsId Starts a labeling task for image. The type of image labeling task is configured by feature in the request.
projects_datasets_video_labelexecprojectsId, datasetsIdStarts a labeling task for video. The type of video labeling task is configured by feature in the request.
projects_datasets_text_labelexecprojectsId, datasetsIdStarts a labeling task for text. The type of text labeling task is configured by feature in the request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
datasetsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets dataset by resource name.

SELECT
name,
blockingResources,
createTime,
dataItemCount,
description,
displayName,
inputConfigs,
lastMigrateTime
FROM google.datalabeling.datasets
WHERE projectsId = '{{ projectsId }}' -- required
AND datasetsId = '{{ datasetsId }}' -- required;

INSERT examples

Creates dataset. If success return a Dataset resource.

INSERT INTO google.datalabeling.datasets (
data__dataset,
projectsId
)
SELECT
'{{ dataset }}',
'{{ projectsId }}'
RETURNING
name,
blockingResources,
createTime,
dataItemCount,
description,
displayName,
inputConfigs,
lastMigrateTime
;

DELETE examples

Deletes a dataset by resource name.

DELETE FROM google.datalabeling.datasets
WHERE projectsId = '{{ projectsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required;

Lifecycle Methods

Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.

EXEC google.datalabeling.datasets.projects_datasets_import_data 
@projectsId='{{ projectsId }}' --required,
@datasetsId='{{ datasetsId }}' --required
@@json=
'{
"inputConfig": "{{ inputConfig }}",
"userEmailAddress": "{{ userEmailAddress }}"
}';