Skip to content

Download data: Tree structure

The tree structure is the most versatile format and contains all available data. It's a hierarchical key/value format, where each value can be a key/value map itself.

When to use tree structure

Tree structure is ideal when you need:

  • Complete data access — All variables, metadata, and nested structures
  • Full experiment exports — Download entire experiments with all tasks and participants
  • Programmatic analysis — Process data in Python, R, or other languages

For simpler tabular data, consider Table or Annotations structures.

Compatible file types

Tree structure data is currently only available in the JSON file type.

Structure

If the file covers multiple participations (i.e. participant "sessions"), the root of the structure is a key/value map of participant nicknames and their data.

If the file covers a whole experiment, each participation will be an array, in the order in which the participant completed the tasks:

  • token — The token that the participant used to access the experiment, if tokens were used.
  • tasks — A key/value map with keys corresponding to the task names in the experiment.

The participation object for a task then has a number of fields, depending on the task type. These are the most important fields:

All Tasks

  • screen — A key/value map with properties of the participant's browser and screen.
  • stimuli — An array with key/value maps for each of the stimuli for this task.

Multiple Arrangement

  • rdm — An array containing the upper triangular vector of pairwise dissimilarities.
  • next_trial_stimuli — An array with the IDs of the stimuli that would be presented to the participant next.
  • trials — An array with a key/value map for each of the trials that the participant finished:
    • start — Timestamp or epoch time of the start of the trial, in seconds since 1/1/1970.
    • end — Timestamp epoch time of the end of the trial, in seconds since 1/1/1970.
    • positions — An array with a key/value map for each of the stimuli:
      • x — X coordinate of the stimulus.
      • y — Y coordinate of the stimulus.
      • id — The ID of the stimulus, corresponding to the ID field in the stimulus list.

Drag & Rate

  • positions — An array with a key/value map for each of the stimuli:
    • x — Where the stimulus was placed on the x (confidence) scale: a value between 0 (left) and 1 (right).
    • y — Where the stimulus was placed on the y (property) scale: a value between 0 (bottom) and 1 (top).
    • id — The (file) name of the stimulus.

Category Induction

  • positions — An array with a key/value map for each of the stimuli:
    • category — The name of the circle in which this stimulus was placed.

Dynamic Form

  • form_data — A key/value map with the fields in the form. Contents are dependent on the fields chosen as parameters for this task.

Loading tree data

import json
from pprint import pprint

# Load the JSON file
with open('Meadows_myStudy_tree.json') as f:
    data = json.load(f)

# Display available participants
print("Participants:", list(data.keys()))

# Access a specific participant's data
participant = list(data.keys())[0]
participant_data = data[participant]

# Access tasks
tasks = participant_data.get('tasks', {})
print("Tasks:", list(tasks.keys()))

# Access positions from a drag-rate task
task_name = list(tasks.keys())[0]
positions = tasks[task_name].get('positions', [])
for pos in positions[:3]:  # Show first 3
    print(f"Stimulus {pos['id']}: x={pos['x']:.3f}, y={pos['y']:.3f}")
library(jsonlite)

# Load the JSON file
data <- fromJSON('Meadows_myStudy_tree.json')

# Display available participants
names(data)

# Access a specific participant's data
participant <- names(data)[1]
participant_data <- data[[participant]]

# Access tasks
tasks <- participant_data$tasks
names(tasks)

Example

The tree structure displayed in an IPython terminal. This experiment has two participants (..b63a35, ..b63a38) and two Drag & Rate tasks (task1, task2):

In [11]: pprint.pprint(data)
{'598cfee1c5bc232300b63a35': {
    'token': 'X8K0S2',
    'tasks': {
            'task1': {
               'positions': [{'id': 'natural_inanimate_20190000.png',
                              'x': 0.12326985540315721,
                              'y': 0.8754272579076752},
                             {'id': 'nonhuman_face_67390000.png',
                              'x': 0.10482832246726499,
                              'y': 0.4859726132997698},
               'screenHeight': 1080,
               'screenWidth': 1920,
               'viewportHeight': 857.7000122070312,
               'viewportWidth': 1863},
            'task2': {
               'positions': [{'id': 'nonhuman_bodypart_41110000.png',
                              'x': 0.1659706510265057,
                              'y': 0.08759631740505713},
                             {'id': 'natural_inanimate_20190000.png',
                              'x': 0.14952042696572076,
                              'y': 0.8686817323045877},
               'screenHeight': 1080,
               'screenWidth': 1920,
               'viewportHeight': 857.7000122070312,
               'viewportWidth': 1863}},
     }
 '598cff09c5bc232300b63a38': {
    'token': 'Y7C4B2',
    'tasks': {
        'task1': {
               'positions': [{'id': 'human_face_66470000.png',
                              'x': 0.08242786820648984,
                              'y': 0.9452576845816635},
                             {'id': 'natural_inanimate_20190000.png',
                              'x': 0.8167240092884535,
                              'y': 0.9319304630922399},
# etc