public class WikibaseRevisionProcessor extends Object implements MwRevisionProcessor
Constructor and Description |
---|
WikibaseRevisionProcessor(EntityDocumentProcessor entityDocumentProcessor,
String siteIri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
finishRevisionProcessing()
Performs final actions that should be done after all revisions in a batch
of revisions have been processed.
|
void |
processItemRevision(MwRevision mwRevision) |
void |
processPropertyRevision(MwRevision mwRevision) |
void |
processRevision(MwRevision mwRevision)
Process the given MediaWiki revision.
|
void |
startRevisionProcessing(String siteName,
String baseUrl,
Map<Integer,String> namespaces)
Initialises the revision processor for processing revisions.
|
public WikibaseRevisionProcessor(EntityDocumentProcessor entityDocumentProcessor, String siteIri)
entityDocumentProcessor
- the object that entity documents will be forwarded tositeIri
- the IRI of the site that the data comes from, as used in
EntityIdValue.getSiteIri()
public void startRevisionProcessing(String siteName, String baseUrl, Map<Integer,String> namespaces)
MwRevisionProcessor
startRevisionProcessing
in interface MwRevisionProcessor
siteName
- the name of the sitebaseUrl
- the base URL of the sitenamespaces
- map from integer namespace ids to namespace prefixes;
namespace strings do not include the final ":" used in
MediaWiki to separate namespace prefixes from article titles,
and the prefixes use spaces, not underscores as in MediaWiki
URLs.public void processRevision(MwRevision mwRevision)
MwRevisionProcessor
processRevision
in interface MwRevisionProcessor
mwRevision
- the revision to processpublic void processItemRevision(MwRevision mwRevision)
public void processPropertyRevision(MwRevision mwRevision)
public void finishRevisionProcessing()
MwRevisionProcessor
It is important to understand that this method might be called many times during one processing run. Its main purpose is to signal the completion of one file, not of the whole processing. This is used only to manage the control flow of revision processing (e.g., to be sure that the most recent revision of a page has certainly been found). This method must not be used to do things that should happen at the very end of a run, such as writing a file with results.
finishRevisionProcessing
in interface MwRevisionProcessor
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage