Page MenuHomePhabricator

Unicode function seems to break title on Wikidata Query Service
Closed, DeclinedPublic

Description

Context:
Since the #title: function to display to title on the on Wikidata Query Service (see T225883) was undocumented and since it's a simple functionality, I decide to document it myself. So I did some tests on what is acceptable and works or not in the title when I stumble on this issue.

Problem:

When using the Unicode function \u{} in the title on Wikidata Query Service, I've got a Server error (I'm guessing some string not sanitize somewhere?).

Example:
See this query https://w.wiki/4YRh (or any query with a title containing \u)

Acceptance criteria:
No more error
(whether the function should be interpreted or not is not important here, the point is not to be blocked by the title)

Event Timeline

Hm, I guess that must be a Blazegraph bug, it shouldn’t try to interpret comments like that. Checking that it also happens without the UI:

$ curl --data-urlencode query='ASK{}#\u' https://query.wikidata.org/sparql
SPARQL-QUERY: queryStr=ASK{}#\u
java.util.concurrent.ExecutionException: java.lang.Error: Invalid escape character at line 1 column 8.
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)
        at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:292)
        at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:678)
        at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:275)

Caused by: java.lang.Error: Invalid escape character at line 1 column 8.
        at com.bigdata.rdf.sail.sparql.ast.JavaCharStream.readChar(JavaCharStream.java:331)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilderTokenManager.jjMoveNfa_0(SyntaxTreeBuilderTokenManager.java:3716)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilderTokenManager.jjMoveStringLiteralDfa0_0(SyntaxTreeBuilderTokenManager.java:182)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilderTokenManager.getNextToken(SyntaxTreeBuilderTokenManager.java:3948)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.jj_ntk(SyntaxTreeBuilder.java:9637)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.AskQuery(SyntaxTreeBuilder.java:871)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.Query(SyntaxTreeBuilder.java:337)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.QueryContainer(SyntaxTreeBuilder.java:216)
        at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.parseQuery(SyntaxTreeBuilder.java:32)

In DBPedia (Virtuoso) it’s not an issue: https://dbpedia.org/sparql?query=ASK{}%23\u

Thanks for bringing up this bug. As we are planning on migrating off of Blazegraph, Search is not currently addressing bugs in Blazegraph at the moment -- luckily it also seems like this issue can be worked around by removing the commented code.

VIGNERON_en_residence lowered the priority of this task from Low to Lowest.Dec 14 2021, 8:52 AM

I can confirm that it indeed comes from Blazegraph (at least it happens on LinguaLibre SPARQL endpoint https://lingualibre.org/bigdata/#query which is also Blazegraph) and no matter where/what the comment is, so unrelated to title:.

I guess we can close this bug as declined (or stalled ?).
I can't wait to see the replacement for Blazegraph!

Let’s just decline this, I don’t think there’s any other realistic outcome of this task (and keeping it open until we’ve migrated off Blazegraph doesn’t seem useful).