HED validator help
- Using the validator
- Step 1: Specify the file to be validated
- Step 2: Specify which columns of your file contain HED tags
- Step 3: Select the other options
- Step 4: Click the submit button to process the file
- Step 5: Correct errors in spreadsheet and retry until no more errors
- Notes and examples
Using the validator
The HED Validator is an online-tool designed to make validation of HED tags easy. To start, put your HED tags in either an Excel file or a tab-separated text file. (Example files can be found in the Notes and Examples section.) Once you have a file, you are ready to begin the validation.
Step 1: Specify the file to be validated.
Indicate the name of the file to validate, using the Browse button to navigate in your file system:
Step 2: Specify which columns of your file contain HED tags.
After you have selected a file, HED Validator will try to automatically fill in the remaining information into its form based on the contents of your file. In the following example, the file EmotionEventInformation.xlsx was selected. If a spreadsheet has multiple worksheets, HED Validator selects the first one by default (ImaginedEmotion), but provides a drop down for you to select a different one:
By default, the HED Validator assumes that the first row of the spreadsheet contains the names of the columns and uses these names to guess which columns correspond to special tags such as Event/Category or Event/Label. In the above example, the HED Validator guessed that the second column (entitled Category) holds the Event/Category tag. The Validator was also able to correctly guess the Event/Label and Event/Description columns. The Validator was not able to correctly able to identify LongName with Event/Long name, so we need to put 4 in the empty field next to it so that it gets the proper values for Long Name. In addition, the Validator also missed that column 8 (called Other) also contained HED tags. After correcting we have:
Step 3: Select the other options.
You can validate your file against any valid HED schema. The Validator automatically retrieves the latest HED version and also has copies of each of the previous major HED versions available through the HED version pull-down in the options section. You can also upload one of your own HED versions by selecting the Other option in the pull-down:
HED uses semantic versioning (X.Y.Z) where X denotes a major, backwards-incompatible change, Y denotes a major addition of functionality that is backwards-compatible, and Z denotes a minor backwards-compatible update.
If your spreadsheet does not have column names, you should uncheck the Spreadsheet has column names box. All errors in your HED tag spreadsheet must be corrected, or downstream tools relying on HED might not work properly. However, when you first validate, you might want to ignore warnings until you have corrected all errors. Once you have the errors out, you should probably run again and take a look at the warnings. Warnings often help you detect faulty tagging that might not be syntactically incorrect.
Step 4: Click the submit button to process the file.
On submission, the HED Validator processes the file and outputs a message indicating the number of errors and warnings that it found:
The HED Validator also writes error and warning messages to a text file for download and examination. For the best formatting experience open this text file in a editor such as WordPad or Notepad++. Each message contains the type of error or warning as well as the row and column number in the input file where the issue occurred.
Step 5: Correct errors in spreadsheet and retry until no more errors.
The last step before you can tag your study is correcting any errors that are found in your spreadsheet. Once corrected run the validator again. If the HED validator detected no issues, you will see the following message. You should now be ready to use them to tag your study.
Notes and examples
How to set up your spreadsheet in Excel:
The following screenshot shows part of an Excel spreadsheet containing HED tags to be validated. The first row of the spreadsheet can contain column names. If you choose to have column names, HED uses these to try to guess the meaning of the columns. If HED guesses wrong or you aren’t using column names, you will need to specify the meanings of the columns before validation.
The above example has 8 columns that are named in a typical manner.
Event code: Usually researchers identify types of events by lab or study specific labels, sometimes referred to as event codes. These event codes can be any numbers, letters, or combinations (e.g., 1, A, Jump, leftclick01) and are not validated.
Category: Specifies what type of event this signifies. (e.g., Participant response, Experimental stimulus/Instruction/Rest, Miscellaneous). The Event/Category tag is required for downstream processing. If you designate a column as the Category column, then HED will prepend the string “Event/Category/” to items in this column if these items don’t already start with them.
Label: Provides a short descriptive label for the event type (e.g., Button press, Calibration pulse, or any other meaningful short identifier for this event.) The Event/Label tag is required for downstream processing. If you designate a column as the Label column, then HED will prepend the string “Event/Label/” to items in this column if these items don’t already start with this string. Labels should not contain commas, tildas (~), forward or backward slashes, or parentheses.
Longer label: Provides a concise description of the event that provides more detail than the Label column. HED did not initially associate this column with a particular HED tag as illustrated by the top screenshot in Step 2 above. In the example session, we designated this column as the Long name column. Long names are designed to provide more detail about event types, but are not required by HED in downstream processing. If you designate a column as the Long name column, HED will prepend the string “Event/Long name/” to items in this column if these items don’t already start with this string. Long names should not contain commas, tildas (~), forward or backward slashes, or parentheses.
Description: Elaborates in detail on what this event is. The Event/Description tag is required for downstream processing. If you designate a column as the Description column, then HED will prepend the string “Event/Description/” to items in this column if these items don’t already start with this string. Descriptions should not contain commas, tildas (~), forward or backward slashes, or parentheses.
Tags: Provides descriptions of the event using HED tag strings. You may include as many tag columns in your spreadsheet as you wish. The HED validator will check each of these columns for validity. HED tag strings correspond to valid paths in the HED Schema (www.hedtags.org/schema). Three examples of HED tag strings are: Participant/Effect/Auditory, Sensory presentation/Auditory, and Attribute/Onset. The individual HED tag strings can be combined by separating the individual valid strings by commas. Strings can also be parenthesized as in ((A/B, C/D/E), F), sequenced (A/B~C/D/E), or both ((A/B, C/D)~(E/F/G)).
How to set up your spreadsheet as a tab-separated text file:
In tab-separated text file spreadsheets, each line in the file corresponds to a row and the columns are text fields separated from each other by tabs. If a column field in a particular row is empty, the file should have two tabs in a row. The following example shows how such a tab-separated file might appear when you edit it using a text editor. The columns do not line up visually, but the HED validator uses the tabs and not alignment to determine columns:
The meanings of the columns are the same as for Excel spreadsheets.
For examples of how to tag your study, visit here
For examples of common errors and fixes, visit here