Class EditScrutinizer

    • Field Detail

      • connection

        protected org.wikidata.wdtk.wikibaseapi.ApiConnection connection
      • enableSlowChecks

        protected boolean enableSlowChecks
    • Constructor Detail

      • EditScrutinizer

        public EditScrutinizer()
    • Method Detail

      • 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)
      • setApiConnection

        public void setApiConnection​(org.wikidata.wdtk.wikibaseapi.ApiConnection connection)
      • getConstraintsRelatedId

        public String getConstraintsRelatedId​(String name)
      • setEnableSlowChecks

        public void setEnableSlowChecks​(boolean enableSlowChecks)
        False by default.
        Parameters:
        enableSlowChecks - whether this scrutinizer is allowed to run more expensive checks (typically, those requesting to fetch external resources, make extra queries to an online serviceā€¦).
      • 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
      • info

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

        protected void infoNotFacetable​(String type)
        Helper to be used by subclasses to emit simple INFO warnings, which are not facetable
      • 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: