[Story] Display Wikidata pages on Special:Nearby with label instead of Q id titles
Closed, ResolvedPublic

Description

Special:Nearby displays Wikidata items using the Q id page title for display. Instead it should display the label in the relevant language.

aude created this task.Oct 8 2015, 2:22 PM
aude updated the task description. (Show Details)
aude raised the priority of this task from to Normal.
aude added projects: Wikidata, MobileFrontend.
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 8 2015, 2:22 PM
Jonas set Security to None.
Jonas moved this task from Proposed to Backlog on the Wikidata-Sprint-2015-09-29 board.
Jonas raised the priority of this task from Normal to High.
Jonas added a subscriber: thiemowmde.
Jonas added a subscriber: Lydia_Pintscher.
aude added a comment.Oct 9 2015, 9:46 AM

I was thinking that display text or "display title" could be a page prop.

It shouldn't use the display title, as we have currently in page props, as wikipedians do very strange stuff with it (html formatting, etc) but something similar. To be generic, it could help fix the issue of when searching for "iPhone", it suggests "IPhone", for example, and Wikibase could hook in with what we need. in 99% of cases, it's the same as the title text.

the page prop would need a language parameter, so we get the appropriate label.

ideally the page prop goes into core. It can be flexible about using whatever backend, database or elastic and for now, with wikibase, use the terms table.

for nearby and mobile search, it would be easy enough and generic enough to request another pageprop, imho.

Bene added a subscriber: Bene.Oct 9 2015, 9:47 AM
daniel added a subscriber: daniel.EditedOct 9 2015, 2:24 PM

Using page_props to store labels basically duplicating half of the terms table. Whatever uses it needs to know how we encode languages there, and would have to re-implement language fallback. This does not seem like a good approach to me.

We already have this information in the database, we have access services and an API for it (wbgetentities or pageterms). Let's use that.

Special:Nearby doesn't offer a nice interface to plug this in. If we want this quickly, it will have to be an evil hack in JS. If domain = wikidata run extra query, replace display title.

aude added a comment.Oct 9 2015, 2:37 PM

sorry, meant to say "displaytext" would be an api prop in the query module.

for wikidata, this can come from the terms table.

If we want to make this a generic thing, then for wikitext it could be via pageprops. e.g. something like {{SEARCHDISPLAYTEXT:iPhone}} so that the suggester can show "iPhone" instead of "IPhone".

aude added a comment.Oct 9 2015, 2:40 PM

pageterms does not work for items, though could. but I don't think it's a good idea to use that, since we *only* want to use display text for entities and not override the wikitext title with pageterms.

wbgetentities does not work as a pageprop currently.

I'm also not enthusiastic about using something so wikidata specific in mobile frontend for these things, though maybe wikidata-specific (yet somewhat generic solution like a pageprop) is ok as a short term solution.

we can reuse as much code as possible from wbgetentities and pageterms.

Jonas assigned this task to daniel.

Change 244704 had a related patch set uploaded (by Jonas Kress (WMDE)):
[WIP] Display label instead of Q id titles

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

Change 244698 had a related patch set uploaded (by Jonas Kress (WMDE)):
Allow the PageTerms API module to work on the repo.

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

Florian added a subscriber: Florian.Oct 9 2015, 4:25 PM
Jdlrobson added a subscriber: Jdlrobson.

Please just use mobile tag if you do not require a change in MobileFrontend. If you do require one best to create a sub task so we know how to help.

The evil hack is ready. I will prepare the evil switch: mw.config.values.wgSiteName, so we can use it on https://test.m.wikidata.org and https://m.wikidata.org

Bene added a comment.Oct 9 2015, 7:17 PM

I think we should reduce the usage of words like "evil" and "hack" to where they really apply. As far as I understand this is not an "evil hack" but a domain specific solution that might be changed to be more flexible in future but is also something we can live with. If something is called "evil" I wonder how we can even deploy it.

daniel reassigned this task from daniel to Jonas.

Proposal for now: We add a check in JS that causes the label from pageterms to be used only on wikibase repos (and ideally only on entity namespaces). We also add a TODO pointing to a ticket (to be created) about a generic way to get a "nice display title".

Tobi_WMDE_SW reassigned this task from Jonas to thiemowmde.
Tobi_WMDE_SW moved this task from Doing to Review on the Wikidata-Sprint-2015-09-29 board.

Change 246110 had a related patch set uploaded (by Aude):
Introduce displaytext ApiQuery prop [WIP]

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

Change 246115 had a related patch set uploaded (by Aude):
Show displaytext as title in Special:Nearby [WIP]

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

Change 246282 had a related patch set uploaded (by Jdlrobson):
Hygiene: Generalise search api requests across MobileFrontend

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

Change 244704 abandoned by Jonas Kress (WMDE):
Display labels instead of Q id titles in Wikibase item namespaces

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

Change 246282 merged by jenkins-bot:
Hygiene: Generalise search api requests across MobileFrontend

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

Change 246115 abandoned by Jdlrobson:
Show displaytext as title in Special:Nearby [WIP]

Reason:
See https://phabricator.wikimedia.org/T115646

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

Elitre added a subscriber: Elitre.Oct 29 2015, 12:14 PM
aude closed this task as Resolved.Oct 29 2015, 10:47 PM
aude removed a project: Patch-For-Review.
hoo moved this task from Review to Done on the Wikidata-Sprint-2015-10-13 board.Oct 30 2015, 11:08 AM

Change 246110 abandoned by Aude:
Introduce displaytext ApiQuery prop [WIP]

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