biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
4 stars 12 forks source link

Schema editor: validation error generated on a schema I created through the guide #77

Open flaneuse opened 3 years ago

flaneuse commented 3 years ago

I created this schema on the guide schema editor GUI: https://github.com/flaneuse/hCoV19-sitrep/blob/master/mutation_schema.jsonld

When I went to visualize it, it threw a validation error. 🤷‍♀️

Screen Shot 2021-01-22 at 8 22 14 PM
gtsueng commented 3 years ago

One reason for this can be found in https://github.com/biothings/discovery-app/issues/82

Basically, validation is ALWAYS required and cannot just have the description field filled in (as is the case in this example). In other words, the default validation created is NOT good enough--you actually have to drag and drop stuff. Maybe this needs to be made more explicit?

Note that this issue persists with properties that have validations as well. Part of it appears to be an issue of referencing non-schema.org inherited properties. See https://github.com/biothings/discovery-app/issues/101#issuecomment-973269057 for more details

gtsueng commented 2 years ago

Trouble-shooting tests and results can be found here: https://github.com/biothings/discovery-app/issues/101#issuecomment-973269057

gtsueng commented 2 years ago

This issue may be related to https://github.com/biothings/discovery-app/issues/103 and https://github.com/biothings/discovery-app/issues/89. Hopefully addressing this issue will resolve the other two.

gtsueng commented 2 years ago

Example of schema created by DDE that cannot be visualized in DDE: https://github.com/gtsueng/DDE_bioschemas/blob/main/draft_validations/SequenceRange_v0.1-DRAFT.jsonld

newgene commented 2 years ago

@gtsueng for the above jsonld file, you miss a line to define bioschemas in the @context, where it's referenced here:

https://github.com/gtsueng/DDE_bioschemas/blob/main/draft_validations/SequenceRange_v0.1-DRAFT.jsonld#L15

newgene commented 2 years ago

@flaneuse looks like the same issue on https://github.com/flaneuse/hCoV19-sitrep/blob/master/mutation_schema.jsonld as well, missing bioschemas in the @context.

Basically, any prefix used in the jsonld, should be defined first.

flaneuse commented 2 years ago

Right-- so seems like the DDE should save that for us, right?

gtsueng commented 2 years ago

I replaced the namespace bioschemasdraft with bioschemas so the @context has a reference to bioschemas now, but it still gives the same error when I try to load it. https://github.com/gtsueng/DDE_bioschemas/blob/main/draft_validations/SequenceRange_v0.1-DRAFT.json

gtsueng commented 2 years ago

Also, it appears that the urls generated by the DDE use http by default rather than https, but if you try to examine a registered schema via a browser--the http url will redirect to https. It would improve the user experience to:

  1. save the namespace:schemaurl for the parent schema when extending and
  2. have default url generated by the DDE use https so that this minor difference doesn't block the user from viewing a schema they generated.