WikibaseIntegrator
WikibaseIntegrator copied to clipboard
A Python module to manipulate data on a Wikibase instance (like Wikidata) through the MediaWiki Wikibase API and the Wikibase SPARQL endpoint.
See discussion
 code is here https://github.com/internetarchive/wcdimportbot/blob/00dc45896d7e85e96f934bd13be2e9c6931cda17/src/models/wikibase/crud/update.py#L117
Find a way to add some callbacks method to allow control over part on the add/update/remove process. These callback will be Empty/Optional by default, but wbi_helpers will provide helpful/default methods...
Need to setup service containers in the Github Actions pipeline (https://docs.github.com/en/actions/using-containerized-services/about-service-containers) to test WikibaseIntegrator 0.12+ against stable/legacy/LTSs versions (https://www.mediawiki.org/wiki/Version_lifecycle) and Wikidata too.
https://www.wikidata.org/w/api.php?action=help&modules=query that module enables search using the cirrussearch extensions on Wikidata, see https://www.mediawiki.org/wiki/Help:Extension:WikibaseCirrusSearch It is much more powerful than wbsearchentities it seems. Example search is here: https://www.wikidata.org/w/api.php?format=json&action=query&list=search&srprop=&srlimit=10&srsearch=-haswbstatement:P31=Q13442814%20-haswbstatement:P31=Q5633421%20breast%20cancer
Close #377
 code here https://github.com/dpriskorn/hiking_trail_matcher/commit/53fda373276889f310e8371eca2a7424e9370146
I prefer not to have more than one class in each file to ease navigation.
This helps check and correct the code before commit. See https://github.com/internetarchive/wcdimportbot/blob/main/.pre-commit-config.yaml (you are free to copy-paste it if you want :) )
A good use case would be to replace a property number to another in all of a wikibase. Like, replace all statements using PXX and use PYY instead (PXX and...