Table of Contents

Asset metadata

Alex Cota Updated by Alex Cota

Asset metadata is additional information (image, video, or text) that you can attach to a data row.

Below are some common operations the GraphQL API supports for Asset metadata.

Note: To see an example of a JSON file with asset information, see Asset information overlay.

Add metadata

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

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.
  • 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