Skip to content
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

Query error: Could not determine operation type #137

Open
dpriskorn opened this issue Feb 23, 2025 · 4 comments · May be fixed by #139
Open

Query error: Could not determine operation type #137

dpriskorn opened this issue Feb 23, 2025 · 4 comments · May be fixed by #139
Assignees

Comments

@dpriskorn
Copy link

dpriskorn commented Feb 23, 2025

#title:Number of main subjects inferred from titles 
SELECT (count(?item) as ?c)
WHERE 
{
  ?item p:P921 [ prov:wasDerivedFrom [ pr:P887 wd:Q69652283 ] ].
}

https://qlever.cs.uni-freiburg.de/wikidata/BoJJyB

@ktk
Copy link

ktk commented Feb 24, 2025

Remove the comment in the query, that seems to trigger this bug. Funnily enough I ran into it as well just a few hours ago. I tried reproducing it but I can't reproduce it always. Seems to be a problem with the SPARQL parser when a # is before the SELECT. @hannahbast .

@ahankinson
Copy link

Same here. Looks like it's this function:

https://github.com/ad-freiburg/qlever-ui/blob/master/backend/static/js/qleverUI.js#L519-L569

Seems an odd way of calculating the operation type, simply by looking at the first word of a query... @Qup42 any chance you could revisit this?

FWIW, some of my queries trigger this, and some don't. I'm working on trying to narrow down what triggers it.

@Qup42 Qup42 self-assigned this Feb 24, 2025
@ahankinson
Copy link

For my queries, this regex:

.replace(/PREFIX\s+\w+:\s+<[^<]*>\s*/gi, "")

Wasn't sufficient as it was not behaving correctly with all of my queries. ChatGPT suggests taking into account line endings, e.g.,

.replace(/PREFIX\s+\w+:\s+<[^<]*>\s*\r?\n/gi, "")

@hannahbast
Copy link
Member

See #138, will be fixed asap

@Qup42 Qup42 linked a pull request Feb 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants