Package org.openrefine.wikidata.editing
Class EditBatchProcessor
java.lang.Object
org.openrefine.wikidata.editing.EditBatchProcessor
Schedules and performs a list of updates to entities via the API.
- Author:
- Antonin Delpeuch
-
Constructor Summary
ConstructorsConstructorDescriptionEditBatchProcessor(org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher fetcher, org.wikidata.wdtk.wikibaseapi.WikibaseDataEditor editor, List<EntityEdit> entityDocuments, NewEntityLibrary library, String summary, int maxLag, List<String> tags, int batchSize, int maxEditsPerMinute) Initiates the process of pushing a batch of updates to Wikibase. -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms the next edit in the batch.protected voidintprogress()int
-
Constructor Details
-
EditBatchProcessor
public EditBatchProcessor(org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher fetcher, org.wikidata.wdtk.wikibaseapi.WikibaseDataEditor editor, List<EntityEdit> entityDocuments, NewEntityLibrary library, String summary, int maxLag, List<String> tags, int batchSize, int maxEditsPerMinute) Initiates the process of pushing a batch of updates to Wikibase. This schedules the updates and is a prerequisite for callingperformOneEdit.- Parameters:
fetcher- the fetcher to use to retrieve the current state of entitieseditor- the object to use to perform the editsentityDocuments- the list of entity updates to performlibrary- the library to use to keep track of new entity creationsummary- the summary to append to all editstags- the list of tags to apply to all editsbatchSize- the number of entities that should be retrieved in one go from the APImaxEditsPerMinute- the maximum number of edits per minute to do
-
-
Method Details
-
performEdit
Performs the next edit in the batch.- Throws:
InterruptedException
-
remainingEdits
public int remainingEdits()- Returns:
- the number of edits that remain to be done in the current batch
-
progress
public int progress()- Returns:
- the progress, measured as a percentage
-
prepareNewBatch
- Throws:
InterruptedException
-