Wikibase/API/af

Wat is die Wikibase API?
Wikibase bied 'n algemene meganisme om stellings as gestruktureerde data te stoor. Die verklarings oor items verskyn op die bediener by wikidata.org. Raadpleeg Wikidata:Glossary vir meer inligting oor Wikibase en ander konspete.



The Wikibase API allows querying, adding, removing and editing information on Wikidata or any other Wikibase instance.

Dit word voorsien deur 'n stel uitbreidings wat MediaWiki API-modules implementeer. Om die Wikibase API te gebruik,moet u dus basiese vertroudheid met die MediaWiki Action API:aksies,navrae,ens.Hê,en omgekeerd u ervaring met generiese parameters soos en is van toepassing op die Wikibase API.

How to use it
Send requests to the API through HTTP, the same way with the MediaWiki Action API. See API:Tutorial#How to use it for information on how to use the MediaWiki Action API.

Request format
The endpoint for the API is https://wikidata.org/w/api.php.

In the query string, add the action parameter which tells the API which action to perform, e.g.  tells the API to get the data for Wikibase entities. For meta and property submodules, use and   respectively.

Daar is 'n paar parameters wat byna altyd beskikbaar is.Meervoudsvorme word gebruik in gevalle waar 'n parameter verskillende waardes kan inneem.Die parameters is:

GET request
Explanation of each part of the URL:


 * is the main endpoint.
 * tells the API to get the data for Wikibase entities.
 * means get the data from English Wikipedia.
 * indicates the title of the page to get data from.
 * indicates properties to get from the entities, in this case the property is the descriptions of the entities.
 * means filter the results down to the English language.
 * indicates JSON output, which is the recommended output format.

Response
Die antwoord van 'n versoek sal gewoonlik die volgende bevat:
 * 'N Sleutel $sleutel1 met 'n Boole-rolverdeling as 'n heelgetal as die versoek suksesvol is.As die heelgetal nul is,kan enige addisionele waardes verkeerd wees.
 * 'N $sleutel2 sleutel met 'n voorwerp van twee,opsioneel drie sleutels,$sleutels4,$sleutel5 en $sleutel6,indien die versoek nie suksesvol is nie
 * Inligting oor die aksie.Die inligting word of op die boonste vlak of onder "item" deugegee as dit en ekele item is of "items" as dit verskeie is.As dit verskillende items is, word elkeen onder 'n sleutel met hul eie item-ID gevind.

Leë voorwerpe word teruggestuur as JSON-skikkings en nie as voorwerpe nie, terwyl leë parameters die werklike item van die item verwyder.

Meta submodules

 * wikibase: Gets information about the Wikibase client and the associated Wikibase repository.
 * wbcontentlanguages: Returns information about the content languages Wikibase accepts in different contexts.

Property submodules

 * pageterms: Get the Wikidata terms (typically labels, descriptions and aliases) associated with a page via a sitelink.
 * wbentityusage: Returns all entity IDs used in the given pages.

API modules

 * wbgetentities: Gets the data for multiple Wikibase entities.
 * wbavailablebadges: Queries available badge items.
 * wbcreateclaim: Creates Wikibase claims.
 * wbcreateredirect: Creates Entity redirects.
 * wbeditentity: Creates a single new Wikibase entity and modifies it with serialised information.
 * wbformatvalue: Formats DataValues.
 * wbgetclaims: Gets Wikibase claims.
 * wblinktitles: Associates two pages on two different wikis with a Wikibase item.
 * wbmergeitems: Merges multiple items.
 * wbparsevalue: Parses values using a ValueParser.
 * wbremoveclaims: Removes Wikibase claims.
 * wbremovequalifiers: Removes a qualifier from a claim.
 * wbremovereferences: Removes one or more references of the same statement.
 * wbsearchentities: Searches for entities using labels and aliases.
 * wbsetaliases: Sets the aliases for a Wikibase entity.
 * wbsetclaim: Creates or updates an entire Statement or Claim.
 * wbsetclaimvalue: Sets the value of a Wikibase claim.
 * wbsetdescription: Sets a description for a single Wikibase entity.
 * wbsetlabel: Sets a label for a single Wikibase entity.
 * wbsetqualifier: Creates a qualifier or sets the value of an existing one.
 * wbsetreference: Creates a reference or sets the value of an existing one.
 * wbsetsitelink: Associates a page on a wiki with a Wikibase item or removes an already made such association.
 * wbsgetsuggestions: Gets suggestions of additional properties to add to a Wikibase entity.
 * wbcheckconstraints: Performs constraint checks on any entity you want and returns the result.

Moontlike foute
Moontlike foute vir enige module kan gevind word met behulp van. The error format corresponds to that of the Mediawiki Action API. See API:Errors and warnings#Legacy format.

Alle foutboodskappe van die Wikibase-modules moet internasionaliseer word ( i18n) en gelokaliseer ( l10n). Die gebruikerstaal vir die aangemelde gebruiker is die standaard vir foutboodskappe, maar u kan dit ignoreer deur $ lc aan die URL-navraagstring toe te voeg.

Additional notes

 * Baie Wikimedia-wiki's het die Wikibase Client-uitbreiding. Hiermee kan API-kliënte die $ wb meta-submodule navraag doen om URL's te bepaal vir die volledige Wikibase-repo, en die $ prop-submodule om Wikidata-inligting te kry oor bladsye op die plaaslike wiki.
 * Die Kalendermodelle wat met Wikibase gebruik kan word,is die Gregoriaanse kalender(Q1985727) en die Juliaanse Kalender($2).
 * The API uses revision ids for edit collision detection. If there is an edit collision, the requester must acquire a newer revision id to be able to continue. This typically involves requesting  for the item in question, and then storing (and using) the revision from the entry.
 * Any MediaWiki installation can run Wikibase. On the Wikimedia cluster, most wikis do not run the full set of Wikibase extensions. Wikimedia Commons has its own Wikibase for properties of the files on Commons.
 * Do not test the  value for a particular error, instead use the   value as this will remain independent of localization.