Pomoc MediaWiki API

To jest automatycznie wygenerowana strona dokumentacji MediaWiki API.

Dokumentacja i przykłady: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_pag

action=wbeditentity

(main | wbeditentity)
  • Ten moduł wymaga praw odczytu.
  • Ten moduł wymaga praw zapisu.
  • Ten moduł akceptuje tylko żądania POST.
  • Źródło: WikibaseClient
  • Licencja: GPL-2.0-or-later

Creates a single new Wikibase entity and modifies it with serialised information.

Parametry:
id

The identifier for the entity, including the prefix. Use either id or site and title together.

new

If set, a new entity will be created. Set this to the type of the entity to be created. It is not allowed to have this set when id is also set.

Jedna z następujących wartości: item, property
site

An identifier for the site on which the page resides. Use together with title to make a complete sitelink.

Jedna z następujących wartości:
title

Title of the page to associate. Use together with site to make a complete sitelink.

baserevid

The numeric identifier for the revision to base the modification on. This is used for detecting conflicts during save.

Type: integer
summary

Summary for the edit. Will be prepended by an automatically generated comment. The length limit of the autocomment together with the summary is 260 characters. Be aware that everything above that limit will be cut off.

tags

Change tags to apply to the revision.

Wartości (oddziel za pomocą | lub alternatywy):
token

Token „csrf” pobrany z action=query&meta=tokens

This parameter is required.
bot

Oznacz tę zmianę jako wykonaną przez bota. Ten znacznik adresu URL będzie brany pod uwagę tylko, jeśli użytkownik należy do grupy „Boty”.

Type: boolean (details)
data

The serialized object that is used as the data source. A newly created entity will be assigned an 'id'.

This parameter is required.
clear

If set, the complete entity is emptied before proceeding. The entity will not be saved before it is filled with the "data", possibly with parts excluded.

Type: boolean (details)
Przykłady:
Create a new empty item, return full entity structure
api.php?action=wbeditentity&new=item&data={} [otwórz w brudnopisie]
Utwórz nowy element i ustaw etykiety dla de i en
api.php?action=wbeditentity&new=item&data={"labels":{"de":{"language":"de","value":"de-value"},"en":{"language":"en","value":"en-value"}}} [otwórz w brudnopisie]
Create a new property containing the json data, return full entity structure
api.php?action=wbeditentity&new=property&data={"labels":{"en-gb":{"language":"en-gb","value":"Propertylabel"}},"descriptions":{"en-gb":{"language":"en-gb","value":"Propertydescription"}},"datatype":"string"} [otwórz w brudnopisie]
Clear all data from entity with ID Q42
api.php?action=wbeditentity&clear=true&id=Q42&data={} [otwórz w brudnopisie]
Clear all data from entity with ID Q42 and set a label for en
api.php?action=wbeditentity&clear=true&id=Q42&data={"labels":{"en":{"language":"en","value":"en-value"}}} [otwórz w brudnopisie]
Dodaje etykietę, nie zastępując jej, jeśli już istnieje
api.php?action=wbeditentity&id=Q42&data={"labels":[{"language":"no","value":"Bar","add":""}]} [otwórz w brudnopisie]
Usuwa etykietę
api.php?action=wbeditentity&id=Q42&data={"labels":[{"language":"en","value":"Foo","remove":""}]} [otwórz w brudnopisie]
Sets sitelink for nowiki, overwriting it if it already exists
api.php?action=wbeditentity&id=Q42&data={"sitelinks":{"nowiki":{"site":"nowiki","title":"København"}}} [otwórz w brudnopisie]
Sets description for nb, overwriting it if it already exists
api.php?action=wbeditentity&id=Q42&data={"descriptions":{"nb":{"language":"nb","value":"nb-Description-Here"}}} [otwórz w brudnopisie]
Creates a new claim on the item for the property P56 and a value of "ExampleString"
api.php?action=wbeditentity&id=Q42&data={"claims":[{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}]} [otwórz w brudnopisie]
Removes the claims from the item with the GUIDs Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X
api.php?action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F","remove":""},{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","remove":""}]} [otwórz w brudnopisie]
Sets the claim with the GUID to the value of the claim
api.php?action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ChangedString","type":"string"}},"type":"statement","rank":"normal"}]} [otwórz w brudnopisie]