Wikidata/Notes/API: Difference between revisions

Content deleted Content added
m Reverted changes by Soteriaspace (talk) to last version by Lydia Pintscher (WMDE)
Tag: Rollback
 
(26 intermediate revisions by 10 users not shown)
Line 1:
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.)
 
=== TODOTodo ===
<code>*</code> means optional
 
=== [[mw:WB|Wikibase]] ===
*; <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.
 
=== DoneWikibase Client ===
*; <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.
 
== See also ==
* <code>getItemId( site, title )</code>
* [[Wikidata/Development/Phase 2 API]]
* <strike><code>setLabel( ( id XOR ( site, title ) ), language, label, *summary)</code></strike> (''ApiWikibaseSetLabel'') -> remove
* <s><code>setDescription( ( id XOR ( site, title ) ), language, description, *summary)</code></s> (''ApiWikibaseSetDescription'') -> remove
* <code>linkSite( ( id XOR ( site, title ) ), linksite, linktitle *badge, *summary)</code> (''ApiWikibaseSiteLink'')
 
=== TODO ===
* <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>
* <code>getSiteLinks( ( id XOR ( site, title ) )</code>
* <code>getItems( ( ListOf(id) XOR ( ListOf(site), ListOf(title) )) ), *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'' )
* <code>setAliases(id XOR (site, title), (add OR remove) XOR set, *summary)</code> (''ApiWikibaseSetAlias'')
* <code>searchByName(language, fragment, *hints)</code> (used for the Wikidata Suggest widget)
 
==== Phase 2 ====
* <code>setItem(data)</code>
 
== [[mw:WBC|Wikibase Client]] ==
 
=== Done ===
 
''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]]