The Wikidata API will simply be an extension of the existing MediaWiki API.
The following functions are being envisioned for Phase 1 (or even Phase 0.5, which is, for Wikimania.)
*
means optional
Done
getItemId( site, title )
setLabel( ( id XOR ( site, title ) ), language, label, *summary)
(ApiWikibaseSetLabel)setDescription( ( id XOR ( site, title ) ), language, description, *summary)
(ApiWikibaseSetDescription)linkSite( ( id XOR ( site, title ) ), linksite, linktitle *badge, *summary)
(ApiWikibaseSiteLink)
TODO
getSiteLinks( ( id XOR ( site, title ) )
getItem( ( id XOR ( site, title ) ), *language)
- returns the data for a given ID or site+title pair. This is used by the Wikidata client extension. The language is set in order to add labels to the IDs. (ApiWikibaseGetItem )addAlias(id, language, alias)
(ApiWikibaseAddAlias)removeAlias(id, language, alias)
(ApiWikibaseRemoveAlias)searchByName(language, fragment, *hints)
(used for the Wikidata Suggest widget)
TODO
updateSiteLinks( title, data )
- Gets called by the repo and contains the new site links to use after something got changed on the repo wikigetSiteLinks( id XOR title )
- Get the site links for the article with provided title on the local wiki or for the item with the id. This data is obtained from the local wiki where it gets updated via updateSiteLinks.changeSiteLinks( ( id XOR title ), changes )
- Gets called by the site links UI of the local wiki and contains a list of additions and removals which should be propagated to the repo. This is thus a proxy API module. Should look into immediately updating the local link list to not have to wait for the repo to run the job that will push the change back. In fact, we might want the repo to skip updating this client wiki altogether.