Class NewEntityScrutinizer
- java.lang.Object
-
- org.openrefine.wikibase.qa.scrutinizers.EditScrutinizer
-
- org.openrefine.wikibase.qa.scrutinizers.NewEntityScrutinizer
-
public class NewEntityScrutinizer extends EditScrutinizer
A scrutinizer that inspects new entities.- Author:
- Antonin Delpeuch
-
-
Field Summary
Fields Modifier and Type Field Description static StringdeletedStatementsTypestatic StringduplicateLabelDescriptionTypestatic StringinvalidFilePathTypestatic StringnewItemTypestatic StringnewMediaTypestatic StringnewMediaWithoutFileNameTypestatic StringnewMediaWithoutFilePathTypestatic StringnewMediaWithoutWikitextTypestatic StringnoDescTypestatic StringnoLabelTypestatic StringnoTypeType-
Fields inherited from class org.openrefine.wikibase.qa.scrutinizers.EditScrutinizer
_fetcher, _store, connection, enableSlowChecks, manifest
-
-
Constructor Summary
Constructors Constructor Description NewEntityScrutinizer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbatchIsBeginning()Called before an edit batch is scrutinized.protected static booleanisValidURL(String url)Check if a URL looks legitimate for upload.booleanprepareDependencies()Prepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer.voidscrutinize(ItemEdit update)Reads the candidate edit and emits warnings in the storevoidscrutinize(MediaInfoEdit update)Reads the candidate edit and emits warnings in the store-
Methods inherited from class org.openrefine.wikibase.qa.scrutinizers.EditScrutinizer
addIssue, addIssue, batchIsFinished, critical, findValues, getConstraintsRelatedId, important, info, infoNotFacetable, scrutinize, setApiConnection, setEnableSlowChecks, setFetcher, setManifest, setStore, warning
-
-
-
-
Field Detail
-
noLabelType
public static final String noLabelType
- See Also:
- Constant Field Values
-
noDescType
public static final String noDescType
- See Also:
- Constant Field Values
-
deletedStatementsType
public static final String deletedStatementsType
- See Also:
- Constant Field Values
-
noTypeType
public static final String noTypeType
- See Also:
- Constant Field Values
-
newItemType
public static final String newItemType
- See Also:
- Constant Field Values
-
duplicateLabelDescriptionType
public static final String duplicateLabelDescriptionType
- See Also:
- Constant Field Values
-
newMediaWithoutFilePathType
public static final String newMediaWithoutFilePathType
- See Also:
- Constant Field Values
-
newMediaWithoutFileNameType
public static final String newMediaWithoutFileNameType
- See Also:
- Constant Field Values
-
newMediaWithoutWikitextType
public static final String newMediaWithoutWikitextType
- See Also:
- Constant Field Values
-
newMediaType
public static final String newMediaType
- See Also:
- Constant Field Values
-
invalidFilePathType
public static final String invalidFilePathType
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
batchIsBeginning
public void batchIsBeginning()
Description copied from class:EditScrutinizerCalled before an edit batch is scrutinized.- Overrides:
batchIsBeginningin classEditScrutinizer
-
scrutinize
public void scrutinize(MediaInfoEdit update)
Description copied from class:EditScrutinizerReads the candidate edit and emits warnings in the store- Specified by:
scrutinizein classEditScrutinizer- Parameters:
update- : theItemEditto scrutinize
-
isValidURL
protected static boolean isValidURL(String url)
Check if a URL looks legitimate for upload. TODO we could potentially do a HEAD request to check it already exists, but perhaps that's too slow even for the slow mode.- Parameters:
url- the URL to check- Returns:
- whether the URL is syntactically correct
-
scrutinize
public void scrutinize(ItemEdit update)
Description copied from class:EditScrutinizerReads the candidate edit and emits warnings in the store- Specified by:
scrutinizein classEditScrutinizer- Parameters:
update- : theItemEditto scrutinize
-
-