ad-freiburg / qlever-ui

A user interface for QLever
Apache License 2.0
21 stars 15 forks source link

Line with only a comment leads to an exception when using name_service #30

Closed graue70 closed 3 years ago

graue70 commented 3 years ago

The 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

leads to

image

even though running

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`
url = new URL("https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy")
url.search = new URLSearchParams({query: query})
url.toString()

in javascript gives a URL that works without error.

graue70 commented 3 years ago

Interestingly, the following javascript code gives a URL which returns an error:

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`
name_service = true  // If you change this to false, the URL 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()
graue70 commented 3 years ago

I opened https://github.com/ad-freiburg/QLever/issues/412 because this is probably not related to the UI after all.