ad-freiburg / qlever-ui

A user interface for QLever
Apache License 2.0
19 stars 12 forks source link

URL for QLeverUI with particular query #7

Closed hannahbast closed 4 years ago

hannahbast commented 4 years ago

There is currently a mechanism that produces a unique URL after a query has been executed so that that URL leads to the UI with that query already entered. For example: http://qlever.informatik.uni-freiburg.de/Wikidata_Full/KyZa6C

However, there is no mechanism (or not that I know of) for linking to the site with a query that has not yet been entered. A natural URL would be (PREFIXes ommitted for brevity) http://qlever.informatik.uni-freiburg.de/Wikidata_Full/query=SELECT+?x+WHERE+{+?x+wdt:P31+wd:Q5+} or something like that. It would also be good if this were possible both with a GET and a POST request. In the case of a POST request, it would be natural to turn the URL into one of the kind described in the first paragraph.

As an aside, are the URLs described in the first paragraph persistent? That is, do they survive any restarts and updates of the QLever UI as long as the sqlite3 database is preserved? They should!

jbuerklin commented 4 years ago

As an aside, are the URLs described in the first paragraph persistent? That is, do they survive any restarts and updates of the QLever UI as long as the sqlite3 database is preserved? They should!

Yes, these URLs are stored in the sqlite3 database. They can, however, be deleted by clicking "Resources > Clear History" (I might rename that to something more understandable like "Delete URLs for executed queries")

jbuerklin commented 4 years ago

I added a share button next to the download button in the latest commit. @hannahbast any comments before I close this issue?

graue70 commented 4 years ago

Yes, these URLs are stored in the sqlite3 database. They can, however, be deleted by clicking "Resources > Clear History" (I might rename that to something more understandable like "Delete URLs for executed queries")

Does the 'Clear History' delete only the queries I created myself or does it globally delete every query currently in the database?

graue70 commented 4 years ago

I added a share button next to the download button in the latest commit.

89caea7b2865af178daa05a6a105522c4dc5a137

jbuerklin commented 4 years ago

Yes, these URLs are stored in the sqlite3 database. They can, however, be deleted by clicking "Resources > Clear History" (I might rename that to something more understandable like "Delete URLs for executed queries")

Does the 'Clear History' delete only the queries I created myself or does it globally delete every query currently in the database?

Yes, it will delete every query in the database. Also, as of 9a9314b46f3a33eb24ec9b376603e7e536aa6b06, this button is only available for project admins, a.k.a. people who have the credentials to login to /admin

graue70 commented 4 years ago

I regularly run a query on the web UI, then close my browser (current Firefox version), take a break of about a week, open my browser, click on 'Restore Previous Session' (which gets me back all the browser tabs that were open when I closed the browser window) and then want to look at the query I ran last time. Usually, even though the URL is correct (and has a unique part at the end), the query text box is empty and the result table doesn't show. I don't see any way of getting back my query in this situation.

Does this really only happen when an admin clicks on 'Clear History' between me closing and opening the browser window? If so, why is it apparently clicked at least once a week?

I realize I can click on 'Share' and save the GET URL instead of the POST URL as a workaround. I'm just wondering why I have to.

EDIT: Actually, If I enter a GET URL and click on 'Execute', the URL changes to the POST URL (#25). So the workaround isn't even easily usable.

jbuerklin commented 3 years ago

I did some changes in 20479f0b9f44731e4531963286c5f6824d2a8192 that would prevent possible "unintetional" deletions of the stored links. If this didn't fix your issue, I'm not sure I'll have another clue on why the links "get lost" like this.