google / schemarama

Schemarama is a project exploring standards-based validation for structured data, especially Schema.org.
Apache License 2.0
124 stars 22 forks source link

Added shapes viewer to the demo #46

Closed Gnomus042 closed 1 year ago

Gnomus042 commented 1 year ago

Some changes for one of the tasks in #44 - exposing shex schemas used for validation in ShExJ format. Shapes are taken from shex.js internal representation in ShExJ, ids are extracted and shown in the list, as well as shape content when one of the shapes is selected. Here is the overview of how it would look:

image

It will be a little harder to display SHACL shapes, as to reconstruct them we need to parse the triples graph or rely on file serialization and format to fetch shapes and corresponding names, which would be unreliable. Alternatively, we can fetch used shapes from the server, for that we can put existing shapes to the DB instead of storing them in the filesystem. This will also allow exposing ShEx shapes in ShExC, which would be more readable.

Please let me know which option sounds better.

danbri commented 1 year ago

Fantastic—- thanks!

we have some fixes to merge in from ericP-changes. I suggest we do that first then merge in this PR.

danbri commented 1 year ago

@Gnomus042 does the updated package-lock.json work with this code?

danbri commented 1 year ago

Regarding your question I think it will be best if we can try to make it work with a simple static server as a shared base. In some contexts it makes sense to do things on server but for a default let’s try to have it work everywhere.