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

Web fails to validate JSON that validates on the CLI #6

Open
sneumann opened this issue Oct 3, 2022 · 1 comment
Open

Web fails to validate JSON that validates on the CLI #6

sneumann opened this issue Oct 3, 2022 · 1 comment

Comments

@sneumann
Copy link

sneumann commented Oct 3, 2022

Describe the bug
I am trying to validate the file https://msbi.ipb-halle.de/~sneumann/molecule6338.json
by entering the URL into Metadata URL of https://bioschemas-validator.herokuapp.com/
but the web application is giving me

File "/validator/web/report.py", line 10, in generate_report_summary
    ##### {fmt.header("Against profile:")}  {result['Profile Name']} {result['Profile Version']}

Same error when pasting the JSON into Raw metadata.

Expected behavior
I would like to see the error report similar to what I get from the CLI (branch web: https://github.com/ElixirTeSS/bioschemas-validator/tree/web)

Additional context
The dct:conformsTo markup in my JSON comes straight from the bioschemas example in the profile.

python src/command.py validate  --target_data=/tmp/molecule6338.json && cat output.txt 
Action: validate
/tmp/molecule6338.json is a file
The target metadata is /tmp/molecule6338.json
['dct:conformsTo']
###########Start Validation#############
Validating against profile MolecularEntity 0.5-RELEASE.json
=======================Validator Message:=================================
The data is valid against this profile
============Properties Marginality Report:============
Marginality: Minimum
    The data has all the required property(ies).
    Implemented required property has no error.
Marginality: Recommended
    The data has all the recommended property(ies).
    Implemented recommended property has no error.
Marginality: Optional
    Optional property that are missing: ['disambiguatingDescription', 'isInvolvedInBiologicalProcess', 'sameAs', 'image', 'potentialUse', 'monoisotopicMolecularWeight', 'hasBioChemEntityPart', 'description', 'bioChemSimilarity', 'isPartOfBioChemEntity', 'associatedDisease', 'chemicalRole', 'taxonomicRange', 'hasRepresentation', 'alternateName', 'isLocatedInSubcellularLocation', 'isEncodedByBioChemEntity', 'bioChemInteraction', 'biologicalRole', 'hasMolecularFunction']
    Implemented optional property has no error.

These properties names are in the metadata but not in the Bioschemas profile:['subjectOf']
###########End Validation#############

@sneumann
Copy link
Author

sneumann commented Oct 4, 2022

Hi, running the latest webapp from branch develop did not fix the issue.
The issue is also present with the "official" example
https://raw.githubusercontent.com/BioSchemas/specifications/master/MolecularEntity/examples/0.5-RELEASE/metabolights-MTBLC11449.json

It works with the MassBank page pointing the validator at https://msbi.ipb-halle.de/MassBank/RecordDisplay?id=MSBNK-MSSJ-MSJ00024&dsn=MSSJ which does not specify a profile in the first place.
Again it does not work when cut&pasting the JSON of that MassBank record (see below) directly into Raw metadata.

Yours, Steffen

{
"identifier": "MSBNK-MSSJ-MSJ00024",
"url": "https://massbank.eu/MassBank/RecordDisplay?id=MSBNK-MSSJ-MSJ00024",
"name": "Tetrahydroalstonine",
"alternateName": "Tetrahydroalstonine",
"inchikey": "GRTOGORTSDXSFK-DLLGKBFGSA-N",
"description": "This MassBank record with Accession MSBNK-MSSJ-MSJ00024 contains the MS2 mass spectrum of Tetrahydroalstonine.",
"molecularFormula": "C21H24N2O3",
"monoisotopicMolecularWeight": "352.17869",
"inChI": "InChI=1S/C21H24N2O3/c1-12-16-10-23-8-7-14-13-5-3-4-6-18(13)22-20(14)19(23)9-15(16)17(11-26-12)21(24)25-2/h3-6,11-12,15-16,19,22H,7-10H2,1-2H3/t12-,15-,16-,19-/m0/s1",
"smiles": "C[C@H]1[C@@H]2CN3CCC4=C([C@@H]3C[C@@H]2C(=CO1)C(=O)OC)NC5=CC=CC=C45",
"@context": "http://schema.org",
"@type": "MolecularEntity"
}

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

1 participant