-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix operation type detection #139
base: master
Are you sure you want to change the base?
Conversation
@Qup42 Thanks a lot for the quick fix. It does fix the queries from #137 and #138, but this query still fails: https://qlever.cs.uni-freiburg.de/osm-planet/pgD6OH |
@hannahbast I have adjusted the regexes for the query. As we see by there being so many Issues with identifying whether an operation is a Query or an Update, using Regexes for that is a flawed approach. It's tricky to get right. I have opened IoannisNezis/Qlue-ls#22 to move the logic of identifying there. This is a much better place, because it uses the parsed query for identifying the type. |
@Qup42 Thanks a lot for the additional fix. I agree that a full parse would be better if we had it. But until we have it, is there something wrong (or complexity that I am missing) with the following approach:
In my understanding, each of these can be done correctly with a REGEX. Comment removal is tricky after the first keyword because the comment symbol can also occur in literals and IRIs. But for the purpose of query type detection, we do not care about anything after the first keyword. |
@hannahbast that's basically what is happening at the moment, with the difference that the two first keywords are looked at to determine the exact type. This could be removed, but it also isn't the part that caused the problems. The problems were caused by incorrect regexes and missing the regex to remove comments. One thing that has to though of is that the |
@Qup42 Tricky I understand. But do I understand you right that you are confirming that with the right regexes, this can be done correctly? (That is a non-trivial, but I think true, statement because general SPARQL parsing cannot be done correctly with a few regexes of reasonable complexity.) |
@hannahbast We have no nesting and only some simple items. I think that that should be possible, yes. |
@hannahbast now we're doing it the right way by using qlue-ls. This is a good intermediate solution until the editor is replaced fully. It uses the same parsing as the formatter and then looks at the type of the corresponding clause to determine the type. Thanks a lot to @IoannisNezis for helping with the required changes and enabling an extremely quick turnaround. Great service, would use it again ;) 5/5 |
@Qup42 @IoannisNezis I tried to build a docker image with this change and got:
|
@hannahbast my bad, |
hm, the I would fix this, but i seem not to have the permissions... To fix just run: npm install and push the new |
Resolves #137, Resolves #138, Resolves ad-freiburg/qlever#1838