Page MenuHomePhabricator

Add tooltip for Lexemes on WDQS
Closed, ResolvedPublic8 Estimated Story Points

Description

As a query writer I want to be supported in more easily finding out what Lexeme is behind an ID in my query.

Problem:
The Query Service has tooltips for Item and Property IDs but not Lexeme IDs. It should.

Example:
When you type this simple bogus query:

SELECT * WHERE {
  wd:Q1 .
  wd:L1 .
}

If you hover the value Q1 you will see the tooltip universe (Q1) totality consisting of space, time, matter and energy (which is the label, the id and the description).
BUT if you hover the value L1 there is no tooltip. I expect something like ama/𒂼 (L1) Sumerian, noun (which is the lemmas, the id, the language and the lexical category).

Screenshots:

image.png (279×422 px, 19 KB)

BDD
GIVEN a Lexeme ID in a query on the Query Service UI
WHEN hovering over the ID
THEN a tooltip is shown that contains the Lemma, ID and language of the Lexeme

Acceptance criteria:

  • tooltips for Lexemes are available in the same way they are available for Items and Properties

Event Timeline

I’ll mention that properties don’t get a correct tooltip either at the moment: T186733

image.png (107×255 px, 6 KB)

I think this needs a task breakdown or similar discussion, to figure out how we want to implement this. Currently, the tooltips use wbsearchentities, but lexeme results in that API don’t include the lemmas, language or lexical category information, and while we could shoehorn the language + lexical category (labels) into the description field, the lemmas really don’t fit into the label field (if there’s more than one lemma, we should show all of them). I think the best approach is to use wbgetentities – in the case of lexemes, two wbgetentities calls (first for the lexeme and then for the items that it references as the language and lexical category).

I’ll mention that properties don’t get a correct tooltip either at the moment: T186733

image.png (107×255 px, 6 KB)

Hmmm I tried Properties and it worked at least in this case:

image.png (302×743 px, 38 KB)

If it makes sense to solve them together that sounds good.

They work as wdt:P31, yes, but not as wd:P31.

Task breakdown notes:

  • We want to change the tooltip code to use wbgetentities.
  • The results should be cached, so that we don’t re-request the data of the same entities repeatedly.

Change 869814 had a related patch set uploaded (by Michael Große; author: Michael Große):

[wikidata/query/gui@master] Add tooltips to Lexeme-Ids

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

Change 869814 merged by jenkins-bot:

[wikidata/query/gui@master] Add tooltips to Lexeme-Ids

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

This will be ready to be verified after it has been deployed. As similarly mentioned in T325808, the next deployment will happen in the new year.

Thanks Michael and Lucas

This is looking all good to me \o/