Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In --json output, include "hed string" and point to multiple rows when applicable to HED error #175

Open
yarikoptic opened this issue Mar 3, 2025 · 2 comments

Comments

@yarikoptic
Copy link
Contributor

I am not sure if

covers this since I find no "hed string" which I observe in txt output downloaded from running HED validation on https://hedtools.org/hed/events

Issues in row 2:
    hed string: (Duration/2.03427314758301, (Label/Entire-event-time)), (Task-stimulus-role/Cue, Action/Perform/Read), Organizational-property/Task/tomspunt,(Duration/0.3, (Label/Entire-event-time)), (Task-stimulus-role/Cue, Action/Perform/Read), Organizational-property/Task/tomspunt
        TAG_EXPRESSION_REPEATED: Repeated tag - "Organizational-property/Task/tomspunt"  Problem spans string indexes: 231, 268
        TAG_EXPRESSION_REPEATED: Repeated group - "(Cue,Read)"

which is due to a bug in _events.tsv which has "duplicate" rows

Image

--json output of bids-validator (2.0.3-4-g63e17217 or somewhere right before since I just reran with --reload) has only

      {
        "code": "HED_ERROR",
        "subCode": "TAG_EXPRESSION_REPEATED",
        "location": "/sub-0001/ses-04/func/sub-0001_ses-04_task-fractional_acq-mb8_run-02_events.tsv",
        "issueMessage": "ERROR: [TAG_EXPRESSION_REPEATED] Duplicate tag - \"(Task-stimulus-role/Cue, Action/Perform/Read)\". TSV line: 2, 3. (For more information on this HED error, see https://hed-specification.readthedocs.io/en/latest/Appendix_B.html#tag-expression-repeated.)",
        "severity": "error"
      },

which makes it hard to impossible to identify the reason for this error. It was the "hed string" which was very informative in this case

@VisLab note that the error is actually due to records from multiple rows, but validator output points to a single row. Ideally -- should be somewhere saying that it was a composition of multiple rows. And then bids-validator should channel that information too to the user.

@hed-maintainers
Copy link

@yarikoptic The online tools use the HED python validator not the JavaScript validator. The Bids validator uses HED javascript validator version 3.5.1 which does not fully validate HED strings.

The release of hed-javascript version 4.0.0 is imminent, and it addresses these issues. In particular issueMessage should include relatively complete information about the source of the error, including the line numbers for duplicate rows. PR #173, which is currently in draft form until 4.0.0 is released, revises the code that matches HED errors to BIDS errors. @happy5214 FYI

@yarikoptic
Copy link
Contributor Author

@yarikoptic The online tools use the HED python validator not the JavaScript validator.

oh, I would be so much a happier person if I could just invoke that validation from the CLI ;)
meanwhile filed

Great to hear #173 should address this one, I guess add Closes #175 to it? ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants