sparna-git / Sparnatural

Sparnatural : Typescript visual SPARQL query builder for knowledge graphs, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
206 stars 34 forks source link

Ability to pass autocomplete timeout as a parameter #533

Closed martinjedwabny closed 4 months ago

martinjedwabny commented 8 months ago

Description I have an use-case with a big knowledge base in which the autocomplete fails to get the dropdown data due to a 7 second timeout for the autocomplete widget.

Desired behaviour I would like to be able to pass the timeout time in ms as an optional parameter of sparnatural.

File + line with the timeout: https://github.com/sparna-git/Sparnatural/blob/7f7ebcc32dc98a57848f4f5ea0577c998941502d/src/sparnatural/components/widgets/AutoCompleteWidget.ts#L89

tfrancart commented 8 months ago

Thanks ! yes good idea. We will be working in general on the autocomplete widget in the next few months. This raises the more general question of how to customize the behaviors of widgets, as more and more parameters will be needed; we probably need a general framework for that.

tfrancart commented 8 months ago

As a workaround, have you tried optimizing the datasource of the widget, in order to tune the SPARQL query that is being sent to fetch the autocomplete values ? this could make it below the 7s threshold maybe ?

tfrancart commented 4 months ago

Now that we don't rely on easyautocomplete, but rather on the fetch method of the browser, the default timeout being used is much higher. This would be the default timeout of the browser, which should be around 1 minute or 30 seconds, depending on the browser. I will thus close the issue, feel free to reopen if needed after testing with the latest version.