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

public abstract class EditScrutinizer extends Object
Inspects an edit batch and emits warnings.
Author:
Antonin Delpeuch
  • Field Details

  • Constructor Details

    • EditScrutinizer

      public EditScrutinizer()
  • Method Details

    • setStore

      public void setStore(QAWarningStore store)
    • setFetcher

      public void setFetcher(ConstraintFetcher fetcher)
      The fetcher will be set to null if 'property_constraint_pid' is missing in the manifest.
    • setManifest

      public void setManifest(Manifest manifest)
    • getConstraintsRelatedId

      public String getConstraintsRelatedId(String name)
    • prepareDependencies

      public abstract boolean prepareDependencies()
      Prepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer. Called before batchIsBeginning().
      Returns:
      false if any necessary dependency is missing, true otherwise.
    • batchIsBeginning

      public void batchIsBeginning()
      Called before an edit batch is scrutinized.
    • scrutinize

      public void scrutinize(EntityEdit edit)
      Reads the candidate edit and emits warnings in the store
      Parameters:
      edit - : the EntityEdit to scrutinize
    • scrutinize

      public abstract void scrutinize(ItemEdit edit)
      Reads the candidate edit and emits warnings in the store
      Parameters:
      edit - : the ItemEdit to scrutinize
    • scrutinize

      public abstract void scrutinize(MediaInfoEdit edit)
      Reads the candidate edit and emits warnings in the store
      Parameters:
      edit - : the ItemEdit to scrutinize
    • batchIsFinished

      public void batchIsFinished()
      Method called once the edit batch has been read entirely
    • addIssue

      protected void addIssue(QAWarning warning)
      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

      protected void addIssue(String type, String aggregationId, QAWarning.Severity severity, int count)
    • info

      protected void info(String type)
      Helper to be used by subclasses to emit simple INFO warnings
    • warning

      protected void warning(String type)
      Helper to be used by subclasses to emit simple warnings
    • important

      protected void important(String type)
      Helper to be used by subclasses to emit simple important warnings
    • critical

      protected void critical(String type)
      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 qualifiers
      pid - the property to filter on
      Returns: