Triply-Dev / YASGUI.YASQE-deprecated

Deprecated, see https://github.com/TriplyDB/Yasgui for the Yasgui monorepo
MIT License
73 stars 36 forks source link

YASQE freezes browser in certain situation #135

Closed gneissone closed 6 years ago

gneissone commented 6 years ago

My browser freezes on the SPARQL query page in the UI in a very specific situation...

I experience the issue when the last prefix in the query is on the same line as the beginning of the SELECT or CONSTRUCT statement, then try to add a new triple to the query containing a prefix not already in the prefixes list.

The query page tries to add the new prefix to the prefixes list at the top, but my browser locks up in the situation described above. It works fine if the last prefix statement and the beginning of the SELECT or CONSTRUCT is on a new line.

screen shot 2018-06-22 at 1 09 32 pm
wouterbeek commented 6 years ago

I've observed similar slowdowns with longer lines. A quick fix would be to separate the various prefix declarations by newlines. The real solution is to critically inspect the YASQE parser, which I suspect uses unnecessary per-line processing in some places.

gneissone commented 6 years ago

To clarify, the issue I'm describing occurs at any line length if the last prefix and the beginning of the query itself are on the same line. Another example from the demo site:

Another example

LaurensRietveld commented 6 years ago

Thanks for the report @gneissone . This was caused by yasqe creating an invalid query as it auto-inserted the foaf prefix at the wrong location. Fixed by simply prepending the new prefix declaration at the top of the query, instead of just before the select