hed-standard / hed-specification

Specification documents for HED (Hierarchical Event Descriptors)
https://hed-specification.readthedocs.io/en/latest/index.html
Creative Commons Attribution 4.0 International
8 stars 11 forks source link

Validation error with the definition tag #631

Open Prarthita11 opened 1 day ago

Prarthita11 commented 1 day ago

Description: I'm trying to use the Definition tag provided by the HED schema, following an example from the following publication:

Robbins, K., Truong, D., Appelhoff, S., Delorme, A. and Makeig, S., 2021. Capturing the nature of events and event context using hierarchical event descriptors (HED). NeuroImage, 245, p.118766.

Link to the publication: https://www.sciencedirect.com/science/article/pii/S1053811921010387#tbl0007

The example HED tag I'm working with is: (Definition/Face-image, (Visual-presentation,(Foreground-view, ((Image, Face, Hair), Color/Grayscale), ((White, Cross),(Center-of, Computer-screen))), (Background-view, Black)))

Steps to Reproduce:

  1. Go to the HED string validator tool at (https://hedtools.org/hed/strings)
  2. Input the example HED string provided above.
  3. Click on "Process"

Expected Behavior: The HED string should validate successfully without errors.

Actual Behavior: The following error is returned: "Errors for HED string 0: DEFINITION_INVALID: Tag 'Definition/Face-image' is found in a location it is not allowed to be."

image

Additional Information: It seems like the Definition tag is not being accepted in its current location within the string structure. Any insights or guidance on structuring this tag correctly would be appreciated

@sappelhoff

VisLab commented 1 day ago

Definitions can only appear in sidecars or in externally provided dictionaries. That is why there is an optional sidecar.

Suppose you have the following sidecar called mysidecar.json:

{
  "defs": {
    "HED": {
      "def1": "(Definition/Famous-face-cond, (Condition-variable/Face-type,(Image,(Face,Famous))))"
    }
  }
}

then you would use the online string validator as follows:

useOfDefinitionsInHED

We recommend that you validate the sidecar first.