Adding File Tags

Tags help users filter and find files within a given dataset when someone uses the search this dataset box.

Tags help with discovery. Use file tags with a file folder structure or as an alternative method for browsing large files lists within a dataset. For example, if you tagged a subset of image or video files with the term ‘color corrected’ a user could use that search term in the files search box to limit just those data files that were limited. Provide instructions either in the readme file or in the dataset description letting users know how to use the search box with tags.

Add file tags during upload using the user interface

  1. Login to your account and go to the dataset you are adding files

  2. While uploading your file select the three-dot drop-down and choose ‘Tags.' under Edit Options.

    Screenshot of Dataverse file upload box with Edit Options selected
    The edit options are on the right side of the file upload box.
  3. Use the Edit Tags box.
    Use the Custom File Tag for new tags and fill in the term in the “Add new file tag” field. Enter tags into the box one at a time and select Apply each time

    Screenshot of Dataverse Edit Tags editor
    Basic Edit Tags box
  4. You can select one or more previously used tags your dataset has from the File Tags dropdown menu. Selected tags will display above the dropdown as you add them.

  5. Select Save Changes, or to abandon your work, select Cancel.

  6. Continue adding files and editing your dataset until you are ready to submit the dataset for review and publication.

Add file tags after upload using the user interface

  1. Login to your account and go to the dataset you want to edit.

  2. In the dataset File Tab, select one or more file checkboxes.

  3. Select Tags from the drop-down.

  4. Fill in a new tag or select from a list of previously used tags. You can also delete any tags not currently used to clean up your choices.

  5. Select Save Changes, or to abandon your work, select Cancel.

  6. Submit the dataset for review and publication.

You need to note if this is a minor, major, or no version change to the dataset when you submit for review for previously published datasets.

Add file tags after ingesting using the Dataverse API

To add file tags to files using the API, you need an API token. To create an API token for your account:

  • Login to the Dataverse UI

  • Click on your name in the upper right-hand corner

  • Click API Token

  • Click the button to generate an API token

     

  • Copy the token for use in pasting into your API code

To add a tag using your API token to a particular file in the dataset:

  • In the UI, hover over the file that you want to add a tag to

  • Find the file URL, which includes the file ID (after “?filedId=”)

     

  • Make a note of the file ID number.

  • Use the following format to send an API call to the dataverse server:

    curl -H "X-Dataverse-key:$API_TOKEN" -X POST
    -F 'jsonData={"categories":["Data"]'
    $SERVER_URL/api/files/$ID/metadata

  • where API_TOKEN is your API key, and Data is the tag(s) that you want to add (your key must have permissions to add tags to the dataset/file

Back to Edit Dataset Metadata