The Wikidata API will simply be an extension of the existing [[mediawikiwiki:API:Main page|MediaWiki API]].
{{Message | type = attention | The API is documented on [[mw:Extension:Wikibase/API]] and in <code>api.php</code>. Actual URL will be depending on setup.}}
The following functions are being envisioned for Phase 1 (or even Phase 0.5, which is, for Wikimania.)
<code>*</code> means optional
=== [[mw:WB|Wikibase]] ===
*[skeleton]; <code>searchByName(language, fragment, *hints)</code> (: This is used forin the Wikidata Suggest widget ), but a good text search facility isn't available for the moment.▼
; <code>setItem(data)</code> : This is a continuous work in progress, and the current version will probably not be the final solution.
=== PhaseWikibase 1Client ===
*; <code>changeSiteLinks( ( id XOR title ), changes )</code> -: 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. ▼
*[ok] <code>getItemId( site, title )</code>
*[ok] <code>linkSite( ( id XOR ( site, title ) ), linksite, linktitle *badge, *summary)</code> (''ApiWikibaseSiteLink'')
:This call cives a strange database error when used with ''site'' and ''title'', but it stores as it should.
* <s><code>setLabel( ( id XOR ( site, title ) ), language, label, *summary)</code></s> (''ApiWikibaseSetLabel'') -> remove
* <s><code>setDescription( ( id XOR ( site, title ) ), language, description, *summary)</code></s> (''ApiWikibaseSetDescription'') -> remove
*[ok] <code>setLanguageAttribute(id XOR (site, title), (label OR description), "update"|"add", *summary)</code>
*: Make naming consistent with the Item parameter.
** "update" throws an error if no value exists
** "add" will throw an error if the value already exists
** "set" always works
* <code>deleteLanguageAttribute(id XOR (site, title), attribute, *summary)</code>
:missing
*[ok] <code>getSiteLinks( ( id XOR ( site, title ) )</code>
*[ok] <code>getItems( ( ListOfIds XOR ( ListOfSites, ListOfTitles )) ), *language)</code> - 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'' )
:implemented as <code>getItems( ( ids XOR ( sites, titles )) ), *language)</code>
*[not ok] <code>setAliases(id XOR (site, title), (add OR remove) XOR set, language, *summary)</code> (''ApiWikibaseSetAlias'')
:works but solves probably the wrong problem (aka the link problem, not alias problem)
▲*[skeleton] <code>searchByName(language, fragment, *hints)</code> (used for the Wikidata Suggest widget)
:only a skeleton
=== PhaseSee 2also ===
* [[Wikidata/Development/Phase 2 API]]
*[ok] <code>setItem(data)</code>
== [[mw:WBC|Wikibase Client]] ==
''Kittens are crying!''
=== TODO ===
* <code>updateSiteLinks( title, data )</code> - Gets called by the repo and contains the new site links to use after something got changed on the repo wiki
* <code>getSiteLinks( id XOR title )</code> - 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.
▲* <code>changeSiteLinks( ( id XOR title ), changes )</code> - 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.
[[Category:Wikidata]]
|