Page MenuHomePhabricator

Create a WikidataLexeme component for Default View
Closed, ResolvedPublic

Description

Description

Whenever an Wikidata Lexeme object (object of type Z6005) is presented or required in the UI, we will render a special component to view, create and edit Wikidata Lexemes.


Internal representation

Wikidata Lexemes will be represented in Wikifunctions as:

  • Function call to Z6xx5 with the Lexeme id as a string input (should solve T373588 first, at least deciding the function Zid):
{
  "Z1K1": "Z7",
  "Z7K1": "Z6xx5",
  "Z6xx5K1": "L1234"
}
  • As per our current implementation, the string "Lxxxx" is interpreted as a valid Z6/String object in canonical form; this should remain this way.
  • Whenever a Lexeme is represented in Default View, it should be only represented as a function call to Z6xx5
    • Mode selector should not allow changing to reference
    • Mode selector should not allow changing to literal

Content retrieval

Api for the Lexeme Lookup search:
https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities

Api for retrieving a Lexeme object given its Lid:
Probably the same choice as decided for T368654: Determine which API we should use to fetch Lexeme data from Wikidata when specified in the function-orchestrator


Desired behavior/Acceptance criteria

  • in view mode:
    • shows the Lexeme label and links to the external wikidata reference
    • the presentation may be, initially, a link, but it can maybe contain some visual aid to communicate that this is an external link to a Wikidata Lexeme object
  • in edit mode:
    • renders a selector (CdxLookup component)
    • sets the selector to whatever initial value it may have (if any)
    • allows searching and selecting from all available Wikidata Lexemes

Devices and Design (URLs or screenshots)

  • Desktop: ...
  • Small screens/mobile: ...

Completion checklist

Event Timeline

Change #1070915 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] [WIP] Create a Wikidata Lexeme component to search and select Lexemes

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

Change #1070915 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Create a Wikidata Lexeme component to search and select Lexemes

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

Change #1078357 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Fix Wikidata Lexeme component alignment and other style issues

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

Change #1078357 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Remove Wikidata Lexeme component external link icon

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

Change #1078614 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Fix the fix: Set Lexeme component top padding only on read view

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

Change #1078614 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Fix the fix: Set Lexeme component top padding only on read view

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

Change #1078993 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Perform Lexeme search with 1 and 2 characters, too

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

Change #1078993 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Perform Lexeme search with 1 and 2 characters, too

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