Recipe JSON Format
  • 30 Apr 2025
  • Dark
    Light
  • PDF

Recipe JSON Format

  • Dark
    Light
  • PDF

Article summary

You can import and export labels and attributes in the recipe using JSON format. It allows:

  • Saving a backup of your recipe
  • Uploading to new datasets and projects
  • Preparing it outside the Dataloop platform
  • Automating its import.

Recipe JSON Format

{
  "id": "62dcd88a746376c0d3aa4828",  // Unique identifier for the annotation recipe
  "creator": "user@dataloop.ai",     // The user who created the recipe
  "title": "example-ontology",       // Title or name of the ontology/recipe
  "roots": [                         // Array of top-level labels (ontology hierarchy)
    {
      "value": {
        "tag": "Label-1",            // Internal tag name for the label
        "displayLabel": "Label-1",   // Display name (shown in UI)
        "color": "#ff0000",          // Label color in HEX format
        "attributes": [],            // Optional attributes associated with this label
        "displayData": {}            // Reserved for any display-related metadata
      },
      "children": [                  // Sub-labels under "Label-1"
        {
          "value": {
            "tag": "sub1",
            "displayLabel": "sub1",
            "color": "#f0809a",
            "attributes": [],
            "displayData": {}
          },
          "children": []             // No further children (leaf node)
        },
        {
          "value": {
            "tag": "sub2",
            "displayLabel": "sub2",
            "color": "#154676",
            "attributes": [],
            "displayData": {}
          },
          "children": []             // No further children (leaf node)
        }
      ]
    },
    {
      "value": {
        "tag": "Label-2",
        "displayLabel": "Label-2",
        "color": "#00ff4a",
        "attributes": [],
        "displayData": {}
      },
      "children": []                 // No children for "Label-2"
    }
  ],
  "metadata": {
    "system": {
      "projectIds": [
        "f2278c37-b967-4326-af7c-b8245264e826"  // Project ID(s) associated with this ontology
      ],
      "system": false                          // Indicates whether this is a system-generated ontology
    },
    "attributes": [                            // List of global attributes for the ontology
      {
        "key": "1",                             // Unique key for the attribute
        "type": "options",                      // Type of attribute (e.g., dropdown options)
        "scope": ["*"],                         // Scope of applicability (e.g., all labels)
        "values": ["Att1a", "Att1b", "Att1c"],  // Allowed values for this attribute
        "scriptData": {
          "scope": "@ontology.sections.1.scope",  // Reference for scripting scope
          "title": "Attribute-1",                 // Display title
          "key": "1",
          "optional": true,                       // Attribute is optional
          "multi": true                           // Allows multiple values
        }
      },
      {
        "key": "2",
        "type": "options",
        "scope": ["*"],
        "values": ["Att2a", "Att2b", "Att2c"],
        "scriptData": {
          "scope": "@ontology.sections.2.scope",
          "title": "Attribute-2",
          "key": "2",
          "optional": true,
          "multi": false                          // Single value only
        }
      }
    ]
  },
  "attributes": null                             // Placeholder for any additional recipe-level attributes (not defined here)
}


What's Next