SolidLabResearch / generic-data-viewer-react-admin

MIT License
0 stars 1 forks source link

Custom query feature (cosmetic): augment SPARQL edit fields with syntax coloring and validation #143

Open mvanbrab opened 4 months ago

mvanbrab commented 4 months ago

See YASGUI

EmilioTR commented 1 month ago

I started resolving this issue but I had no time to finish it anymore. Hereby I will give a little summary of what happened already and what still should.

All the changes are on the branch: fix-143-sparql-highlight

I implemented Yasqe (this is a component of YASGUI, see link above). I tried multiple options like codemirror and this turned out to be the best. It does use codemirror but has a better implementation for this use case.

I made a jsx component called yasqe.jsx under components/CustomQueryEditor/yasqe.jsx. This is just the inputfield that looks like this: image

This should replace the <TextField>-component for every field where you have to fill in a SPARQL query in the current form. Those are the 'sparql query' field inside basic information, the 'sparql query' field inside the indirect sources option and all the 'sparql query' fields for the templated query with indirect variables option.

The reason we want this is to have a cleaner look when creating custom queries and have direct feedback on the query syntax. At this moment it is just a simple textarea without syntax validation.

Difficulties: