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 String
deletedStatementsType
static String
duplicateLabelDescriptionType
static String
invalidFilePathType
static String
newItemType
static String
newMediaType
static String
newMediaWithoutFileNameType
static String
newMediaWithoutFilePathType
static String
newMediaWithoutWikitextType
static String
noDescType
static String
noLabelType
static String
noTypeType
-
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 void
batchIsBeginning()
Called before an edit batch is scrutinized.protected static boolean
isValidURL(String url)
Check if a URL looks legitimate for upload.boolean
prepareDependencies()
Prepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer.void
scrutinize(ItemEdit update)
Reads the candidate edit and emits warnings in the storevoid
scrutinize(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:EditScrutinizer
Prepare the dependencies(i.e. constraint-related pids and qids) needed by the scrutinizer. Called beforeEditScrutinizer.batchIsBeginning()
.- Specified by:
prepareDependencies
in classEditScrutinizer
- Returns:
- false if any necessary dependency is missing, true otherwise.
-
batchIsBeginning
public void batchIsBeginning()
Description copied from class:EditScrutinizer
Called before an edit batch is scrutinized.- Overrides:
batchIsBeginning
in classEditScrutinizer
-
scrutinize
public void scrutinize(MediaInfoEdit update)
Description copied from class:EditScrutinizer
Reads the candidate edit and emits warnings in the store- Specified by:
scrutinize
in classEditScrutinizer
- Parameters:
update
- : theItemEdit
to 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:EditScrutinizer
Reads the candidate edit and emits warnings in the store- Specified by:
scrutinize
in classEditScrutinizer
- Parameters:
update
- : theItemEdit
to scrutinize
-
-