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

ParseException when using nameservice on a query which contains a comment line #412

Closed
graue70 opened this issue Jun 1, 2021 · 2 comments

Comments

@graue70
Copy link
Contributor

graue70 commented Jun 1, 2021

The following javascript code

query = `PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label WHERE {
  # A line containing only whitespace and a comment breaks the query
  wd:Q90 @en@rdfs:label ?label .
}
LIMIT 10`  // If you remove the comment line from the query, the URL works
name_service = true  // If you change this to false, the URL also works
send = 40

url = new URL("https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy")
url.search = new URLSearchParams({query: query, name_service: name_service, send: send})
url.toString()

leads to the following two URLs (depending on whether name_service is true or false):

https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX+wd%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0ASELECT+%3Flabel+WHERE+%7B%0A++%23+A+line+containing+only+whitespace+and+a+comment+breaks+the+query%0A++wd%3AQ90+%40en%40rdfs%3Alabel+%3Flabel+.%0A%7D%0ALIMIT+10&name_service=true&send=40

or

https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX+wd%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0ASELECT+%3Flabel+WHERE+%7B%0A++%23+A+line+containing+only+whitespace+and+a+comment+breaks+the+query%0A++wd%3AQ90+%40en%40rdfs%3Alabel+%3Flabel+.%0A%7D%0ALIMIT+10&name_service=false&send=40

The first one leads to a ParseException, the second one works.

If you remove the comment line from the query, the URL works even with name_service = true. Only the combination of both comment AND name_service fails.

@joka921
Copy link
Member

joka921 commented Sep 4, 2021

@hannahbast
This seems to be an issue in your QleverProxy, qlever itself does not handle the name service, and as I understand the issue,
The query without the name service, which is sent to QLever unaltered, works fine.

@hannahbast
Copy link
Member

This is now implemented within the QLever UI and no longer using a proxy script

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

No branches or pull requests

3 participants