Custom meta data for media item

Hello all,

my use case is to have documents and all necessary meta data in one place. I upload documents to different media sets and display it in workshop with uploader information. I would like to implement the possibility to add custom tags/metadata for these documents that can be scaled easily.
I found that there are possible to create custom tags/labels directly in pdfs. But suggested python libraries to do it creates new pdf.

So would be possible to edit metadata that exists inside media item without destroying media reference id?
Like here to have additional row in Metadata - use case FoundryTest in place of yellow line

thank you!

Hello @AkvileJ ,
To my understanding media-items are immutable, so you can not update them and keep the same RID.

You can however, store your additional metadata inside of a table that also contains the media reference.
Then you can show the metadata, along the media item in an ontology object.
Here is a code snippet to create a tabular dataset with media references:

from transforms.api import transform, Output
from transforms.mediasets import MediaSetInput

@transform(
    metadata_out=Output("your/output/metadata_dataset"),
    mediaset_in=MediaSetInput("your/media/set/RID")
)
def compute(ctx, mediaset_in, metadata_out):
    media_refs = mediaset_in.list_media_items_by_path_with_media_reference(ctx)
    metadata_out.write_dataframe(media_refs, column_typeclasses={'mediaReference': [{'kind': 'reference', 'name': 'media_reference'}]})

From here you can add additional columns with the metadata you need and back an ontology object with the table.

thanks @ecitaku . I was expecting that. We want to build metadata repository also for documents and it would be easier to maintain if metadata goes together with documents inside media item.

We just need to find the most acceptable solution for engineers to maintain and scale it and users to contribute into collection of metadata and use it.