Class EditOnlineDataExample

java.lang.Object
org.wikidata.wdtk.examples.EditOnlineDataExample

public class EditOnlineDataExample extends Object
This example shows how to create and modify data through the web API of a Wikibase site.

IMPORTANT: Running this program will perform edits on test.wikidata.org. These edits are permanent and public. When running this program as is, the edits will be performed without logging in. This means that your current IP address will be recorded in the edit history of the page. If you prefer to use a login, please comment-in the respective line in the source code and modify it to use your credentials.

Note that all modification operations can throw an MediaWikiApiErrorException (if there was an API error) or IOException (if there was a network error, etc.). We do not handle this here. In real applications, you may want to handle some subclasses of MediaWikiApiErrorException in special ways, e.g., EditConflictErrorException (you tried to edit an entity that has been modified by someone else since) and NoSuchEntityErrorException (you tried to modify an entity that meanwhile was deleted).

Author:
Markus Kroetzsch
  • Constructor Details

    • EditOnlineDataExample

      public EditOnlineDataExample()
  • Method Details