Page MenuHomePhabricator

๐Ÿ”— Include a URL of an article page in sitelink data in Wikibase REST API
Closed, ResolvedPublic5 Estimated Story Points

Description

As a tool developer I want to know the URL of the article linked to Wikidata item so that I can use a precise URL in my tool

Sitelink data returned e.g. by the GET /entities/items/{item_id} request contains information about the site (its locally configured ID), article's title, and possible item badges.
Knowing the exact URL of the article page requires finding out what URLs are relevant for a particular "site" -- this require making further API calls and to a different API.

Sitelink data should also include a url field that includes the relevant URL -- the same URL that "Action API" wbgetentities returns when providing props=sitelinks/urls parameter, see e.g. https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q42&props=sitelinks/urls

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptFeb 22 2023, 5:46 AM
Silvan_WMDE set the point value for this task to 5.Feb 22 2023, 10:37 AM

Task breakdown notes:

  • Create a new SiteLink that contains all the properties of the current site link data model plus the URL, and SiteLinks read models. T330885
  • Modify SiteLinkListSerializer to use the new read model, and include the URL. T330887
    • Renaming SiteLinkListSerializer to SiteLinksSerializer
  • Create a SiteLinksReadModelConverter to convert a list of site links into SiteLinks read model object. T330911
  • Modify ItemDataRetreiver to construct site links URLs. T330886
    • Modify ItemData read model to start using the SiteLinks read model.
  • Modify OpenAPI specification. T330890
Muhammad_Yasser_Jazirahly_WMDE renamed this task from Include a URL of an article page in sitelink data in Wikibase REST API to ๐Ÿ”— Include a URL of an article page in sitelink data in Wikibase REST API.Mar 1 2023, 2:08 PM

Looks good, thanks! The "encoding" of URLs seems to work as intended as well.