Skip to content

Document how to read validation errors for .jsonld files #366

Description

@surchs

Is there an existing issue for this?

  • I have searched the existing issues

Expected behavior

This happened on the Donders2 (PPP) dataset. There is something wrong with the .jsonld file. I would expect init_data to catch this but to then also produce a helpful error message

Current behavior

I am getting a massive log of each validation error, and they all look like this:

2026-01-20 14:09:53 INFO (2/2) Processing file: Donders2_deriv.filtered.jsonld                                                                                                                                                                                                                                                
2026-01-20 14:09:53 WARNING Donders2_deriv.filtered.jsonld is not a valid Neurobagel dataset JSONLD. Skipping file.                                                                                                                                                                                                           
Validation errors: 8179 validation errors for Dataset                                                                                                                                                                                                                                                                         
hasSamples.0.hasSession.3.PhenotypicSession.schemaKey                                                                                                                                                                                                                                                                         
  Input should be 'PhenotypicSession' [type=literal_error, input_value='ImagingSession', input_type=str]                                                                                                                                                                                                                      
    For further information visit https://errors.pydantic.dev/2.12/v/literal_error                                                                                                                                                                                                                                            
hasSamples.0.hasSession.3.ImagingSession.hasAcquisition.7.hasContrastType                                                                                                                                                                                                                                                     
  Field required [type=missing, input_value={'identifier': 'nb:5d58b7...hemaKey': 'Acquisition'}, input_type=dict]                                                                                                                                                                                                            
    For further information visit https://errors.pydantic.dev/2.12/v/missing                                                                                                                                                                                                                                                  
hasSamples.0.hasSession.3.ImagingSession.hasAcquisition.8.hasContrastType
...

Error message

2026-01-20 14:09:53 INFO Dataset metadata successfully extracted from 1/2 JSONLD file(s); will upload the file(s) to the graph store.
2026-01-20 14:09:53 WARNING The following 1 JSONLD file(s) failed validation and will not be uploaded:
Donders2_deriv.filtered.jsonld

Environment

prod deployment with docker compose

How to reproduce

No response

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    _flag:stale[BOT ONLY] Flag issue that hasn't been updated in a while and needs to be triaged againdocumentationChanges only affect the documentation

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions