Class FormatScrutinizer


  • public class FormatScrutinizer
    extends SnakScrutinizer
    A scrutinizer that detects incorrect formats in text values (mostly identifiers).
    Author:
    Antonin Delpeuch
    • Constructor Detail

      • FormatScrutinizer

        public FormatScrutinizer()
    • Method Detail

      • getPattern

        protected Set<Pattern> getPattern​(org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue pid)
        Loads the regex for a property and compiles it to a pattern (this is cached upstream, plus we are doing it only once per property and batch).
        Parameters:
        pid - the id of the property to fetch the constraints for
        Returns:
      • scrutinize

        public void scrutinize​(org.wikidata.wdtk.datamodel.interfaces.Snak snak,
                               org.wikidata.wdtk.datamodel.interfaces.EntityIdValue entityId,
                               boolean added)
        Description copied from class: SnakScrutinizer
        This is the method that subclasses should override to implement their checks.
        Specified by:
        scrutinize in class SnakScrutinizer
        Parameters:
        snak - : the snak to inspect
        entityId - : the entity on which it is going to (dis)appear
        added - : whether this snak is going to be added or deleted