Table of Contents

Attachments

Alex Cota Updated by Alex Cota

Add metadata

To attach more than one image, video, or text string as an attachment, you will need to run the createAssetMetadata  mutation multiple times which will append the subsequent it to the list of existing attachments

To attach metadata to a Data Row, run this mutation:

mutation addAssetInfo {
createAssetMetadata(
data: {
dataRowId:"<DATAROW-ID>",
metaValue:"https://storage.googleapis.com/labelbox-sample-datasets/Videos/shibuya-1230-1530.mp4",
metaType: VIDEO
}
) {
id
}
}

Where:

  • metaValue is REQUIRED and accepts an https:// URL to an external file OR a string of text.
  • metaType is REQUIRED and can be IMAGE, TEXT, VIDEO, or IMAGE_OVERLAY.

Edit asset metadata

First, use this query to get the metadata ID:

query getMetadataId {
dataRow (where: {id: "<DATAROW_ID>"}) {
id
metadata {
id
}
}
}

Then, run this mutation:

mutation updateAssetInfo {
updateAssetMetadata(
where:{
id:"<METADATA-ID>"
},
data:{
metaValue:"https://storage.googleapis.com/labelbox-sample-datasets/nlp/lorem-ipsum.txt",
metaType: TEXT
}
){
id
}
}

Where:

  • metaValue is REQUIRED and accepts an https:// URL to an external file OR a string of text.
  • metaType is REQUIRED and can be IMAGE, TEXT, VIDEO, or IMAGE_OVERLAY.

Remove asset metadata

First, use this query to get the metadata ID:

query getMetadataId {
dataRow (where: {id: "<DATAROW_ID>"}) {
id
metadata {
id
}
}
}

Then, run this mutation:

mutation removeAssetInfo {
deleteAssetMetadata(
where:{
id:"<METADATA-ID>"
}
){
id
}
}

Was this page helpful?

Members

Review queue

Contact