Class EditScrutinizer
java.lang.Object
org.openrefine.wikidata.qa.scrutinizers.EditScrutinizer
- Direct Known Subclasses:
ConflictsWithScrutinizer,DescriptionScrutinizer,DifferenceWithinRangeScrutinizer,ItemRequiresScrutinizer,MultiValueScrutinizer,NewEntityScrutinizer,NoEditsMadeScrutinizer,SingleValueScrutinizer,StatementScrutinizer,UnsourcedScrutinizer,UseAsQualifierScrutinizer
Inspects an edit batch and emits warnings.
- Author:
- Antonin Delpeuch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConstraintFetcherprotected QAWarningStoreprotected Manifest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIssue(String type, String aggregationId, QAWarning.Severity severity, int count) protected voidEmits an issue that will be reported to the user, after merging with other issues of the same kind.voidCalled before an edit batch is scrutinized.voidMethod called once the edit batch has been read entirelyprotected voidHelper to be used by subclasses to emit simple critical warningsprotected List<org.wikidata.wdtk.datamodel.interfaces.Value>findValues(List<org.wikidata.wdtk.datamodel.interfaces.SnakGroup> groups, String pid) Returns the values of a given property in qualifiersprotected voidHelper to be used by subclasses to emit simple important warningsprotected voidHelper to be used by subclasses to emit simple INFO warningsabstract booleanPrepare the dependencies(i.e.voidscrutinize(EntityEdit edit) Reads the candidate edit and emits warnings in the storeabstract voidscrutinize(ItemEdit edit) Reads the candidate edit and emits warnings in the storeabstract voidscrutinize(MediaInfoEdit edit) Reads the candidate edit and emits warnings in the storevoidsetFetcher(ConstraintFetcher fetcher) The fetcher will be set to null if 'property_constraint_pid' is missing in the manifest.voidsetManifest(Manifest manifest) voidsetStore(QAWarningStore store) protected voidHelper to be used by subclasses to emit simple warnings
-
Field Details
-
_store
-
_fetcher
-
manifest
-
-
Constructor Details
-
EditScrutinizer
public EditScrutinizer()
-
-
Method Details
-
setStore
-
setFetcher
The fetcher will be set to null if 'property_constraint_pid' is missing in the manifest. -
setManifest
-
getConstraintsRelatedId
-
prepareDependencies
public abstract boolean prepareDependencies()Prepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer. Called beforebatchIsBeginning().- Returns:
- false if any necessary dependency is missing, true otherwise.
-
batchIsBeginning
public void batchIsBeginning()Called before an edit batch is scrutinized. -
scrutinize
Reads the candidate edit and emits warnings in the store- Parameters:
edit- : theEntityEditto scrutinize
-
scrutinize
Reads the candidate edit and emits warnings in the store- Parameters:
edit- : theItemEditto scrutinize
-
scrutinize
Reads the candidate edit and emits warnings in the store- Parameters:
edit- : theItemEditto scrutinize
-
batchIsFinished
public void batchIsFinished()Method called once the edit batch has been read entirely -
addIssue
Emits an issue that will be reported to the user, after merging with other issues of the same kind.- Parameters:
warning- the issue to report
-
addIssue
-
info
Helper to be used by subclasses to emit simple INFO warnings -
warning
Helper to be used by subclasses to emit simple warnings -
important
Helper to be used by subclasses to emit simple important warnings -
critical
Helper to be used by subclasses to emit simple critical warnings -
findValues
protected List<org.wikidata.wdtk.datamodel.interfaces.Value> findValues(List<org.wikidata.wdtk.datamodel.interfaces.SnakGroup> groups, String pid) Returns the values of a given property in qualifiers- Parameters:
groups- the qualifierspid- the property to filter on- Returns:
-