Class FormatScrutinizer
java.lang.Object
org.openrefine.wikidata.qa.scrutinizers.EditScrutinizer
org.openrefine.wikidata.qa.scrutinizers.StatementScrutinizer
org.openrefine.wikidata.qa.scrutinizers.SnakScrutinizer
org.openrefine.wikidata.qa.scrutinizers.FormatScrutinizer
A scrutinizer that detects incorrect formats in text values (mostly
identifiers).
- Author:
- Antonin Delpeuch
-
Field Summary
FieldsFields inherited from class org.openrefine.wikidata.qa.scrutinizers.EditScrutinizer
_fetcher, _store, manifest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPattern(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).booleanPrepare the dependencies(i.e.voidscrutinize(org.wikidata.wdtk.datamodel.interfaces.Snak snak, org.wikidata.wdtk.datamodel.interfaces.EntityIdValue entityId, boolean added) This is the method that subclasses should override to implement their checks.Methods inherited from class org.openrefine.wikidata.qa.scrutinizers.SnakScrutinizer
scrutinize, scrutinizeSnakSetMethods inherited from class org.openrefine.wikidata.qa.scrutinizers.StatementScrutinizer
scrutinize, scrutinize, scrutinizeStatementEntityEditMethods inherited from class org.openrefine.wikidata.qa.scrutinizers.EditScrutinizer
addIssue, addIssue, batchIsBeginning, batchIsFinished, critical, findValues, getConstraintsRelatedId, important, info, scrutinize, setFetcher, setManifest, setStore, warning
-
Field Details
-
type
- See Also:
-
formatConstraintQid
-
formatRegexPid
-
-
Constructor Details
-
FormatScrutinizer
public FormatScrutinizer()
-
-
Method Details
-
prepareDependencies
public boolean prepareDependencies()Description copied from class:EditScrutinizerPrepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer. Called beforeEditScrutinizer.batchIsBeginning().- Specified by:
prepareDependenciesin classEditScrutinizer- Returns:
- false if any necessary dependency is missing, true otherwise.
-
getPattern
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:SnakScrutinizerThis is the method that subclasses should override to implement their checks.- Specified by:
scrutinizein classSnakScrutinizer- Parameters:
snak- : the snak to inspectentityId- : the entity on which it is going to (dis)appearadded- : whether this snak is going to be added or deleted
-