sebferre / sparklis

Sparklis is a query builder in natural language that allows people to explore and query SPARQL endpoints with all the power of SPARQL and without any knowledge of SPARQL.
Apache License 2.0
40 stars 10 forks source link

Possibility to extend Sparklis #13

Open Maheen-Bakhtyar opened 1 year ago

Maheen-Bakhtyar commented 1 year ago

Bonjour Sébastien Ferré,

First of all, thanks for this amazing tool!

I am interested to in using Sparklis for my research work and I am curious if there is a possibility to extend and modify the interface of Sparklis? Is there anything in the pipeline to make it more user-friendly? Or if you could share how this can be done. Can you please share how to implement templates? and what are the possibilities to do that?

Thank you very much

Regards Maheen

sebferre commented 1 year ago

Bonjour Maheen-Bakhtyar, there is a JS API for extending and customizing Sparklis. Have a look at https://github.com/sebferre/sparklis/blob/master/doc/main.md . Keep in mind that this JS API is under progress, feedback welcome. Regards

Maheen-Bakhtyar commented 1 year ago

Bonjour, Thank you for letting me know about this. I am hopeful it will be helpful for my work. Regards

Maheen-Bakhtyar commented 1 year ago

Bonjour Sébastien Ferré, I looked at the documentation https://github.com/sebferre/sparklis/blob/master/doc/main.md that you provided. It gives a detail of all the functions that we can use. It would be really helpful if you could also provide one basic example of how we can use it. I searched on the Internet but was unable to find an example as a starting point. It will be really helpful to go further if there is one example, please. Can you please help me and provide a simple example of how I can use a JS API in my code? Merci Beaucoup

sebferre commented 1 year ago

Sorry, I don't yet have proper examples of use of the API.

Maheen-Bakhtyar commented 1 year ago

No problem. Let me share one soon :-)

Merci

CaptSolo commented 1 year ago

@sebferre : Does Sparklis JS API (mentioned above) allow us to add a new menu item to the horizontal menu that is used for switching between Sparklis, YASGUI and History views?

image

This ability would be useful, for example, for showing a visualization of the generated SPARQL query.

P.S. Thank you for this great application!

sebferre commented 1 year ago

@CaptSolo : yes, this is possible.

  1. Duplicate and adapt the HTML code in osparklis.html for e.g. the YASGUI view (look for yasgui-view). There are two components: the button and the div containing the view.
  2. Use the function sparklis_extension.hookSparql from the JS API to define some behavior when a new SPARQL query is defined, e.g. filling the new view with a graphical representation of the query.

Hope this helps.