Helpers#
Functions calling the MediaWiki and Wikibase APIs directly. Import them from wikibaseintegrator.wbi_helpers.
API calls#
A simplified function to call the MediaWiki API. |
|
A function to call the MediaWiki API. |
|
Creates a single new Wikibase entity and modifies it with serialised information. |
Search and queries#
Performs a search for entities in the Wikibase instance using labels and aliases. |
|
Perform a fulltext search on the mediawiki instance. |
|
A method which allows for retrieval of a list of Wikidata entities. |
|
Static method which can be used to execute any SPARQL query |
Edits#
A static method to merge two items. |
|
Merge several items into the one with the lowest numeric ID, one wbmergeitems call per merged item. |
|
A static method to merge two lexemes |
|
A static method to turn an item into a redirect to another item, with the wbcreateredirect API. |
|
Create or replace a single statement, with its qualifiers and references, with the wbsetclaim API. |
|
Delete a claim from an entity |
|
Delete a page |
Lexemes#
Adds Form to Lexeme |
|
Edits representations and grammatical features of a Form |
|
Removes Form from Lexeme |
|
Adds a Sense to a Lexeme |
|
Edits glosses of a Sense |
|
Removes Sense from Lexeme |
Values#
Parse values written as text (e.g. '3 March 1850', '1850s', '12±0.5') into data values, with the parsers of the Wikibase instance and the wbparsevalue API. |
|
A formatting function mostly used for Quantity datatype. |
|
Get the items which can be used as badges of sitelinks (e.g. 'Q17437796', featured article, on Wikidata), with the wbavailablebadges API. |
|
Check the constraint violations of one or more entities or claims, using the target Wikibase instance's own constraint checker (the |
Wikibase instance#
Check the features of a Wikibase instance: the MediaWiki version, the installed extensions, the entity types and the datatypes it supports, and whether the SPARQL endpoint answers. |
|
The features of a Wikibase instance, as returned by check_wikibase(). |
|
Return a user agent string suitable for interacting with the Wikibase instance. |
|
Downloads the TTL (Terse RDF Triple Language) content of a specific entity from a Wikibase instance. |
Experimental#
Build a WikibaseIntegrator entity from a simplified JSON string: labels, descriptions and aliases by language, and the claims by property, each claim being a value or a list of values, and each value a string or a dict (e.g. |