Page MenuHomePhabricator

Brackets, inverses, and other property paths break autocomplete
Closed, ResolvedPublic

Description

If a user types "?p ^wdt:" and then presses Ctrl+space, the auto completion shows a "Unknown prefix '^wdt:'" message.
If a user types "?p wdt:P31/wdt:" and then presses Ctrl+space, using autocomplete replaces the entire path, including the "wdt:P31". Similarly, the "|" , "(", and "!" operators all break autocomplete.

Event Timeline

Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

(Sorry, in case this wasn't clear, the behaviour I'm referring to is on the Wikidata Query Service, https://query.wikidata.org .)

AFAIR right now the code uses \S to grab words, I think it should use something like \w.

Smalyshev triaged this task as Medium priority.
Smalyshev moved this task from Incoming to GUI on the Wikidata-Query-Service board.

Change 272755 had a related patch set uploaded (by Jonas Kress (WMDE)):
Clean illegal characters from prefix

https://gerrit.wikimedia.org/r/272755

I fixed the first one, but I think the second one needs a complete rewrite of getCurrentWord() in wikibase-rdf-hint.js.

If we can't handle the second one yet, we should at least make it so that it doesn't kill the wdt:P31/ part, otherwise it is rather weird. I think it would be better not having completion in this case (then I just insert space after /, complete and remove space) than have it ruin my already written code.

Change 272755 merged by jenkins-bot:
Rewrite of getCurrentWord

https://gerrit.wikimedia.org/r/272755